@haloduck/ui 2.0.14 → 2.0.15
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/fesm2022/haloduck-ui.mjs +136 -2
- package/fesm2022/haloduck-ui.mjs.map +1 -1
- package/index.d.ts +34 -3
- package/package.json +1 -1
package/fesm2022/haloduck-ui.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Input, Component, inject, ChangeDetectorRef, forwardRef, ViewChild, signal, EventEmitter, Output, ViewContainerRef, NgZone, isDevMode, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { Injectable, Input, Component, inject, ChangeDetectorRef, forwardRef, ViewChild, signal, EventEmitter, Output, ViewContainerRef, NgZone, isDevMode, ChangeDetectionStrategy, HostBinding, Directive } from '@angular/core';
|
|
3
3
|
import { signIn, confirmSignIn, resetPassword, confirmResetPassword } from 'aws-amplify/auth';
|
|
4
4
|
import * as i1$1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -3051,6 +3051,140 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
3051
3051
|
type: Input
|
|
3052
3052
|
}] } });
|
|
3053
3053
|
|
|
3054
|
+
class GroupedDirective {
|
|
3055
|
+
elementRef;
|
|
3056
|
+
renderer;
|
|
3057
|
+
haloduckGrouped = {};
|
|
3058
|
+
bgClasses = '';
|
|
3059
|
+
borderClasses = 'border border-light-inactive dark:border-dark-inactive rounded';
|
|
3060
|
+
labelText = '';
|
|
3061
|
+
labelClasses = 'absolute bg-light-inactive dark:bg-dark-inactive text-light-on-inactive dark:text-dark-on-inactive px-2 py-0.5 text-sm font-medium rounded';
|
|
3062
|
+
labelOffset = '-10px';
|
|
3063
|
+
hostClasses = 'relative';
|
|
3064
|
+
labelElement = null;
|
|
3065
|
+
constructor(elementRef, renderer) {
|
|
3066
|
+
this.elementRef = elementRef;
|
|
3067
|
+
this.renderer = renderer;
|
|
3068
|
+
}
|
|
3069
|
+
ngOnInit() {
|
|
3070
|
+
this.applyConfig();
|
|
3071
|
+
this.createBorder();
|
|
3072
|
+
this.createLabel();
|
|
3073
|
+
}
|
|
3074
|
+
applyConfig() {
|
|
3075
|
+
if (typeof this.haloduckGrouped === 'string') {
|
|
3076
|
+
this.labelText = this.haloduckGrouped;
|
|
3077
|
+
}
|
|
3078
|
+
else if (typeof this.haloduckGrouped === 'object') {
|
|
3079
|
+
const config = this.haloduckGrouped;
|
|
3080
|
+
this.bgClasses = config.bgClasses ?? this.bgClasses;
|
|
3081
|
+
this.borderClasses = config.borderClasses ?? this.borderClasses;
|
|
3082
|
+
this.labelText = config.labelText ?? this.labelText;
|
|
3083
|
+
this.labelClasses = config.labelClasses ?? this.labelClasses;
|
|
3084
|
+
this.labelOffset = config.labelOffset ?? this.labelOffset;
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
createBorder() {
|
|
3088
|
+
const element = this.elementRef.nativeElement;
|
|
3089
|
+
// 기존 테두리 클래스 제거
|
|
3090
|
+
this.removeBorderClasses(element);
|
|
3091
|
+
// Tailwind 클래스 추가
|
|
3092
|
+
this.addClasses(element, this.borderClasses);
|
|
3093
|
+
}
|
|
3094
|
+
createLabel() {
|
|
3095
|
+
if (!this.labelText)
|
|
3096
|
+
return;
|
|
3097
|
+
const element = this.elementRef.nativeElement;
|
|
3098
|
+
// 기존 라벨 제거
|
|
3099
|
+
if (this.labelElement) {
|
|
3100
|
+
this.renderer.removeChild(element, this.labelElement);
|
|
3101
|
+
}
|
|
3102
|
+
// 라벨 요소 생성
|
|
3103
|
+
this.labelElement = this.renderer.createElement('span');
|
|
3104
|
+
// Tailwind 클래스 적용
|
|
3105
|
+
if (this.labelElement) {
|
|
3106
|
+
this.addClasses(this.labelElement, this.labelClasses);
|
|
3107
|
+
}
|
|
3108
|
+
// 커스텀 스타일 (Tailwind로 매핑할 수 없는 속성들)
|
|
3109
|
+
this.renderer.setStyle(this.labelElement, 'top', this.labelOffset);
|
|
3110
|
+
this.renderer.setStyle(this.labelElement, 'left', '8px');
|
|
3111
|
+
this.renderer.setStyle(this.labelElement, 'white-space', 'nowrap');
|
|
3112
|
+
this.renderer.setStyle(this.labelElement, 'z-index', '10');
|
|
3113
|
+
this.renderer.setStyle(this.labelElement, 'pointer-events', 'none');
|
|
3114
|
+
// 라벨 텍스트 설정
|
|
3115
|
+
this.renderer.setProperty(this.labelElement, 'textContent', this.labelText);
|
|
3116
|
+
// 요소에 라벨 추가
|
|
3117
|
+
this.renderer.appendChild(element, this.labelElement);
|
|
3118
|
+
}
|
|
3119
|
+
addClasses(element, classString) {
|
|
3120
|
+
if (!classString)
|
|
3121
|
+
return;
|
|
3122
|
+
// 공백으로 구분된 클래스들을 분리하여 각각 추가
|
|
3123
|
+
const classes = classString.split(' ').filter(className => className.trim());
|
|
3124
|
+
classes.forEach(className => {
|
|
3125
|
+
if (className.trim()) {
|
|
3126
|
+
this.renderer.addClass(element, className.trim());
|
|
3127
|
+
}
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
removeBorderClasses(element) {
|
|
3131
|
+
// 기본 테두리 클래스들 제거
|
|
3132
|
+
const defaultBorderClasses = [
|
|
3133
|
+
'border', 'border-2', 'border-3', 'border-4', 'border-8',
|
|
3134
|
+
'border-solid', 'border-dashed', 'border-dotted', 'border-double', 'border-none',
|
|
3135
|
+
'rounded-none', 'rounded-sm', 'rounded', 'rounded-md', 'rounded-lg', 'rounded-xl', 'rounded-2xl', 'rounded-3xl', 'rounded-full',
|
|
3136
|
+
'border-gray-200', 'border-gray-300', 'border-gray-400', 'border-gray-500', 'border-gray-600', 'border-gray-700', 'border-gray-800', 'border-gray-900',
|
|
3137
|
+
'border-blue-500', 'border-blue-700', 'border-red-500', 'border-red-600', 'border-green-500', 'border-green-600',
|
|
3138
|
+
'border-amber-500', 'border-amber-600', 'border-violet-500', 'border-violet-600', 'border-pink-500', 'border-pink-600',
|
|
3139
|
+
'border-white', 'border-black'
|
|
3140
|
+
];
|
|
3141
|
+
defaultBorderClasses.forEach(className => {
|
|
3142
|
+
this.renderer.removeClass(element, className);
|
|
3143
|
+
});
|
|
3144
|
+
}
|
|
3145
|
+
// 라벨 텍스트 업데이트 메서드
|
|
3146
|
+
updateLabel(text) {
|
|
3147
|
+
if (this.labelElement) {
|
|
3148
|
+
this.renderer.setProperty(this.labelElement, 'textContent', text);
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
// 라벨 표시/숨김 메서드
|
|
3152
|
+
toggleLabel(show) {
|
|
3153
|
+
if (this.labelElement) {
|
|
3154
|
+
if (show) {
|
|
3155
|
+
this.renderer.removeClass(this.labelElement, 'hidden');
|
|
3156
|
+
}
|
|
3157
|
+
else {
|
|
3158
|
+
this.renderer.addClass(this.labelElement, 'hidden');
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: GroupedDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3163
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.4", type: GroupedDirective, isStandalone: true, selector: "[haloduckGrouped]", inputs: { haloduckGrouped: "haloduckGrouped", bgClasses: "bgClasses", borderClasses: "borderClasses", labelText: "labelText", labelClasses: "labelClasses", labelOffset: "labelOffset" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 });
|
|
3164
|
+
}
|
|
3165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: GroupedDirective, decorators: [{
|
|
3166
|
+
type: Directive,
|
|
3167
|
+
args: [{
|
|
3168
|
+
selector: '[haloduckGrouped]',
|
|
3169
|
+
standalone: true
|
|
3170
|
+
}]
|
|
3171
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { haloduckGrouped: [{
|
|
3172
|
+
type: Input
|
|
3173
|
+
}], bgClasses: [{
|
|
3174
|
+
type: Input
|
|
3175
|
+
}], borderClasses: [{
|
|
3176
|
+
type: Input
|
|
3177
|
+
}], labelText: [{
|
|
3178
|
+
type: Input
|
|
3179
|
+
}], labelClasses: [{
|
|
3180
|
+
type: Input
|
|
3181
|
+
}], labelOffset: [{
|
|
3182
|
+
type: Input
|
|
3183
|
+
}], hostClasses: [{
|
|
3184
|
+
type: HostBinding,
|
|
3185
|
+
args: ['class']
|
|
3186
|
+
}] } });
|
|
3187
|
+
|
|
3054
3188
|
class BreadcrumbService {
|
|
3055
3189
|
router;
|
|
3056
3190
|
coreService = inject(CoreService);
|
|
@@ -3163,5 +3297,5 @@ const provideHaloduckTransloco = () => provideTranslocoScope({
|
|
|
3163
3297
|
* Generated bundle index. Do not edit.
|
|
3164
3298
|
*/
|
|
3165
3299
|
|
|
3166
|
-
export { AuthenticateComponent, BreadcrumbComponent, ButtonComponent, CalendarComponent, ConfirmDialogService, CopyButtonComponent, DatePickerComponent, DateRangeComponent, DialogService, DrawCanvasComponent, ERROR_NOT_ACCEPTABLE_FILE_TYPE, ERROR_OVER_COUNT, ERROR_OVER_SIZE, ERROR_UPLOAD, FileUploaderComponent, FlipComponent, ImageUploaderComponent, ImageViewerComponent, InputComponent, LanguageSelectorComponent, MapToAddressComponent, NotificationComponent, NotificationService, PictureNameComponent, SelectComponent, SelectDropdownComponent, SideMenuComponent, SideMenuItemComponent, StlViewerComponent, TableComponent, TabsComponent, TagInputComponent, TagViewerComponent, ToggleComponent, dateToString, provideHaloduckTransloco };
|
|
3300
|
+
export { AuthenticateComponent, BreadcrumbComponent, ButtonComponent, CalendarComponent, ConfirmDialogService, CopyButtonComponent, DatePickerComponent, DateRangeComponent, DialogService, DrawCanvasComponent, ERROR_NOT_ACCEPTABLE_FILE_TYPE, ERROR_OVER_COUNT, ERROR_OVER_SIZE, ERROR_UPLOAD, FileUploaderComponent, FlipComponent, GroupedDirective, ImageUploaderComponent, ImageViewerComponent, InputComponent, LanguageSelectorComponent, MapToAddressComponent, NotificationComponent, NotificationService, PictureNameComponent, SelectComponent, SelectDropdownComponent, SideMenuComponent, SideMenuItemComponent, StlViewerComponent, TableComponent, TabsComponent, TagInputComponent, TagViewerComponent, ToggleComponent, dateToString, provideHaloduckTransloco };
|
|
3167
3301
|
//# sourceMappingURL=haloduck-ui.mjs.map
|