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,184 +0,0 @@
|
|
|
1
|
-
@use '../../styles/theme.scss' as *;
|
|
2
|
-
|
|
3
|
-
.dasar-card {
|
|
4
|
-
display: block;
|
|
5
|
-
|
|
6
|
-
&.full-width {
|
|
7
|
-
display: flex;
|
|
8
|
-
width: 100%;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.dasar-card-container {
|
|
13
|
-
background-color: var(--card-background, var(--theme-bg-surface-color));
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
display: flex;
|
|
17
|
-
width: 100%;
|
|
18
|
-
|
|
19
|
-
&.hide-overflow {
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.size-xs {
|
|
24
|
-
font-size: var(--card-font-size-xs, var(--font-size-xs));
|
|
25
|
-
}
|
|
26
|
-
&.size-sm {
|
|
27
|
-
font-size: var(--card-font-size-sm, var(--font-size-sm));
|
|
28
|
-
}
|
|
29
|
-
&.size-md {
|
|
30
|
-
font-size: var(--card-font-size-md, var(--font-size-base));
|
|
31
|
-
}
|
|
32
|
-
&.size-lg {
|
|
33
|
-
font-size: var(--card-font-size-lg, var(--font-size-lg));
|
|
34
|
-
}
|
|
35
|
-
&.size-xl {
|
|
36
|
-
font-size: var(--card-font-size-xl, var(--font-size-xl));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.appearance-outline {
|
|
40
|
-
border: 1px solid var(--card-outline-border, var(--theme-border-strong-color));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.appearance-borderless {
|
|
44
|
-
border: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.appearance-elevated {
|
|
48
|
-
border: 1px solid var(--card-elevated-border, var(--theme-border-strong-color));
|
|
49
|
-
box-shadow: var(
|
|
50
|
-
--card-elevated-shadow,
|
|
51
|
-
0 10px 15px -3px rgba(0, 0, 0, 0.05),
|
|
52
|
-
0 4px 6px -4px rgba(0, 0, 0, 0.03)
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&.radius-none {
|
|
57
|
-
border-radius: var(--card-radius-none, var(--radius-none));
|
|
58
|
-
}
|
|
59
|
-
&.radius-xs {
|
|
60
|
-
border-radius: var(--card-radius-xs, var(--radius-xs));
|
|
61
|
-
}
|
|
62
|
-
&.radius-sm {
|
|
63
|
-
border-radius: var(--card-radius-sm, var(--radius-sm));
|
|
64
|
-
}
|
|
65
|
-
&.radius-md {
|
|
66
|
-
border-radius: var(--card-radius-md, var(--radius-md));
|
|
67
|
-
}
|
|
68
|
-
&.radius-lg {
|
|
69
|
-
border-radius: var(--card-radius-lg, var(--radius-lg));
|
|
70
|
-
}
|
|
71
|
-
&.radius-xl {
|
|
72
|
-
border-radius: var(--card-radius-xl, var(--radius-xl));
|
|
73
|
-
}
|
|
74
|
-
&.radius-full {
|
|
75
|
-
border-radius: var(--card-radius-full, var(--radius-full));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&.spacing-normal {
|
|
79
|
-
.dasar-card-header {
|
|
80
|
-
padding: var(--card-normal-header-padding-vertical, var(--space-base))
|
|
81
|
-
var(--card-normal-header-padding-horizontal, var(--space-4));
|
|
82
|
-
}
|
|
83
|
-
.dasar-card-body {
|
|
84
|
-
padding: var(--card-normal-body-padding-vertical, var(--space-4))
|
|
85
|
-
var(--card-normal-body-padding-horizontal, var(--space-4));
|
|
86
|
-
}
|
|
87
|
-
.dasar-card-actions {
|
|
88
|
-
padding: var(--card-normal-actions-padding, var(--space-4));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&.spacing-compact {
|
|
93
|
-
.dasar-card-header {
|
|
94
|
-
padding: var(--card-compact-header-padding, var(--space-base));
|
|
95
|
-
}
|
|
96
|
-
.dasar-card-body {
|
|
97
|
-
padding: var(--card-compact-body-padding, var(--space-base));
|
|
98
|
-
}
|
|
99
|
-
.dasar-card-actions {
|
|
100
|
-
padding: var(--card-compact-actions-padding, var(--space-base));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&.fluid {
|
|
105
|
-
.dasar-card-header,
|
|
106
|
-
.dasar-card-body,
|
|
107
|
-
.dasar-card-caption,
|
|
108
|
-
.dasar-card-actions {
|
|
109
|
-
padding: 0 !important;
|
|
110
|
-
margin: 0 !important;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.dasar-card-header {
|
|
116
|
-
border-bottom: 1px solid var(--card-header-border, var(--theme-border-strong-color));
|
|
117
|
-
justify-content: space-between;
|
|
118
|
-
align-items: center;
|
|
119
|
-
display: flex;
|
|
120
|
-
|
|
121
|
-
.dasar-card-title {
|
|
122
|
-
color: var(--card-title-color, var(--theme-text-primary-color));
|
|
123
|
-
font-weight: var(--card-title-font-weight, var(--font-weight-semibold));
|
|
124
|
-
font-size: inherit;
|
|
125
|
-
margin: 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.dasar-card-header-content {
|
|
129
|
-
flex: 1;
|
|
130
|
-
min-width: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.dasar-card-extra-header,
|
|
134
|
-
.dasar-card-close-wrapper {
|
|
135
|
-
flex-shrink: 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.appearance-borderless & {
|
|
139
|
-
border: none;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&.fluid {
|
|
143
|
-
padding: 0 !important;
|
|
144
|
-
margin: 0 !important;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.dasar-card-body {
|
|
149
|
-
color: var(--card-body-color, var(--theme-text-primary-color));
|
|
150
|
-
line-height: var(--line-height-normal);
|
|
151
|
-
flex: 1;
|
|
152
|
-
|
|
153
|
-
&.fluid {
|
|
154
|
-
padding: 0 !important;
|
|
155
|
-
margin: 0 !important;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.dasar-card-caption {
|
|
160
|
-
color: var(--card-caption-color, var(--theme-text-secondary-color));
|
|
161
|
-
font-size: var(--card-caption-font-size, var(--font-size-xs));
|
|
162
|
-
|
|
163
|
-
&.fluid {
|
|
164
|
-
padding: 0 !important;
|
|
165
|
-
margin: 0 !important;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.dasar-card-actions {
|
|
170
|
-
background-color: var(--card-actions-background, transparent);
|
|
171
|
-
align-items: center;
|
|
172
|
-
border-top: none;
|
|
173
|
-
display: flex;
|
|
174
|
-
gap: var(--card-actions-gap, 12px);
|
|
175
|
-
|
|
176
|
-
&.fluid {
|
|
177
|
-
padding: 0 !important;
|
|
178
|
-
margin: 0 !important;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
> * {
|
|
182
|
-
flex: 1;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { DasarCard } from './dasar-card';
|
|
3
|
-
|
|
4
|
-
describe('DasarCard', () => {
|
|
5
|
-
let component: DasarCard;
|
|
6
|
-
let fixture: ComponentFixture<DasarCard>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [DasarCard],
|
|
11
|
-
}).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(DasarCard);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
await fixture.whenStable();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
booleanAttribute,
|
|
3
|
-
ViewEncapsulation,
|
|
4
|
-
ChangeDetectorRef,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
ContentChild,
|
|
7
|
-
HostBinding,
|
|
8
|
-
Component,
|
|
9
|
-
Directive,
|
|
10
|
-
Output,
|
|
11
|
-
inject,
|
|
12
|
-
signal,
|
|
13
|
-
Input,
|
|
14
|
-
} from '@angular/core';
|
|
15
|
-
import { CommonModule } from '@angular/common';
|
|
16
|
-
|
|
17
|
-
import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
|
|
18
|
-
import { ClassType, ScaleAttributeType, StyleType } from '../../models/type.model';
|
|
19
|
-
import { DasarThemeService } from '../../services/theme.service';
|
|
20
|
-
import { DasarButton } from '../dasar-button/dasar-button';
|
|
21
|
-
import { resolveThemeDefault } from '../../utils/common';
|
|
22
|
-
import { DasarIcon } from '../dasar-icon/dasar-icon';
|
|
23
|
-
|
|
24
|
-
export type DasarCardSize = Extract<ScaleAttributeType, 'sm' | 'md' | 'lg'>;
|
|
25
|
-
export type DasarCardAppearance = 'outline' | 'borderless' | 'elevated';
|
|
26
|
-
export type DasarCardSpacing = 'normal' | 'compact';
|
|
27
|
-
export type DasarCardRadius = ScaleAttributeType;
|
|
28
|
-
|
|
29
|
-
export interface DasarCardConfig {
|
|
30
|
-
appearance?: 'outline' | 'borderless' | 'elevated';
|
|
31
|
-
spacing?: 'normal' | 'compact';
|
|
32
|
-
radius?: ScaleAttributeType; // Or DasarCardRadius
|
|
33
|
-
size?: Extract<ScaleAttributeType, 'sm' | 'md' | 'lg'>; // Or DasarCardSize
|
|
34
|
-
label?: string;
|
|
35
|
-
contentHeaderStyle?: StyleType;
|
|
36
|
-
extraHeaderStyle?: StyleType;
|
|
37
|
-
containerStyle?: StyleType;
|
|
38
|
-
captionStyle?: StyleType;
|
|
39
|
-
headerStyle?: StyleType;
|
|
40
|
-
actionStyle?: StyleType;
|
|
41
|
-
bodyStyle?: StyleType;
|
|
42
|
-
contentHeaderClass?: ClassType;
|
|
43
|
-
extraHeaderClass?: ClassType;
|
|
44
|
-
containerClass?: ClassType;
|
|
45
|
-
captionClass?: ClassType;
|
|
46
|
-
actionClass?: ClassType;
|
|
47
|
-
headerClass?: ClassType;
|
|
48
|
-
bodyClass?: ClassType;
|
|
49
|
-
captionFluid?: boolean;
|
|
50
|
-
hideOverflow?: boolean;
|
|
51
|
-
headerFluid?: boolean;
|
|
52
|
-
actionFluid?: boolean;
|
|
53
|
-
bodyFluid?: boolean;
|
|
54
|
-
fullWidth?: boolean;
|
|
55
|
-
closable?: boolean;
|
|
56
|
-
fluid?: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@Directive({ selector: '[extra-header-slot]', standalone: true })
|
|
60
|
-
export class DasarCardExtraHeaderSlot {}
|
|
61
|
-
@Directive({ selector: '[caption-slot]', standalone: true })
|
|
62
|
-
export class DasarCardCaptionSlot {}
|
|
63
|
-
@Directive({ selector: '[header-slot]', standalone: true })
|
|
64
|
-
export class DasarCardHeaderSlot {}
|
|
65
|
-
@Directive({ selector: '[action-slot]', standalone: true })
|
|
66
|
-
export class DasarCardActionSlot {}
|
|
67
|
-
|
|
68
|
-
@Component({
|
|
69
|
-
imports: [CommonModule, DasarButton, DasarIcon],
|
|
70
|
-
encapsulation: ViewEncapsulation.None,
|
|
71
|
-
templateUrl: './dasar-card.html',
|
|
72
|
-
styleUrls: ['./dasar-card.scss'],
|
|
73
|
-
selector: 'dasar-card',
|
|
74
|
-
standalone: true,
|
|
75
|
-
})
|
|
76
|
-
export class DasarCard {
|
|
77
|
-
@ContentChild(DasarCardExtraHeaderSlot) providedExtraHeader?: DasarCardExtraHeaderSlot;
|
|
78
|
-
@ContentChild(DasarCardCaptionSlot) providedCaption?: DasarCardCaptionSlot;
|
|
79
|
-
@ContentChild(DasarCardHeaderSlot) providedHeader?: DasarCardHeaderSlot;
|
|
80
|
-
@ContentChild(DasarCardActionSlot) providedAction?: DasarCardActionSlot;
|
|
81
|
-
|
|
82
|
-
private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
|
|
83
|
-
private themeService = inject(DasarThemeService, { optional: true });
|
|
84
|
-
|
|
85
|
-
private cdr = inject(ChangeDetectorRef);
|
|
86
|
-
isClosed = signal<boolean>(false);
|
|
87
|
-
|
|
88
|
-
@Input() appearance = resolveThemeDefault(
|
|
89
|
-
'card',
|
|
90
|
-
'appearance',
|
|
91
|
-
'elevated',
|
|
92
|
-
this.themeProvider,
|
|
93
|
-
this.themeService,
|
|
94
|
-
);
|
|
95
|
-
@Input() spacing = resolveThemeDefault(
|
|
96
|
-
'card',
|
|
97
|
-
'spacing',
|
|
98
|
-
'normal',
|
|
99
|
-
this.themeProvider,
|
|
100
|
-
this.themeService,
|
|
101
|
-
);
|
|
102
|
-
@Input() radius = resolveThemeDefault(
|
|
103
|
-
'card',
|
|
104
|
-
'radius',
|
|
105
|
-
'lg',
|
|
106
|
-
this.themeProvider,
|
|
107
|
-
this.themeService,
|
|
108
|
-
);
|
|
109
|
-
@Input() size = resolveThemeDefault('card', 'size', 'md', this.themeProvider, this.themeService);
|
|
110
|
-
@Input() label = resolveThemeDefault(
|
|
111
|
-
'card',
|
|
112
|
-
'label',
|
|
113
|
-
undefined,
|
|
114
|
-
this.themeProvider,
|
|
115
|
-
this.themeService,
|
|
116
|
-
);
|
|
117
|
-
@Input({ alias: 'content-header-style' }) contentHeaderStyle = resolveThemeDefault(
|
|
118
|
-
'card',
|
|
119
|
-
'contentHeaderStyle',
|
|
120
|
-
null,
|
|
121
|
-
this.themeProvider,
|
|
122
|
-
this.themeService,
|
|
123
|
-
);
|
|
124
|
-
@Input({ alias: 'extra-header-style' }) extraHeaderStyle = resolveThemeDefault(
|
|
125
|
-
'card',
|
|
126
|
-
'extraHeaderStyle',
|
|
127
|
-
null,
|
|
128
|
-
this.themeProvider,
|
|
129
|
-
this.themeService,
|
|
130
|
-
);
|
|
131
|
-
@Input({ alias: 'container-style' }) containerStyle = resolveThemeDefault(
|
|
132
|
-
'card',
|
|
133
|
-
'containerStyle',
|
|
134
|
-
null,
|
|
135
|
-
this.themeProvider,
|
|
136
|
-
this.themeService,
|
|
137
|
-
);
|
|
138
|
-
@Input({ alias: 'caption-style' }) captionStyle = resolveThemeDefault(
|
|
139
|
-
'card',
|
|
140
|
-
'captionStyle',
|
|
141
|
-
null,
|
|
142
|
-
this.themeProvider,
|
|
143
|
-
this.themeService,
|
|
144
|
-
);
|
|
145
|
-
@Input({ alias: 'header-style' }) headerStyle = resolveThemeDefault(
|
|
146
|
-
'card',
|
|
147
|
-
'headerStyle',
|
|
148
|
-
null,
|
|
149
|
-
this.themeProvider,
|
|
150
|
-
this.themeService,
|
|
151
|
-
);
|
|
152
|
-
@Input({ alias: 'action-style' }) actionStyle = resolveThemeDefault(
|
|
153
|
-
'card',
|
|
154
|
-
'actionStyle',
|
|
155
|
-
null,
|
|
156
|
-
this.themeProvider,
|
|
157
|
-
this.themeService,
|
|
158
|
-
);
|
|
159
|
-
@Input({ alias: 'body-style' }) bodyStyle = resolveThemeDefault(
|
|
160
|
-
'card',
|
|
161
|
-
'bodyStyle',
|
|
162
|
-
null,
|
|
163
|
-
this.themeProvider,
|
|
164
|
-
this.themeService,
|
|
165
|
-
);
|
|
166
|
-
@Input({ alias: 'content-header-class' }) contentHeaderClass = resolveThemeDefault(
|
|
167
|
-
'card',
|
|
168
|
-
'contentHeaderClass',
|
|
169
|
-
null,
|
|
170
|
-
this.themeProvider,
|
|
171
|
-
this.themeService,
|
|
172
|
-
);
|
|
173
|
-
@Input({ alias: 'extra-header-class' }) extraHeaderClass = resolveThemeDefault(
|
|
174
|
-
'card',
|
|
175
|
-
'extraHeaderClass',
|
|
176
|
-
null,
|
|
177
|
-
this.themeProvider,
|
|
178
|
-
this.themeService,
|
|
179
|
-
);
|
|
180
|
-
@Input({ alias: 'container-class' }) containerClass = resolveThemeDefault(
|
|
181
|
-
'card',
|
|
182
|
-
'containerClass',
|
|
183
|
-
null,
|
|
184
|
-
this.themeProvider,
|
|
185
|
-
this.themeService,
|
|
186
|
-
);
|
|
187
|
-
@Input({ alias: 'caption-class' }) captionClass = resolveThemeDefault(
|
|
188
|
-
'card',
|
|
189
|
-
'captionClass',
|
|
190
|
-
null,
|
|
191
|
-
this.themeProvider,
|
|
192
|
-
this.themeService,
|
|
193
|
-
);
|
|
194
|
-
@Input({ alias: 'action-class' }) actionClass = resolveThemeDefault(
|
|
195
|
-
'card',
|
|
196
|
-
'actionClass',
|
|
197
|
-
null,
|
|
198
|
-
this.themeProvider,
|
|
199
|
-
this.themeService,
|
|
200
|
-
);
|
|
201
|
-
@Input({ alias: 'header-class' }) headerClass = resolveThemeDefault(
|
|
202
|
-
'card',
|
|
203
|
-
'headerClass',
|
|
204
|
-
null,
|
|
205
|
-
this.themeProvider,
|
|
206
|
-
this.themeService,
|
|
207
|
-
);
|
|
208
|
-
@Input({ alias: 'body-class' }) bodyClass = resolveThemeDefault(
|
|
209
|
-
'card',
|
|
210
|
-
'bodyClass',
|
|
211
|
-
null,
|
|
212
|
-
this.themeProvider,
|
|
213
|
-
this.themeService,
|
|
214
|
-
);
|
|
215
|
-
@Input({ transform: booleanAttribute }) closable = resolveThemeDefault(
|
|
216
|
-
'card',
|
|
217
|
-
'closable',
|
|
218
|
-
false,
|
|
219
|
-
this.themeProvider,
|
|
220
|
-
this.themeService,
|
|
221
|
-
);
|
|
222
|
-
@Input({ transform: booleanAttribute }) fluid = resolveThemeDefault(
|
|
223
|
-
'card',
|
|
224
|
-
'fluid',
|
|
225
|
-
false,
|
|
226
|
-
this.themeProvider,
|
|
227
|
-
this.themeService,
|
|
228
|
-
);
|
|
229
|
-
@Input({ alias: 'header-fluid', transform: booleanAttribute }) headerFluid = resolveThemeDefault(
|
|
230
|
-
'card',
|
|
231
|
-
'headerFluid',
|
|
232
|
-
false,
|
|
233
|
-
this.themeProvider,
|
|
234
|
-
this.themeService,
|
|
235
|
-
);
|
|
236
|
-
@Input({ alias: 'action-fluid', transform: booleanAttribute }) actionFluid = resolveThemeDefault(
|
|
237
|
-
'card',
|
|
238
|
-
'actionFluid',
|
|
239
|
-
false,
|
|
240
|
-
this.themeProvider,
|
|
241
|
-
this.themeService,
|
|
242
|
-
);
|
|
243
|
-
@Input({ alias: 'body-fluid', transform: booleanAttribute }) bodyFluid = resolveThemeDefault(
|
|
244
|
-
'card',
|
|
245
|
-
'bodyFluid',
|
|
246
|
-
false,
|
|
247
|
-
this.themeProvider,
|
|
248
|
-
this.themeService,
|
|
249
|
-
);
|
|
250
|
-
@Input({ alias: 'full-width', transform: booleanAttribute }) fullWidth = resolveThemeDefault(
|
|
251
|
-
'card',
|
|
252
|
-
'fullWidth',
|
|
253
|
-
false,
|
|
254
|
-
this.themeProvider,
|
|
255
|
-
this.themeService,
|
|
256
|
-
);
|
|
257
|
-
@Input({ alias: 'caption-fluid', transform: booleanAttribute }) captionFluid =
|
|
258
|
-
resolveThemeDefault('card', 'captionFluid', false, this.themeProvider, this.themeService);
|
|
259
|
-
@Input({ alias: 'hide-overflow', transform: booleanAttribute }) hideOverflow =
|
|
260
|
-
resolveThemeDefault('card', 'hideOverflow', false, this.themeProvider, this.themeService);
|
|
261
|
-
|
|
262
|
-
@Output() onClose = new EventEmitter<void>();
|
|
263
|
-
|
|
264
|
-
@HostBinding('class.dasar-card') readonly baseClass = true;
|
|
265
|
-
@HostBinding('class.full-width') get hasFullWidth(): boolean {
|
|
266
|
-
return this.fullWidth;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
get hasExtraHeader(): boolean {
|
|
270
|
-
return !!this.providedExtraHeader;
|
|
271
|
-
}
|
|
272
|
-
get hasHeader(): boolean {
|
|
273
|
-
return !!this.providedHeader;
|
|
274
|
-
}
|
|
275
|
-
get hasCaption(): boolean {
|
|
276
|
-
return !!this.providedCaption;
|
|
277
|
-
}
|
|
278
|
-
get hasAction(): boolean {
|
|
279
|
-
return !!this.providedAction;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
closeCard(): void {
|
|
283
|
-
this.isClosed.set(true);
|
|
284
|
-
this.onClose.emit();
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export const DasarCardComponent = [
|
|
289
|
-
DasarCardExtraHeaderSlot,
|
|
290
|
-
DasarCardCaptionSlot,
|
|
291
|
-
DasarCardHeaderSlot,
|
|
292
|
-
DasarCardActionSlot,
|
|
293
|
-
DasarCard,
|
|
294
|
-
] as const;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<dasar-button
|
|
2
|
-
[ngStyle]="containerStyle"
|
|
3
|
-
[ngClass]="containerClass"
|
|
4
|
-
[appearance]="appearance"
|
|
5
|
-
[disabled]="disabled"
|
|
6
|
-
[variant]="variant"
|
|
7
|
-
[radius]="radius"
|
|
8
|
-
[fluid]="fluid"
|
|
9
|
-
[size]="size"
|
|
10
|
-
(click)="click($event)"
|
|
11
|
-
class="dasar-chip-container"
|
|
12
|
-
>
|
|
13
|
-
<span class="chip-inner-content" [ngStyle]="contentStyle" [ngClass]="contentClass">
|
|
14
|
-
@if (iconName) {
|
|
15
|
-
<dasar-icon proje prefix-slot [name]="iconName" class="chip-icon" size="xs"></dasar-icon>
|
|
16
|
-
}
|
|
17
|
-
<span class="chip-label-wrapper" [ngStyle]="labelStyle" [ngClass]="labelClass">
|
|
18
|
-
@if (label) {
|
|
19
|
-
{{ label }}
|
|
20
|
-
} @else if (labelSlot) {
|
|
21
|
-
<ng-content select="[chip-label-slot]"></ng-content>
|
|
22
|
-
} @else {
|
|
23
|
-
<ng-content></ng-content>
|
|
24
|
-
}
|
|
25
|
-
</span>
|
|
26
|
-
@if (removable) {
|
|
27
|
-
<span
|
|
28
|
-
suffix-slot
|
|
29
|
-
(click)="remove($event)"
|
|
30
|
-
class="chip-close-wrapper"
|
|
31
|
-
aria-label="Remove"
|
|
32
|
-
role="button"
|
|
33
|
-
>
|
|
34
|
-
@if (closeSlot) {
|
|
35
|
-
<ng-content select="[chip-close-slot]"></ng-content>
|
|
36
|
-
} @else {
|
|
37
|
-
<dasar-icon [name]="closeIconName" class="chip-close-icon" size="xs" fluid></dasar-icon>
|
|
38
|
-
}
|
|
39
|
-
</span>
|
|
40
|
-
}
|
|
41
|
-
</span>
|
|
42
|
-
</dasar-button>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@use '../../styles/theme.scss' as *;
|
|
2
|
-
|
|
3
|
-
.dasar-chip {
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
|
|
6
|
-
.chip-inner-content {
|
|
7
|
-
gap: var(--chip-inner-gap, var(--space-1));
|
|
8
|
-
justify-content: space-between;
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.chip-label-wrapper {
|
|
15
|
-
text-overflow: ellipsis;
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
white-space: nowrap;
|
|
18
|
-
align-items: center;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.chip-close-wrapper {
|
|
23
|
-
margin-right: var(--chip-close-margin-right, -6px);
|
|
24
|
-
margin-left: var(--chip-close-margin-left, 2px);
|
|
25
|
-
transition: background-color 0.15s ease;
|
|
26
|
-
padding: var(--chip-close-padding, 0);
|
|
27
|
-
border-radius: var(--radius-full);
|
|
28
|
-
justify-content: center;
|
|
29
|
-
display: inline-flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host-context(.appearance-filled) .chip-close-wrapper:hover,
|
|
36
|
-
.dasar-chip-container[ng-reflect-appearance='filled'] .chip-close-wrapper:hover {
|
|
37
|
-
background-color: var(--chip-close-hover-bg, rgba(255, 255, 255, 0.2));
|
|
38
|
-
}
|