@haloduck/ui 2.0.37 → 2.0.39
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 +10 -1
- package/fesm2022/haloduck-ui.mjs +516 -222
- package/fesm2022/haloduck-ui.mjs.map +1 -1
- package/index.d.ts +11 -1
- package/package.json +1 -1
- package/public/i18n/haloduck/ko.json +1 -1
- package/src/tailwind.css +79 -1
package/fesm2022/haloduck-ui.mjs
CHANGED
|
@@ -37,8 +37,7 @@ class NotificationService {
|
|
|
37
37
|
timeout: timeout,
|
|
38
38
|
}));
|
|
39
39
|
}
|
|
40
|
-
else if ('Notification' in window &&
|
|
41
|
-
Notification.permission === 'granted') {
|
|
40
|
+
else if ('Notification' in window && Notification.permission === 'granted') {
|
|
42
41
|
// 웹브라우저에서 실행될 때는 기본 브라우저 알림 사용
|
|
43
42
|
new Notification(title, { body: body });
|
|
44
43
|
}
|
|
@@ -86,11 +85,11 @@ class ButtonComponent {
|
|
|
86
85
|
disabled = false;
|
|
87
86
|
variant = 'primary';
|
|
88
87
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ButtonComponent, isStandalone: true, selector: "haloduck-button", inputs: { disabled: "disabled", variant: "variant" }, ngImport: i0, template: "<button
|
|
88
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ButtonComponent, isStandalone: true, selector: "haloduck-button", inputs: { disabled: "disabled", variant: "variant" }, ngImport: i0, template: "<button\n type=\"button\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'bg-light-primary text-light-on-primary dark:bg-dark-primary dark:text-dark-on-primary':\n variant === 'primary' && !disabled,\n 'bg-light-primary-light text-light-on-primary-light dark:bg-dark-primary-light dark:text-dark-on-primary-light':\n variant === 'secondary' && !disabled,\n 'bg-light-danger text-light-on-danger dark:bg-dark-danger dark:text-dark-on-danger':\n variant === 'danger' && !disabled,\n 'bg-light-background text-light-on-background dark:bg-dark-background dark:text-dark-on-background border border-light-on-background dark:border-dark-on-background':\n variant === 'none' && !disabled,\n 'bg-light-inactive text-light-on-inactive dark:bg-dark-inactive dark:text-dark-on-inactive active:animate-bounce hover:cursor-not-allowed':\n disabled,\n 'active:scale-95 transition-transform': !disabled,\n 'hover:cursor-pointer': !disabled,\n }\"\n class=\"px-4 py-1.5 rounded-lg text-sm/6 w-full text-nowrap\"\n>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
90
89
|
}
|
|
91
90
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
92
91
|
type: Component,
|
|
93
|
-
args: [{ selector: 'haloduck-button', imports: [CommonModule], template: "<button
|
|
92
|
+
args: [{ selector: 'haloduck-button', imports: [CommonModule], template: "<button\n type=\"button\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'bg-light-primary text-light-on-primary dark:bg-dark-primary dark:text-dark-on-primary':\n variant === 'primary' && !disabled,\n 'bg-light-primary-light text-light-on-primary-light dark:bg-dark-primary-light dark:text-dark-on-primary-light':\n variant === 'secondary' && !disabled,\n 'bg-light-danger text-light-on-danger dark:bg-dark-danger dark:text-dark-on-danger':\n variant === 'danger' && !disabled,\n 'bg-light-background text-light-on-background dark:bg-dark-background dark:text-dark-on-background border border-light-on-background dark:border-dark-on-background':\n variant === 'none' && !disabled,\n 'bg-light-inactive text-light-on-inactive dark:bg-dark-inactive dark:text-dark-on-inactive active:animate-bounce hover:cursor-not-allowed':\n disabled,\n 'active:scale-95 transition-transform': !disabled,\n 'hover:cursor-pointer': !disabled,\n }\"\n class=\"px-4 py-1.5 rounded-lg text-sm/6 w-full text-nowrap\"\n>\n <ng-content></ng-content>\n</button>\n" }]
|
|
94
93
|
}], propDecorators: { disabled: [{
|
|
95
94
|
type: Input
|
|
96
95
|
}], variant: [{
|
|
@@ -163,7 +162,7 @@ class InputComponent {
|
|
|
163
162
|
multi: true,
|
|
164
163
|
},
|
|
165
164
|
provideTranslocoScope('haloduck'),
|
|
166
|
-
], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }, { propertyName: "inputElement", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n <label
|
|
165
|
+
], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }, { propertyName: "inputElement", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n @if (rows > 1) {\n <textarea\n #input\n [value]=\"value\"\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [rows]=\"rows\"\n (keydown)=\"onKeydown($event)\"\n class=\"block w-full rounded-md bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/80 px-3 py-1.5 text-base text-light-on-control dark:text-dark-on-control disabled:cursor-not-allowed disabled:text-light-on-control/60 dark:disabled:text-dark-on-control/80 outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary sm:text-sm/6\"\n ></textarea>\n } @else {\n <input\n #input\n [type]=\"type\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n (keydown)=\"onKeydown($event)\"\n class=\"block w-full rounded-md bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/80 px-3 py-1.5 text-base text-light-on-control dark:text-dark-on-control disabled:cursor-not-allowed disabled:text-light-on-control/60 dark:disabled:text-dark-on-control/80 outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary sm:text-sm/6\"\n />\n }\n</div>\n", styles: [""] });
|
|
167
166
|
}
|
|
168
167
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: InputComponent, decorators: [{
|
|
169
168
|
type: Component,
|
|
@@ -174,7 +173,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
174
173
|
multi: true,
|
|
175
174
|
},
|
|
176
175
|
provideTranslocoScope('haloduck'),
|
|
177
|
-
], template: "<div class=\"flex flex-col gap-2\">\n <label
|
|
176
|
+
], template: "<div class=\"flex flex-col gap-2\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n @if (rows > 1) {\n <textarea\n #input\n [value]=\"value\"\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [rows]=\"rows\"\n (keydown)=\"onKeydown($event)\"\n class=\"block w-full rounded-md bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/80 px-3 py-1.5 text-base text-light-on-control dark:text-dark-on-control disabled:cursor-not-allowed disabled:text-light-on-control/60 dark:disabled:text-dark-on-control/80 outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary sm:text-sm/6\"\n ></textarea>\n } @else {\n <input\n #input\n [type]=\"type\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n (keydown)=\"onKeydown($event)\"\n class=\"block w-full rounded-md bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/80 px-3 py-1.5 text-base text-light-on-control dark:text-dark-on-control disabled:cursor-not-allowed disabled:text-light-on-control/60 dark:disabled:text-dark-on-control/80 outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary sm:text-sm/6\"\n />\n }\n</div>\n" }]
|
|
178
177
|
}], propDecorators: { label: [{
|
|
179
178
|
type: ViewChild,
|
|
180
179
|
args: ['label']
|
|
@@ -323,7 +322,11 @@ class AuthenticateComponent {
|
|
|
323
322
|
return /[^A-Za-z0-9]/.test(this.passwordValue);
|
|
324
323
|
}
|
|
325
324
|
get isPasswordValid() {
|
|
326
|
-
return this.isMinLength &&
|
|
325
|
+
return (this.isMinLength &&
|
|
326
|
+
this.hasUppercase &&
|
|
327
|
+
this.hasLowercase &&
|
|
328
|
+
this.hasNumber &&
|
|
329
|
+
this.hasSpecialChar);
|
|
327
330
|
}
|
|
328
331
|
get passwordRules() {
|
|
329
332
|
return [
|
|
@@ -335,11 +338,11 @@ class AuthenticateComponent {
|
|
|
335
338
|
];
|
|
336
339
|
}
|
|
337
340
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AuthenticateComponent, deps: [{ token: i1$1.FormBuilder }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
|
|
338
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: AuthenticateComponent, isStandalone: true, selector: "haloduck-authenticate", ngImport: i0, template: "<div class=\"flex flex-col items-center justify-center h-full\">\n <!-- auth.component.html -->\n <div
|
|
341
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: AuthenticateComponent, isStandalone: true, selector: "haloduck-authenticate", ngImport: i0, template: "<div class=\"flex flex-col items-center justify-center h-full\">\n <!-- auth.component.html -->\n <div\n class=\"w-full max-w-md mx-auto mt-20 p-8 shadow-lg rounded-2xl bg-light-background dark:bg-dark-background\"\n >\n @switch (stage) {\n @case ('login') {\n <!-- \uB85C\uADF8\uC778 -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"login()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-login-email\"\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"Email\"\n />\n <haloduck-input\n data-testid=\"authenticate-login-password\"\n type=\"password\"\n formControlName=\"password\"\n placeholder=\"Password\"\n />\n <haloduck-button\n data-testid=\"authenticate-login-submit\"\n type=\"submit\"\n variant=\"primary\"\n (click)=\"login()\"\n >Sign In</haloduck-button\n >\n </form>\n }\n @case ('signup') {\n <!-- \uD68C\uC6D0\uAC00\uC785 -->\n <form [formGroup]=\"signupForm\" (ngSubmit)=\"signup()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-signup-email\"\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"Email\"\n />\n <haloduck-input\n data-testid=\"authenticate-signup-password\"\n type=\"password\"\n formControlName=\"password\"\n placeholder=\"Password\"\n />\n <haloduck-button data-testid=\"authenticate-signup-submit\" type=\"submit\" variant=\"primary\"\n >Sign Up</haloduck-button\n >\n </form>\n }\n @case ('reset') {\n <!-- \uBE44\uBC00\uBC88\uD638 \uC7AC\uC124\uC815 \uC694\uCCAD -->\n <form [formGroup]=\"resetForm\" (ngSubmit)=\"reset()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-reset-email\"\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"Email\"\n />\n <haloduck-button\n data-testid=\"authenticate-reset-submit\"\n type=\"submit\"\n variant=\"primary\"\n (click)=\"reset()\"\n >Send Verification Code</haloduck-button\n >\n </form>\n }\n @case ('otpVerify') {\n <!-- OTP \uC778\uC99D \uD6C4 \uC0C8 \uBE44\uBC00\uBC88\uD638 \uC785\uB825 -->\n <form [formGroup]=\"otpForm\" (ngSubmit)=\"verifyOtp()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-otp-code\"\n type=\"text\"\n formControlName=\"code\"\n placeholder=\"Verification Code\"\n />\n <haloduck-input\n data-testid=\"authenticate-otp-password\"\n type=\"password\"\n formControlName=\"newPassword\"\n placeholder=\"New password\"\n />\n <haloduck-button\n data-testid=\"authenticate-otp-submit\"\n type=\"submit\"\n variant=\"primary\"\n (click)=\"verifyOtp()\"\n >Reset Password</haloduck-button\n >\n </form>\n }\n @case ('newPassword') {\n <!-- \uC784\uC2DC \uBE44\uBC00\uBC88\uD638 \u2192 \uC0C8 \uBE44\uBC00\uBC88\uD638 \uBCC0\uACBD -->\n <form\n [formGroup]=\"newPasswordForm\"\n (ngSubmit)=\"confirmNewPassword()\"\n class=\"flex flex-col gap-4\"\n >\n <haloduck-input\n data-testid=\"authenticate-new-password-password\"\n type=\"password\"\n formControlName=\"newPassword\"\n placeholder=\"New password\"\n >\n </haloduck-input>\n <div class=\"text-sm flex flex-col\">\n @for (rule of passwordRules; track rule.label) {\n <span\n [class.text-light-secondary]=\"rule.valid && passwordValue !== ''\"\n [class.line-through]=\"rule.valid && passwordValue !== ''\"\n [class.text-light-danger]=\"!rule.valid && passwordValue !== ''\"\n [class.text-light-inactive]=\"passwordValue === ''\"\n >\n {{ rule.valid ? '\u2714' : '\u2717' }} {{ rule.label }}\n </span>\n }\n </div>\n <haloduck-button\n data-testid=\"authenticate-new-password-submit\"\n type=\"submit\"\n (click)=\"confirmNewPassword()\"\n variant=\"primary\"\n [disabled]=\"!isPasswordValid\"\n >Change Password</haloduck-button\n >\n </form>\n }\n }\n\n <!-- \uB2E8\uACC4 \uC804\uD658 \uD0ED -->\n <div class=\"flex justify-center mt-6 gap-4\">\n @if (stage !== 'login') {\n <haloduck-button\n data-testid=\"authenticate-to-signin\"\n variant=\"none\"\n (click)=\"switchStage('login')\"\n >to Sign In</haloduck-button\n >\n }\n <!-- <haloduck-button class=\"text-sm text-blue-600 hover:underline\"\n (click)=\"switchStage('signup')\">\uD68C\uC6D0\uAC00\uC785</haloduck-button> -->\n @if (stage !== 'reset' && stage !== 'otpVerify' && stage !== 'newPassword') {\n <haloduck-button\n data-testid=\"authenticate-to-reset-password\"\n variant=\"secondary\"\n (click)=\"switchStage('reset')\"\n >Reset Password</haloduck-button\n >\n }\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: InputComponent, selector: "haloduck-input", inputs: ["placeholder", "type", "disabled", "rows", "autofocus", "value"] }, { kind: "component", type: ButtonComponent, selector: "haloduck-button", inputs: ["disabled", "variant"] }] });
|
|
339
342
|
}
|
|
340
343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AuthenticateComponent, decorators: [{
|
|
341
344
|
type: Component,
|
|
342
|
-
args: [{ selector: 'haloduck-authenticate', imports: [FormsModule, ReactiveFormsModule, InputComponent, ButtonComponent], template: "<div class=\"flex flex-col items-center justify-center h-full\">\n <!-- auth.component.html -->\n <div
|
|
345
|
+
args: [{ selector: 'haloduck-authenticate', imports: [FormsModule, ReactiveFormsModule, InputComponent, ButtonComponent], template: "<div class=\"flex flex-col items-center justify-center h-full\">\n <!-- auth.component.html -->\n <div\n class=\"w-full max-w-md mx-auto mt-20 p-8 shadow-lg rounded-2xl bg-light-background dark:bg-dark-background\"\n >\n @switch (stage) {\n @case ('login') {\n <!-- \uB85C\uADF8\uC778 -->\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"login()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-login-email\"\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"Email\"\n />\n <haloduck-input\n data-testid=\"authenticate-login-password\"\n type=\"password\"\n formControlName=\"password\"\n placeholder=\"Password\"\n />\n <haloduck-button\n data-testid=\"authenticate-login-submit\"\n type=\"submit\"\n variant=\"primary\"\n (click)=\"login()\"\n >Sign In</haloduck-button\n >\n </form>\n }\n @case ('signup') {\n <!-- \uD68C\uC6D0\uAC00\uC785 -->\n <form [formGroup]=\"signupForm\" (ngSubmit)=\"signup()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-signup-email\"\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"Email\"\n />\n <haloduck-input\n data-testid=\"authenticate-signup-password\"\n type=\"password\"\n formControlName=\"password\"\n placeholder=\"Password\"\n />\n <haloduck-button data-testid=\"authenticate-signup-submit\" type=\"submit\" variant=\"primary\"\n >Sign Up</haloduck-button\n >\n </form>\n }\n @case ('reset') {\n <!-- \uBE44\uBC00\uBC88\uD638 \uC7AC\uC124\uC815 \uC694\uCCAD -->\n <form [formGroup]=\"resetForm\" (ngSubmit)=\"reset()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-reset-email\"\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"Email\"\n />\n <haloduck-button\n data-testid=\"authenticate-reset-submit\"\n type=\"submit\"\n variant=\"primary\"\n (click)=\"reset()\"\n >Send Verification Code</haloduck-button\n >\n </form>\n }\n @case ('otpVerify') {\n <!-- OTP \uC778\uC99D \uD6C4 \uC0C8 \uBE44\uBC00\uBC88\uD638 \uC785\uB825 -->\n <form [formGroup]=\"otpForm\" (ngSubmit)=\"verifyOtp()\" class=\"flex flex-col gap-4\">\n <haloduck-input\n data-testid=\"authenticate-otp-code\"\n type=\"text\"\n formControlName=\"code\"\n placeholder=\"Verification Code\"\n />\n <haloduck-input\n data-testid=\"authenticate-otp-password\"\n type=\"password\"\n formControlName=\"newPassword\"\n placeholder=\"New password\"\n />\n <haloduck-button\n data-testid=\"authenticate-otp-submit\"\n type=\"submit\"\n variant=\"primary\"\n (click)=\"verifyOtp()\"\n >Reset Password</haloduck-button\n >\n </form>\n }\n @case ('newPassword') {\n <!-- \uC784\uC2DC \uBE44\uBC00\uBC88\uD638 \u2192 \uC0C8 \uBE44\uBC00\uBC88\uD638 \uBCC0\uACBD -->\n <form\n [formGroup]=\"newPasswordForm\"\n (ngSubmit)=\"confirmNewPassword()\"\n class=\"flex flex-col gap-4\"\n >\n <haloduck-input\n data-testid=\"authenticate-new-password-password\"\n type=\"password\"\n formControlName=\"newPassword\"\n placeholder=\"New password\"\n >\n </haloduck-input>\n <div class=\"text-sm flex flex-col\">\n @for (rule of passwordRules; track rule.label) {\n <span\n [class.text-light-secondary]=\"rule.valid && passwordValue !== ''\"\n [class.line-through]=\"rule.valid && passwordValue !== ''\"\n [class.text-light-danger]=\"!rule.valid && passwordValue !== ''\"\n [class.text-light-inactive]=\"passwordValue === ''\"\n >\n {{ rule.valid ? '\u2714' : '\u2717' }} {{ rule.label }}\n </span>\n }\n </div>\n <haloduck-button\n data-testid=\"authenticate-new-password-submit\"\n type=\"submit\"\n (click)=\"confirmNewPassword()\"\n variant=\"primary\"\n [disabled]=\"!isPasswordValid\"\n >Change Password</haloduck-button\n >\n </form>\n }\n }\n\n <!-- \uB2E8\uACC4 \uC804\uD658 \uD0ED -->\n <div class=\"flex justify-center mt-6 gap-4\">\n @if (stage !== 'login') {\n <haloduck-button\n data-testid=\"authenticate-to-signin\"\n variant=\"none\"\n (click)=\"switchStage('login')\"\n >to Sign In</haloduck-button\n >\n }\n <!-- <haloduck-button class=\"text-sm text-blue-600 hover:underline\"\n (click)=\"switchStage('signup')\">\uD68C\uC6D0\uAC00\uC785</haloduck-button> -->\n @if (stage !== 'reset' && stage !== 'otpVerify' && stage !== 'newPassword') {\n <haloduck-button\n data-testid=\"authenticate-to-reset-password\"\n variant=\"secondary\"\n (click)=\"switchStage('reset')\"\n >Reset Password</haloduck-button\n >\n }\n </div>\n </div>\n</div>\n" }]
|
|
343
346
|
}], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: i2.HttpClient }] });
|
|
344
347
|
|
|
345
348
|
class SelectDropdownComponent {
|
|
@@ -473,7 +476,9 @@ class SelectDropdownComponent {
|
|
|
473
476
|
const isActive = this.activeManualKey === key;
|
|
474
477
|
if (prefix) {
|
|
475
478
|
// selected if there exists a value with more than prefix, OR if it's currently active
|
|
476
|
-
const hasValueWithPrefix = this._selectedOptionIds.some((selectedId) => typeof selectedId === 'string' &&
|
|
479
|
+
const hasValueWithPrefix = this._selectedOptionIds.some((selectedId) => typeof selectedId === 'string' &&
|
|
480
|
+
selectedId.startsWith(prefix) &&
|
|
481
|
+
selectedId.length > prefix.length);
|
|
477
482
|
return hasValueWithPrefix || isActive;
|
|
478
483
|
}
|
|
479
484
|
// no prefix: consider selected if any selected id equals current typed value (non-empty) OR if it's active
|
|
@@ -497,7 +502,7 @@ class SelectDropdownComponent {
|
|
|
497
502
|
return false;
|
|
498
503
|
}
|
|
499
504
|
getManualKey(option) {
|
|
500
|
-
return option.manualPrefix ||
|
|
505
|
+
return option.manualPrefix || option.id || option.value;
|
|
501
506
|
}
|
|
502
507
|
seedManualInputs() {
|
|
503
508
|
const manualOptions = this._options.filter((o) => o.shouldManualInput);
|
|
@@ -505,9 +510,7 @@ class SelectDropdownComponent {
|
|
|
505
510
|
const prefix = opt.manualPrefix || '';
|
|
506
511
|
const key = this.getManualKey(opt);
|
|
507
512
|
const existingWithPrefix = this._selectedOptionIds.find((id) => prefix ? id?.startsWith(prefix) : false);
|
|
508
|
-
const value = existingWithPrefix
|
|
509
|
-
? existingWithPrefix.substring(prefix.length)
|
|
510
|
-
: '';
|
|
513
|
+
const value = existingWithPrefix ? existingWithPrefix.substring(prefix.length) : '';
|
|
511
514
|
this.manualInputValues[key] = value;
|
|
512
515
|
}
|
|
513
516
|
}
|
|
@@ -607,11 +610,11 @@ class SelectDropdownComponent {
|
|
|
607
610
|
});
|
|
608
611
|
}
|
|
609
612
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SelectDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
610
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SelectDropdownComponent, isStandalone: true, selector: "haloduck-select-dropdown", inputs: { useFilter: "useFilter", multiselect: "multiselect", atLeastOne: "atLeastOne", asButton: "asButton", options: "options", selectedOptionIds: "selectedOptionIds" }, outputs: { selectedChange: "selectedChange", closeDropdown: "closeDropdown" }, providers: [provideTranslocoScope('haloduck')], ngImport: i0, template: "<div
|
|
613
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SelectDropdownComponent, isStandalone: true, selector: "haloduck-select-dropdown", inputs: { useFilter: "useFilter", multiselect: "multiselect", atLeastOne: "atLeastOne", asButton: "asButton", options: "options", selectedOptionIds: "selectedOptionIds" }, outputs: { selectedChange: "selectedChange", closeDropdown: "closeDropdown" }, providers: [provideTranslocoScope('haloduck')], ngImport: i0, template: "<div\n id=\"dropdown\"\n class=\"max-w-full mt-2 absolute z-40 bg-light-background dark:bg-dark-background text-light-on-background dark:text-dark-on-background border border-light-inactive dark:border-dark-inactive rounded max-h-60 flex flex-col gap-2\"\n>\n @if (useFilter && _options.length >= 5) {\n <input\n #inputFilter\n id=\"inputFilter\"\n type=\"text\"\n [placeholder]=\"'haloduck.ui.select.Keyword...' | transloco\"\n (input)=\"onFilterInput($event)\"\n class=\"text-light-inactive dark:text-dark-inactive rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary px-3 py-1.5 text-sm/6 bg-light-control dark:bg-dark-control m-2\"\n />\n }\n <div class=\"overflow-y-auto\">\n @for (option of _filteredOptions(); track option.id ? option.id : option.value) {\n <div\n class=\"px-3 py-2 text-sm/6 hover:bg-light-secondary/60 dark:hover:bg-dark-secondary/60 flex items-center justify-start whitespace-nowrap\"\n [class.cursor-pointer]=\"!option.shouldManualInput\"\n (click)=\"onToggleOption(option)\"\n >\n @if (!asButton) {\n @if (isOptionSelected(option)) {\n <svg\n class=\"w-4 h-4 text-light-primary dark:text-dark-primary inline-block mr-2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 00-1.414 0L8 12.586 4.707 9.293a1 1 0 00-1.414 1.414l4 4a1 1 0 001.414 0l8-8a1 1 0 000-1.414z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n } @else {\n <div class=\"w-4 h-4 inline-block mr-2\"></div>\n }\n }\n @if (\n option.shouldManualInput &&\n (isOptionSelected(option) ||\n activeManualKey ===\n (option.manualPrefix ? option.manualPrefix : option.id || option.value))\n ) {\n <input\n type=\"text\"\n [(ngModel)]=\"\n manualInputValues[\n option.manualPrefix ? option.manualPrefix : option.id || option.value\n ]\n \"\n [attr.data-manual-key]=\"\n option.manualPrefix ? option.manualPrefix : option.id || option.value\n \"\n (ngModelChange)=\"onManualInputChange(option, $event)\"\n (click)=\"$event.stopPropagation()\"\n (blur)=\"onManualInputBlur(option)\"\n (keydown.enter)=\"onManualInputConfirm(option)\"\n class=\"text-light-on-control dark:text-dark-on-control rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary px-2 py-1 text-sm/6 bg-light-control dark:bg-dark-control w-full\"\n />\n } @else {\n {{ option.value }}\n }\n </div>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: TranslocoModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
611
614
|
}
|
|
612
615
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SelectDropdownComponent, decorators: [{
|
|
613
616
|
type: Component,
|
|
614
|
-
args: [{ selector: 'haloduck-select-dropdown', imports: [TranslocoModule, FormsModule], providers: [provideTranslocoScope('haloduck')], template: "<div
|
|
617
|
+
args: [{ selector: 'haloduck-select-dropdown', imports: [TranslocoModule, FormsModule], providers: [provideTranslocoScope('haloduck')], template: "<div\n id=\"dropdown\"\n class=\"max-w-full mt-2 absolute z-40 bg-light-background dark:bg-dark-background text-light-on-background dark:text-dark-on-background border border-light-inactive dark:border-dark-inactive rounded max-h-60 flex flex-col gap-2\"\n>\n @if (useFilter && _options.length >= 5) {\n <input\n #inputFilter\n id=\"inputFilter\"\n type=\"text\"\n [placeholder]=\"'haloduck.ui.select.Keyword...' | transloco\"\n (input)=\"onFilterInput($event)\"\n class=\"text-light-inactive dark:text-dark-inactive rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary px-3 py-1.5 text-sm/6 bg-light-control dark:bg-dark-control m-2\"\n />\n }\n <div class=\"overflow-y-auto\">\n @for (option of _filteredOptions(); track option.id ? option.id : option.value) {\n <div\n class=\"px-3 py-2 text-sm/6 hover:bg-light-secondary/60 dark:hover:bg-dark-secondary/60 flex items-center justify-start whitespace-nowrap\"\n [class.cursor-pointer]=\"!option.shouldManualInput\"\n (click)=\"onToggleOption(option)\"\n >\n @if (!asButton) {\n @if (isOptionSelected(option)) {\n <svg\n class=\"w-4 h-4 text-light-primary dark:text-dark-primary inline-block mr-2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 00-1.414 0L8 12.586 4.707 9.293a1 1 0 00-1.414 1.414l4 4a1 1 0 001.414 0l8-8a1 1 0 000-1.414z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n } @else {\n <div class=\"w-4 h-4 inline-block mr-2\"></div>\n }\n }\n @if (\n option.shouldManualInput &&\n (isOptionSelected(option) ||\n activeManualKey ===\n (option.manualPrefix ? option.manualPrefix : option.id || option.value))\n ) {\n <input\n type=\"text\"\n [(ngModel)]=\"\n manualInputValues[\n option.manualPrefix ? option.manualPrefix : option.id || option.value\n ]\n \"\n [attr.data-manual-key]=\"\n option.manualPrefix ? option.manualPrefix : option.id || option.value\n \"\n (ngModelChange)=\"onManualInputChange(option, $event)\"\n (click)=\"$event.stopPropagation()\"\n (blur)=\"onManualInputBlur(option)\"\n (keydown.enter)=\"onManualInputConfirm(option)\"\n class=\"text-light-on-control dark:text-dark-on-control rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary px-2 py-1 text-sm/6 bg-light-control dark:bg-dark-control w-full\"\n />\n } @else {\n {{ option.value }}\n }\n </div>\n }\n </div>\n</div>\n" }]
|
|
615
618
|
}], propDecorators: { selectedChange: [{
|
|
616
619
|
type: Output
|
|
617
620
|
}], closeDropdown: [{
|
|
@@ -647,6 +650,7 @@ class SelectComponent {
|
|
|
647
650
|
placeholder = '';
|
|
648
651
|
atLeastOne = false;
|
|
649
652
|
showAll = false;
|
|
653
|
+
showAllItems = false;
|
|
650
654
|
options = null;
|
|
651
655
|
layout = 'vertical';
|
|
652
656
|
labelWidth = '';
|
|
@@ -671,8 +675,11 @@ class SelectComponent {
|
|
|
671
675
|
selectedOptionIds = [];
|
|
672
676
|
displayedSelectedOptions = [];
|
|
673
677
|
selectedIdToDisplayOption = {};
|
|
678
|
+
// Manual input support for inline mode
|
|
679
|
+
manualInputValues = {};
|
|
680
|
+
activeManualKey = null;
|
|
674
681
|
onClick(event) {
|
|
675
|
-
if (this.disabled) {
|
|
682
|
+
if (this.disabled || this.showAllItems) {
|
|
676
683
|
return;
|
|
677
684
|
}
|
|
678
685
|
const originWidth = this.origin?.nativeElement?.offsetWidth || 0;
|
|
@@ -720,6 +727,23 @@ class SelectComponent {
|
|
|
720
727
|
: selectedOptionIds;
|
|
721
728
|
setTimeout(() => {
|
|
722
729
|
this.selectedOptionIds = payload;
|
|
730
|
+
// Clear manual input values when selecting different options in dropdown mode
|
|
731
|
+
if (!this.showAllItems) {
|
|
732
|
+
const manualOptions = (this.options || []).filter((o) => o.shouldManualInput);
|
|
733
|
+
for (const manualOpt of manualOptions) {
|
|
734
|
+
const key = this.getManualKey(manualOpt);
|
|
735
|
+
const prefix = manualOpt.manualPrefix || '';
|
|
736
|
+
const sentinel = manualOpt.id || manualOpt.value;
|
|
737
|
+
// Check if this manual option is still selected
|
|
738
|
+
const isStillSelected = prefix
|
|
739
|
+
? this.selectedOptionIds.some((id) => typeof id === 'string' && id.startsWith(prefix))
|
|
740
|
+
: this.selectedOptionIds.includes(sentinel);
|
|
741
|
+
// If not selected, clear the manual input value
|
|
742
|
+
if (!isStillSelected) {
|
|
743
|
+
this.manualInputValues[key] = '';
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
723
747
|
this.recomputeSelectedOptions();
|
|
724
748
|
this.onChange(this.getSelectedValue());
|
|
725
749
|
this.selectedChange.emit(payload);
|
|
@@ -762,6 +786,186 @@ class SelectComponent {
|
|
|
762
786
|
this.selectedChange.emit(this.selectedOptionIds);
|
|
763
787
|
this.isDropdownOpen.set(false);
|
|
764
788
|
}
|
|
789
|
+
onToggleOption(option) {
|
|
790
|
+
if (this.disabled) {
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
// Handle manual input option
|
|
794
|
+
if (option.shouldManualInput && this.showAllItems) {
|
|
795
|
+
const key = this.getManualKey(option);
|
|
796
|
+
const prefix = option.manualPrefix || '';
|
|
797
|
+
const sentinel = option.id || option.value;
|
|
798
|
+
const typed = (this.manualInputValues[key] || '').trim();
|
|
799
|
+
const isSelected = this.isOptionSelected(option);
|
|
800
|
+
if (isSelected) {
|
|
801
|
+
// Already selected - handle toggle based on mode
|
|
802
|
+
if (this.multiselect) {
|
|
803
|
+
// Checkbox: always deselect when clicked again
|
|
804
|
+
let next;
|
|
805
|
+
if (prefix) {
|
|
806
|
+
// Remove all IDs that start with prefix AND the sentinel
|
|
807
|
+
next = this.selectedOptionIds.filter((id) => !id.startsWith(prefix) && id !== sentinel);
|
|
808
|
+
}
|
|
809
|
+
else {
|
|
810
|
+
// Remove typed value AND the sentinel
|
|
811
|
+
next = this.selectedOptionIds.filter((id) => id !== typed && id !== sentinel);
|
|
812
|
+
}
|
|
813
|
+
this.selectedOptionIds = next;
|
|
814
|
+
// Clear input text when deselected
|
|
815
|
+
this.manualInputValues[key] = '';
|
|
816
|
+
// Hide input
|
|
817
|
+
this.activeManualKey = null;
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
// Radio: deselect only if there's no typed content
|
|
821
|
+
if (typed === '') {
|
|
822
|
+
this.selectedOptionIds = [];
|
|
823
|
+
this.manualInputValues[key] = '';
|
|
824
|
+
this.activeManualKey = null;
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
// Has typed content - keep selected, do nothing
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
// Open manual input
|
|
834
|
+
this.activeManualKey = key;
|
|
835
|
+
// In single select mode, clear existing selections first
|
|
836
|
+
if (!this.multiselect) {
|
|
837
|
+
this.selectedOptionIds = [sentinel];
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
// In multiselect mode, add sentinel if not already present
|
|
841
|
+
if (!this.selectedOptionIds.includes(sentinel)) {
|
|
842
|
+
this.selectedOptionIds = [sentinel, ...this.selectedOptionIds];
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
// Ensure there is an entry in manualInputValues
|
|
846
|
+
if (this.manualInputValues[key] === undefined) {
|
|
847
|
+
this.manualInputValues[key] = '';
|
|
848
|
+
}
|
|
849
|
+
// Focus input on next tick
|
|
850
|
+
setTimeout(() => {
|
|
851
|
+
const selector = `input[data-manual-key="${key}"]`;
|
|
852
|
+
const el = document.querySelector(selector);
|
|
853
|
+
el?.focus();
|
|
854
|
+
el?.select();
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
this.recomputeSelectedOptions();
|
|
858
|
+
this.onChange(this.getSelectedValue());
|
|
859
|
+
const selectedValue = this.getSelectedValue();
|
|
860
|
+
if (selectedValue !== null) {
|
|
861
|
+
this.selectedChange.emit(selectedValue);
|
|
862
|
+
}
|
|
863
|
+
this.cdr.markForCheck();
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
const id = option.id || option.value;
|
|
867
|
+
if (this.multiselect) {
|
|
868
|
+
if (option.isExclusive) {
|
|
869
|
+
// Exclusive option: toggle between only this option or none
|
|
870
|
+
if (this.selectedOptionIds.includes(id)) {
|
|
871
|
+
this.selectedOptionIds = [];
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
this.selectedOptionIds = [id];
|
|
875
|
+
// Clear all manual input values when selecting exclusive option
|
|
876
|
+
const manualOptions = (this.options || []).filter((o) => o.shouldManualInput);
|
|
877
|
+
for (const manualOpt of manualOptions) {
|
|
878
|
+
const key = this.getManualKey(manualOpt);
|
|
879
|
+
this.manualInputValues[key] = '';
|
|
880
|
+
}
|
|
881
|
+
this.activeManualKey = null;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
// Non-exclusive option: remove any exclusive selections first
|
|
886
|
+
let next = this.selectedOptionIds.filter((selectedId) => !this.isIdExclusive(selectedId));
|
|
887
|
+
if (next.includes(id)) {
|
|
888
|
+
// Deselect
|
|
889
|
+
next = next.filter((selected) => selected !== id);
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
// Select
|
|
893
|
+
next = [id, ...next];
|
|
894
|
+
}
|
|
895
|
+
this.selectedOptionIds = next;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
else {
|
|
899
|
+
// Single select mode
|
|
900
|
+
// Clear manual input values when selecting different option
|
|
901
|
+
const manualOptions = (this.options || []).filter((o) => o.shouldManualInput);
|
|
902
|
+
for (const manualOpt of manualOptions) {
|
|
903
|
+
const manualKey = this.getManualKey(manualOpt);
|
|
904
|
+
const manualSentinel = manualOpt.id || manualOpt.value;
|
|
905
|
+
const manualPrefix = manualOpt.manualPrefix || '';
|
|
906
|
+
// Check if selecting a different option (not the manual input option itself)
|
|
907
|
+
const isSelectingDifferent = id !== manualSentinel && !(manualPrefix && id.startsWith(manualPrefix));
|
|
908
|
+
if (isSelectingDifferent) {
|
|
909
|
+
this.manualInputValues[manualKey] = '';
|
|
910
|
+
this.activeManualKey = null;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
if (this.atLeastOne) {
|
|
914
|
+
this.selectedOptionIds = [id];
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
if (this.selectedOptionIds.includes(id)) {
|
|
918
|
+
this.selectedOptionIds = [];
|
|
919
|
+
}
|
|
920
|
+
else {
|
|
921
|
+
this.selectedOptionIds = [id];
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
this.recomputeSelectedOptions();
|
|
926
|
+
this.onChange(this.getSelectedValue());
|
|
927
|
+
const selectedValue = this.getSelectedValue();
|
|
928
|
+
if (selectedValue !== null) {
|
|
929
|
+
this.selectedChange.emit(selectedValue);
|
|
930
|
+
}
|
|
931
|
+
this.cdr.markForCheck();
|
|
932
|
+
}
|
|
933
|
+
isOptionSelected(option) {
|
|
934
|
+
const id = option.id || option.value;
|
|
935
|
+
if (option.shouldManualInput && this.showAllItems) {
|
|
936
|
+
const key = this.getManualKey(option);
|
|
937
|
+
const prefix = option.manualPrefix;
|
|
938
|
+
const sentinel = option.id || option.value;
|
|
939
|
+
if (prefix) {
|
|
940
|
+
const hasValueWithPrefix = this.selectedOptionIds.some((selectedId) => typeof selectedId === 'string' &&
|
|
941
|
+
selectedId.startsWith(prefix) &&
|
|
942
|
+
selectedId.length > prefix.length);
|
|
943
|
+
return hasValueWithPrefix;
|
|
944
|
+
}
|
|
945
|
+
const typed = (this.manualInputValues[key] || '').trim();
|
|
946
|
+
// Only consider selected if there's actual typed value, not just sentinel
|
|
947
|
+
if (typed !== '') {
|
|
948
|
+
return this.selectedOptionIds.includes(typed);
|
|
949
|
+
}
|
|
950
|
+
// If no typed value, check if there's only sentinel (which means just activated but not typed yet)
|
|
951
|
+
const hasSentinel = this.selectedOptionIds.includes(sentinel);
|
|
952
|
+
const hasOnlySentinel = hasSentinel &&
|
|
953
|
+
!this.selectedOptionIds.some((id) => id !== sentinel && (prefix ? id.startsWith(prefix) : false));
|
|
954
|
+
return hasOnlySentinel;
|
|
955
|
+
}
|
|
956
|
+
return this.selectedOptionIds.includes(id);
|
|
957
|
+
}
|
|
958
|
+
isIdExclusive(id) {
|
|
959
|
+
const options = this.options || [];
|
|
960
|
+
for (const o of options) {
|
|
961
|
+
if (!o.isExclusive)
|
|
962
|
+
continue;
|
|
963
|
+
const refId = o.id || o.value;
|
|
964
|
+
if (refId === id)
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
765
969
|
getSelectedValue() {
|
|
766
970
|
if (!this.multiselect) {
|
|
767
971
|
if (this.selectedOptionIds.length > 0) {
|
|
@@ -779,10 +983,10 @@ class SelectComponent {
|
|
|
779
983
|
onTouched = () => { };
|
|
780
984
|
writeValue(value) {
|
|
781
985
|
if (Array.isArray(value)) {
|
|
782
|
-
this.selectedOptionIds = value.filter(id => id !== null && id !== undefined && id !== '');
|
|
986
|
+
this.selectedOptionIds = value.filter((id) => id !== null && id !== undefined && id !== '');
|
|
783
987
|
}
|
|
784
988
|
else {
|
|
785
|
-
this.selectedOptionIds =
|
|
989
|
+
this.selectedOptionIds = value !== null && value !== undefined && value !== '' ? [value] : [];
|
|
786
990
|
}
|
|
787
991
|
this.recomputeSelectedOptions();
|
|
788
992
|
}
|
|
@@ -816,6 +1020,9 @@ class SelectComponent {
|
|
|
816
1020
|
ngOnChanges(changes) {
|
|
817
1021
|
if (changes['options']) {
|
|
818
1022
|
this.recomputeSelectedOptions();
|
|
1023
|
+
if (this.showAllItems) {
|
|
1024
|
+
this.seedManualInputs();
|
|
1025
|
+
}
|
|
819
1026
|
}
|
|
820
1027
|
}
|
|
821
1028
|
recomputeSelectedOptions() {
|
|
@@ -912,26 +1119,121 @@ class SelectComponent {
|
|
|
912
1119
|
}
|
|
913
1120
|
return false;
|
|
914
1121
|
}
|
|
1122
|
+
getManualKey(option) {
|
|
1123
|
+
// Use option.id or option.value as the unique key
|
|
1124
|
+
// This ensures each manual input option has a unique key
|
|
1125
|
+
// even if they have the same manualPrefix
|
|
1126
|
+
return option.id || option.value;
|
|
1127
|
+
}
|
|
1128
|
+
seedManualInputs() {
|
|
1129
|
+
const options = this.options || [];
|
|
1130
|
+
const manualOptions = options.filter((o) => o.shouldManualInput);
|
|
1131
|
+
for (const opt of manualOptions) {
|
|
1132
|
+
const prefix = opt.manualPrefix || '';
|
|
1133
|
+
const key = this.getManualKey(opt);
|
|
1134
|
+
const existingWithPrefix = this.selectedOptionIds.find((id) => prefix ? id?.startsWith(prefix) : false);
|
|
1135
|
+
const value = existingWithPrefix ? existingWithPrefix.substring(prefix.length) : '';
|
|
1136
|
+
this.manualInputValues[key] = value;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
onManualInputChange(option, value) {
|
|
1140
|
+
const key = this.getManualKey(option);
|
|
1141
|
+
this.manualInputValues[key] = value;
|
|
1142
|
+
const prefix = option.manualPrefix || '';
|
|
1143
|
+
const sentinel = option.id || option.value;
|
|
1144
|
+
const trimmed = (value || '').trim();
|
|
1145
|
+
if (this.multiselect) {
|
|
1146
|
+
if (option.isExclusive) {
|
|
1147
|
+
if (trimmed === '') {
|
|
1148
|
+
this.selectedOptionIds = [sentinel];
|
|
1149
|
+
}
|
|
1150
|
+
else {
|
|
1151
|
+
this.selectedOptionIds = [`${prefix}${trimmed}`];
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
else {
|
|
1155
|
+
let next = this.selectedOptionIds.filter((id) => !this.isIdExclusive(id));
|
|
1156
|
+
next = next.filter((id) => (prefix ? !id.startsWith(prefix) : id !== sentinel));
|
|
1157
|
+
if (trimmed !== '') {
|
|
1158
|
+
const toAdd = `${prefix}${trimmed}`;
|
|
1159
|
+
if (!next.includes(toAdd)) {
|
|
1160
|
+
next = [toAdd, ...next];
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
else {
|
|
1164
|
+
if (!next.includes(sentinel)) {
|
|
1165
|
+
next = [sentinel, ...next];
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
this.selectedOptionIds = next;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
else {
|
|
1172
|
+
if (trimmed === '') {
|
|
1173
|
+
this.selectedOptionIds = [sentinel];
|
|
1174
|
+
}
|
|
1175
|
+
else {
|
|
1176
|
+
this.selectedOptionIds = [`${prefix}${trimmed}`];
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
this.recomputeSelectedOptions();
|
|
1180
|
+
this.onChange(this.getSelectedValue());
|
|
1181
|
+
const selectedValue = this.getSelectedValue();
|
|
1182
|
+
if (selectedValue !== null) {
|
|
1183
|
+
this.selectedChange.emit(selectedValue);
|
|
1184
|
+
}
|
|
1185
|
+
this.cdr.markForCheck();
|
|
1186
|
+
}
|
|
1187
|
+
onManualInputBlur(option) {
|
|
1188
|
+
const key = this.getManualKey(option);
|
|
1189
|
+
const raw = (this.manualInputValues[key] || '').trim();
|
|
1190
|
+
if (raw === '') {
|
|
1191
|
+
this.activeManualKey = null;
|
|
1192
|
+
const prefix = option.manualPrefix || '';
|
|
1193
|
+
const sentinel = option.id || option.value;
|
|
1194
|
+
if (this.multiselect) {
|
|
1195
|
+
let next = [...this.selectedOptionIds];
|
|
1196
|
+
next = next.filter((id) => {
|
|
1197
|
+
if (id === sentinel)
|
|
1198
|
+
return false;
|
|
1199
|
+
if (prefix && id.startsWith(prefix))
|
|
1200
|
+
return false;
|
|
1201
|
+
return true;
|
|
1202
|
+
});
|
|
1203
|
+
this.selectedOptionIds = next;
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
this.selectedOptionIds = [];
|
|
1207
|
+
}
|
|
1208
|
+
this.recomputeSelectedOptions();
|
|
1209
|
+
this.onChange(this.getSelectedValue());
|
|
1210
|
+
const selectedValue = this.getSelectedValue();
|
|
1211
|
+
if (selectedValue !== null) {
|
|
1212
|
+
this.selectedChange.emit(selectedValue);
|
|
1213
|
+
}
|
|
1214
|
+
this.cdr.markForCheck();
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
915
1217
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
916
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SelectComponent, isStandalone: true, selector: "haloduck-select", inputs: { disabled: "disabled", loading: "loading", variant: "variant", asButton: "asButton", useIcon: "useIcon", useFilter: "useFilter", multiselect: "multiselect", placeholder: "placeholder", atLeastOne: "atLeastOne", showAll: "showAll", options: "options", layout: "layout", labelWidth: "labelWidth", value: "value" }, outputs: { selectedChange: "selectedChange" }, providers: [
|
|
1218
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SelectComponent, isStandalone: true, selector: "haloduck-select", inputs: { disabled: "disabled", loading: "loading", variant: "variant", asButton: "asButton", useIcon: "useIcon", useFilter: "useFilter", multiselect: "multiselect", placeholder: "placeholder", atLeastOne: "atLeastOne", showAll: "showAll", showAllItems: "showAllItems", options: "options", layout: "layout", labelWidth: "labelWidth", value: "value" }, outputs: { selectedChange: "selectedChange" }, providers: [
|
|
917
1219
|
{
|
|
918
1220
|
provide: NG_VALUE_ACCESSOR,
|
|
919
1221
|
useExisting: forwardRef(() => SelectComponent),
|
|
920
1222
|
multi: true,
|
|
921
1223
|
},
|
|
922
1224
|
provideTranslocoScope('haloduck'),
|
|
923
|
-
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }, { propertyName: "label", first: true, predicate: ["label"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex gap-2 items-center w-full\"\n [ngClass]=\"{'flex-col items-start': layout === 'vertical'}\">\n <label #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control {{ labelWidth }}\"\n [ngClass]=\"{'w-full': layout === 'vertical'}\">\n <!-- <ng-content select=\"[slot=label]\"></ng-content> -->\n <ng-content></ng-content>\n </label>\n <div #origin\n class=\"w-full flex-1 relative overflow-visible rounded-md outline outline-light-inactive dark:outline-dark-inactive text-sm/6\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary focus:dark:outline-dark-primary': !disabled,\n 'bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary' : variant === 'primary' && !disabled,\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary' : variant === 'secondary' && !disabled,\n 'bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger' : variant === 'danger' && !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60' : disabled,\n }\"\n [tabindex]=\"(disabled) ? -1 : 0\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\">\n <div class=\"px-3 py-1.5 text-sm/6 cursor-pointer flex flex-nowrap items-center justify-between overflow-hidden\">\n @if(loading){\n <div class=\"flex-1 flex items-center gap-2 w-full h-3\">\n <div class=\"animate-pulse bg-light-inactive dark:bg-dark-inactive rounded-md h-5 w-full\"> </div>\n </div>\n }\n @else{\n <div class=\"flex-1\">\n @if (!asButton && displayedSelectedOptions && displayedSelectedOptions.length > 0) {\n @if (multiselect) {\n <div class=\"flex flex-wrap gap-x-2 gap-y-1 items-start\">\n @for (option of displayedSelectedOptions; track option; let i = $index) {\n @if (showAll || i === 0) {\n <span class=\"bg-light-secondary dark:bg-dark-secondary rounded-md flex items-center text-xs/6 text-light-on-secondary dark:text-dark-on-secondary\"\n [ngClass]=\"{'w-full h-full px-4': !multiselect, 'px-1': multiselect}\">\n {{ option.value }}\n @if (showAll || i === 0) {\n <div (click)=\"onDeselectOption($event, option)\"\n class=\"ml-2 text-light-danger dark:text-dark-danger hover:cursor-pointer\">\n <svg class=\"w-3 h-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\">\n <path fill-rule=\"evenodd\"\n d=\"M10 8.586l-2.293-2.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 001.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293a1 1 0 00-1.414-1.414L10 8.586z\"\n clip-rule=\"evenodd\" />\n </svg>\n </div>\n }\n </span>\n @if (!showAll && displayedSelectedOptions.length > 1) {\n <span class=\"text-light-on-control/80 dark:text-dark-on-control/80 text-xs/6\">\n +{{ displayedSelectedOptions.length - 1 }}\n </span>\n }\n }\n }\n </div>\n } @else {\n <span class=\"text-light-on-control dark:text-dark-on-control overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary dark:text-dark-on-primary': variant === 'primary' && !disabled,\n 'text-light-on-secondary dark:text-dark-on-secondary': variant === 'secondary' && !disabled,\n 'text-light-on-danger dark:text-dark-on-danger': variant === 'danger' && !disabled,\n }\">{{ displayedSelectedOptions[0].value }}</span>\n }\n } @else {\n <span class=\"text-light-inactive dark:text-dark-inactive overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80': variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80': variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80': variant === 'danger' && !disabled,\n }\">\n @if (useIcon) {\n <ng-content select=\"buttonIcon\"></ng-content>\n } @else {\n {{ placeholder }}\n }\n </span>\n }\n </div>\n }\n <div class=\"text-light-on-control dark:text-dark-on-control\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80': variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80': variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80': variant === 'danger' && !disabled,\n }\">\n @if (isDropdownOpen()) {\n <svg class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\">\n <path fill-rule=\"evenodd\"\n d=\"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z\"\n clip-rule=\"evenodd\" />\n </svg>\n } @else {\n <svg class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\">\n <path fill-rule=\"evenodd\"\n d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"\n clip-rule=\"evenodd\" />\n </svg>\n }\n </div>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1225
|
+
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }, { propertyName: "label", first: true, predicate: ["label"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"flex gap-2 items-center w-full\"\n [ngClass]=\"{ 'flex-col items-start': layout === 'vertical' }\"\n>\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control {{\n labelWidth\n }}\"\n [ngClass]=\"{ 'w-full': layout === 'vertical' }\"\n >\n <!-- <ng-content select=\"[slot=label]\"></ng-content> -->\n <ng-content></ng-content>\n </label>\n\n @if (showAllItems) {\n <!-- Inline options display -->\n <div class=\"w-full flex-1\">\n @if (loading) {\n <div class=\"flex-1 flex items-center gap-2 w-full h-3\">\n <div class=\"animate-pulse bg-light-inactive dark:bg-dark-inactive rounded-md h-5 w-full\">\n \n </div>\n </div>\n } @else {\n <div class=\"flex flex-col gap-2\">\n @for (option of options; track option.id || option.value) {\n <label\n class=\"flex items-center gap-2 text-sm/6 text-light-on-control dark:text-dark-on-control cursor-pointer\"\n [ngClass]=\"{\n 'opacity-60 cursor-not-allowed': disabled,\n }\"\n >\n @if (multiselect) {\n <!-- Checkbox for multiselect -->\n <input\n type=\"checkbox\"\n [checked]=\"isOptionSelected(option)\"\n [disabled]=\"disabled\"\n (click)=\"!disabled && onToggleOption(option)\"\n class=\"w-5 h-5 rounded border-2 border-light-inactive dark:border-dark-inactive accent-light-primary dark:accent-dark-primary cursor-pointer disabled:cursor-not-allowed\"\n />\n } @else {\n <!-- Radio button for single select -->\n <input\n type=\"radio\"\n [checked]=\"isOptionSelected(option)\"\n [disabled]=\"disabled\"\n (click)=\"!disabled && onToggleOption(option)\"\n name=\"radio-group\"\n class=\"w-5 h-5 border-2 border-light-inactive dark:border-dark-inactive accent-light-primary dark:accent-dark-primary cursor-pointer disabled:cursor-not-allowed\"\n />\n }\n @if (\n option.shouldManualInput &&\n (isOptionSelected(option) || activeManualKey === (option.id || option.value))\n ) {\n <input\n type=\"text\"\n [(ngModel)]=\"manualInputValues[option.id || option.value]\"\n [attr.data-manual-key]=\"option.id || option.value\"\n (ngModelChange)=\"onManualInputChange(option, $event)\"\n (click)=\"$event.stopPropagation()\"\n (blur)=\"onManualInputBlur(option)\"\n (keydown.enter)=\"$event.preventDefault(); onManualInputBlur(option)\"\n [disabled]=\"!!disabled\"\n class=\"flex-1 text-light-on-control dark:text-dark-on-control rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary px-2 py-1 text-sm/6 bg-light-control dark:bg-dark-control\"\n />\n } @else {\n <span (click)=\"!disabled && onToggleOption(option)\">{{ option.value }}</span>\n }\n </label>\n }\n </div>\n }\n </div>\n } @else {\n <!-- Original dropdown display -->\n <div\n #origin\n class=\"w-full flex-1 relative overflow-visible rounded-md outline outline-light-inactive dark:outline-dark-inactive text-sm/6\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary focus:dark:outline-dark-primary':\n !disabled,\n 'bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary':\n variant === 'primary' && !disabled,\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary':\n variant === 'secondary' && !disabled,\n 'bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger':\n variant === 'danger' && !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60':\n disabled,\n }\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\"\n >\n <div\n class=\"px-3 py-1.5 text-sm/6 cursor-pointer flex flex-nowrap items-center justify-between overflow-hidden\"\n >\n @if (loading) {\n <div class=\"flex-1 flex items-center gap-2 w-full h-3\">\n <div\n class=\"animate-pulse bg-light-inactive dark:bg-dark-inactive rounded-md h-5 w-full\"\n >\n \n </div>\n </div>\n } @else {\n <div class=\"flex-1\">\n @if (!asButton && displayedSelectedOptions && displayedSelectedOptions.length > 0) {\n @if (multiselect) {\n <div class=\"flex flex-wrap gap-x-2 gap-y-1 items-start\">\n @for (option of displayedSelectedOptions; track option; let i = $index) {\n @if (showAll || i === 0) {\n <span\n class=\"bg-light-secondary dark:bg-dark-secondary rounded-md flex items-center text-xs/6 text-light-on-secondary dark:text-dark-on-secondary\"\n [ngClass]=\"{ 'w-full h-full px-4': !multiselect, 'px-1': multiselect }\"\n >\n {{ option.value }}\n @if (showAll || i === 0) {\n <div\n (click)=\"onDeselectOption($event, option)\"\n class=\"ml-2 text-light-danger dark:text-dark-danger hover:cursor-pointer\"\n >\n <svg\n class=\"w-3 h-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10 8.586l-2.293-2.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 001.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293a1 1 0 00-1.414-1.414L10 8.586z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </div>\n }\n </span>\n @if (!showAll && displayedSelectedOptions.length > 1) {\n <span\n class=\"text-light-on-control/80 dark:text-dark-on-control/80 text-xs/6\"\n >\n +{{ displayedSelectedOptions.length - 1 }}\n </span>\n }\n }\n }\n </div>\n } @else {\n <span\n class=\"text-light-on-control dark:text-dark-on-control overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary dark:text-dark-on-primary':\n variant === 'primary' && !disabled,\n 'text-light-on-secondary dark:text-dark-on-secondary':\n variant === 'secondary' && !disabled,\n 'text-light-on-danger dark:text-dark-on-danger':\n variant === 'danger' && !disabled,\n }\"\n >{{ displayedSelectedOptions[0].value }}</span\n >\n }\n } @else {\n <span\n class=\"text-light-inactive dark:text-dark-inactive overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80':\n variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80':\n variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80':\n variant === 'danger' && !disabled,\n }\"\n >\n @if (useIcon) {\n <ng-content select=\"buttonIcon\"></ng-content>\n } @else {\n {{ placeholder }}\n }\n </span>\n }\n </div>\n }\n <div\n class=\"text-light-on-control dark:text-dark-on-control\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80':\n variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80':\n variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80':\n variant === 'danger' && !disabled,\n }\"\n >\n @if (isDropdownOpen()) {\n <svg\n class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n } @else {\n <svg\n class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
924
1226
|
}
|
|
925
1227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SelectComponent, decorators: [{
|
|
926
1228
|
type: Component,
|
|
927
|
-
args: [{ selector: 'haloduck-select', imports: [CommonModule], providers: [
|
|
1229
|
+
args: [{ selector: 'haloduck-select', imports: [CommonModule, FormsModule], providers: [
|
|
928
1230
|
{
|
|
929
1231
|
provide: NG_VALUE_ACCESSOR,
|
|
930
1232
|
useExisting: forwardRef(() => SelectComponent),
|
|
931
1233
|
multi: true,
|
|
932
1234
|
},
|
|
933
1235
|
provideTranslocoScope('haloduck'),
|
|
934
|
-
], template: "<div class=\"flex gap-2 items-center w-full\"\n [ngClass]=\"{'flex-col items-start': layout === 'vertical'}\">\n <label #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control {{ labelWidth }}\"\n [ngClass]=\"{'w-full': layout === 'vertical'}\">\n <!-- <ng-content select=\"[slot=label]\"></ng-content> -->\n <ng-content></ng-content>\n </label>\n <div #origin\n class=\"w-full flex-1 relative overflow-visible rounded-md outline outline-light-inactive dark:outline-dark-inactive text-sm/6\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary focus:dark:outline-dark-primary': !disabled,\n 'bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary' : variant === 'primary' && !disabled,\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary' : variant === 'secondary' && !disabled,\n 'bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger' : variant === 'danger' && !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60' : disabled,\n }\"\n [tabindex]=\"(disabled) ? -1 : 0\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\">\n <div class=\"px-3 py-1.5 text-sm/6 cursor-pointer flex flex-nowrap items-center justify-between overflow-hidden\">\n @if(loading){\n <div class=\"flex-1 flex items-center gap-2 w-full h-3\">\n <div class=\"animate-pulse bg-light-inactive dark:bg-dark-inactive rounded-md h-5 w-full\"> </div>\n </div>\n }\n @else{\n <div class=\"flex-1\">\n @if (!asButton && displayedSelectedOptions && displayedSelectedOptions.length > 0) {\n @if (multiselect) {\n <div class=\"flex flex-wrap gap-x-2 gap-y-1 items-start\">\n @for (option of displayedSelectedOptions; track option; let i = $index) {\n @if (showAll || i === 0) {\n <span class=\"bg-light-secondary dark:bg-dark-secondary rounded-md flex items-center text-xs/6 text-light-on-secondary dark:text-dark-on-secondary\"\n [ngClass]=\"{'w-full h-full px-4': !multiselect, 'px-1': multiselect}\">\n {{ option.value }}\n @if (showAll || i === 0) {\n <div (click)=\"onDeselectOption($event, option)\"\n class=\"ml-2 text-light-danger dark:text-dark-danger hover:cursor-pointer\">\n <svg class=\"w-3 h-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\">\n <path fill-rule=\"evenodd\"\n d=\"M10 8.586l-2.293-2.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 001.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293a1 1 0 00-1.414-1.414L10 8.586z\"\n clip-rule=\"evenodd\" />\n </svg>\n </div>\n }\n </span>\n @if (!showAll && displayedSelectedOptions.length > 1) {\n <span class=\"text-light-on-control/80 dark:text-dark-on-control/80 text-xs/6\">\n +{{ displayedSelectedOptions.length - 1 }}\n </span>\n }\n }\n }\n </div>\n } @else {\n <span class=\"text-light-on-control dark:text-dark-on-control overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary dark:text-dark-on-primary': variant === 'primary' && !disabled,\n 'text-light-on-secondary dark:text-dark-on-secondary': variant === 'secondary' && !disabled,\n 'text-light-on-danger dark:text-dark-on-danger': variant === 'danger' && !disabled,\n }\">{{ displayedSelectedOptions[0].value }}</span>\n }\n } @else {\n <span class=\"text-light-inactive dark:text-dark-inactive overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80': variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80': variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80': variant === 'danger' && !disabled,\n }\">\n @if (useIcon) {\n <ng-content select=\"buttonIcon\"></ng-content>\n } @else {\n {{ placeholder }}\n }\n </span>\n }\n </div>\n }\n <div class=\"text-light-on-control dark:text-dark-on-control\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80': variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80': variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80': variant === 'danger' && !disabled,\n }\">\n @if (isDropdownOpen()) {\n <svg class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\">\n <path fill-rule=\"evenodd\"\n d=\"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z\"\n clip-rule=\"evenodd\" />\n </svg>\n } @else {\n <svg class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\">\n <path fill-rule=\"evenodd\"\n d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"\n clip-rule=\"evenodd\" />\n </svg>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
1236
|
+
], template: "<div\n class=\"flex gap-2 items-center w-full\"\n [ngClass]=\"{ 'flex-col items-start': layout === 'vertical' }\"\n>\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control {{\n labelWidth\n }}\"\n [ngClass]=\"{ 'w-full': layout === 'vertical' }\"\n >\n <!-- <ng-content select=\"[slot=label]\"></ng-content> -->\n <ng-content></ng-content>\n </label>\n\n @if (showAllItems) {\n <!-- Inline options display -->\n <div class=\"w-full flex-1\">\n @if (loading) {\n <div class=\"flex-1 flex items-center gap-2 w-full h-3\">\n <div class=\"animate-pulse bg-light-inactive dark:bg-dark-inactive rounded-md h-5 w-full\">\n \n </div>\n </div>\n } @else {\n <div class=\"flex flex-col gap-2\">\n @for (option of options; track option.id || option.value) {\n <label\n class=\"flex items-center gap-2 text-sm/6 text-light-on-control dark:text-dark-on-control cursor-pointer\"\n [ngClass]=\"{\n 'opacity-60 cursor-not-allowed': disabled,\n }\"\n >\n @if (multiselect) {\n <!-- Checkbox for multiselect -->\n <input\n type=\"checkbox\"\n [checked]=\"isOptionSelected(option)\"\n [disabled]=\"disabled\"\n (click)=\"!disabled && onToggleOption(option)\"\n class=\"w-5 h-5 rounded border-2 border-light-inactive dark:border-dark-inactive accent-light-primary dark:accent-dark-primary cursor-pointer disabled:cursor-not-allowed\"\n />\n } @else {\n <!-- Radio button for single select -->\n <input\n type=\"radio\"\n [checked]=\"isOptionSelected(option)\"\n [disabled]=\"disabled\"\n (click)=\"!disabled && onToggleOption(option)\"\n name=\"radio-group\"\n class=\"w-5 h-5 border-2 border-light-inactive dark:border-dark-inactive accent-light-primary dark:accent-dark-primary cursor-pointer disabled:cursor-not-allowed\"\n />\n }\n @if (\n option.shouldManualInput &&\n (isOptionSelected(option) || activeManualKey === (option.id || option.value))\n ) {\n <input\n type=\"text\"\n [(ngModel)]=\"manualInputValues[option.id || option.value]\"\n [attr.data-manual-key]=\"option.id || option.value\"\n (ngModelChange)=\"onManualInputChange(option, $event)\"\n (click)=\"$event.stopPropagation()\"\n (blur)=\"onManualInputBlur(option)\"\n (keydown.enter)=\"$event.preventDefault(); onManualInputBlur(option)\"\n [disabled]=\"!!disabled\"\n class=\"flex-1 text-light-on-control dark:text-dark-on-control rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary px-2 py-1 text-sm/6 bg-light-control dark:bg-dark-control\"\n />\n } @else {\n <span (click)=\"!disabled && onToggleOption(option)\">{{ option.value }}</span>\n }\n </label>\n }\n </div>\n }\n </div>\n } @else {\n <!-- Original dropdown display -->\n <div\n #origin\n class=\"w-full flex-1 relative overflow-visible rounded-md outline outline-light-inactive dark:outline-dark-inactive text-sm/6\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary focus:dark:outline-dark-primary':\n !disabled,\n 'bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary':\n variant === 'primary' && !disabled,\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary':\n variant === 'secondary' && !disabled,\n 'bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger':\n variant === 'danger' && !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60':\n disabled,\n }\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\"\n >\n <div\n class=\"px-3 py-1.5 text-sm/6 cursor-pointer flex flex-nowrap items-center justify-between overflow-hidden\"\n >\n @if (loading) {\n <div class=\"flex-1 flex items-center gap-2 w-full h-3\">\n <div\n class=\"animate-pulse bg-light-inactive dark:bg-dark-inactive rounded-md h-5 w-full\"\n >\n \n </div>\n </div>\n } @else {\n <div class=\"flex-1\">\n @if (!asButton && displayedSelectedOptions && displayedSelectedOptions.length > 0) {\n @if (multiselect) {\n <div class=\"flex flex-wrap gap-x-2 gap-y-1 items-start\">\n @for (option of displayedSelectedOptions; track option; let i = $index) {\n @if (showAll || i === 0) {\n <span\n class=\"bg-light-secondary dark:bg-dark-secondary rounded-md flex items-center text-xs/6 text-light-on-secondary dark:text-dark-on-secondary\"\n [ngClass]=\"{ 'w-full h-full px-4': !multiselect, 'px-1': multiselect }\"\n >\n {{ option.value }}\n @if (showAll || i === 0) {\n <div\n (click)=\"onDeselectOption($event, option)\"\n class=\"ml-2 text-light-danger dark:text-dark-danger hover:cursor-pointer\"\n >\n <svg\n class=\"w-3 h-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10 8.586l-2.293-2.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 001.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293a1 1 0 00-1.414-1.414L10 8.586z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </div>\n }\n </span>\n @if (!showAll && displayedSelectedOptions.length > 1) {\n <span\n class=\"text-light-on-control/80 dark:text-dark-on-control/80 text-xs/6\"\n >\n +{{ displayedSelectedOptions.length - 1 }}\n </span>\n }\n }\n }\n </div>\n } @else {\n <span\n class=\"text-light-on-control dark:text-dark-on-control overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary dark:text-dark-on-primary':\n variant === 'primary' && !disabled,\n 'text-light-on-secondary dark:text-dark-on-secondary':\n variant === 'secondary' && !disabled,\n 'text-light-on-danger dark:text-dark-on-danger':\n variant === 'danger' && !disabled,\n }\"\n >{{ displayedSelectedOptions[0].value }}</span\n >\n }\n } @else {\n <span\n class=\"text-light-inactive dark:text-dark-inactive overflow-hidden overflow-ellipsis\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80':\n variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80':\n variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80':\n variant === 'danger' && !disabled,\n }\"\n >\n @if (useIcon) {\n <ng-content select=\"buttonIcon\"></ng-content>\n } @else {\n {{ placeholder }}\n }\n </span>\n }\n </div>\n }\n <div\n class=\"text-light-on-control dark:text-dark-on-control\"\n [ngClass]=\"{\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n 'text-light-on-primary/80 dark:text-dark-on-primary/80':\n variant === 'primary' && !disabled,\n 'text-light-on-secondary/80 dark:text-dark-on-secondary/80':\n variant === 'secondary' && !disabled,\n 'text-light-on-danger/80 dark:text-dark-on-danger/80':\n variant === 'danger' && !disabled,\n }\"\n >\n @if (isDropdownOpen()) {\n <svg\n class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n } @else {\n <svg\n class=\"w-4 h-4 ml-2 inline-block\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </div>\n </div>\n </div>\n }\n</div>\n" }]
|
|
935
1237
|
}], ctorParameters: () => [], propDecorators: { selectedChange: [{
|
|
936
1238
|
type: Output
|
|
937
1239
|
}], disabled: [{
|
|
@@ -954,6 +1256,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
954
1256
|
type: Input
|
|
955
1257
|
}], showAll: [{
|
|
956
1258
|
type: Input
|
|
1259
|
+
}], showAllItems: [{
|
|
1260
|
+
type: Input
|
|
957
1261
|
}], options: [{
|
|
958
1262
|
type: Input
|
|
959
1263
|
}], layout: [{
|
|
@@ -1040,9 +1344,7 @@ class CalendarComponent {
|
|
|
1040
1344
|
else {
|
|
1041
1345
|
const dateRange = value;
|
|
1042
1346
|
currentDate =
|
|
1043
|
-
dateRange && dateRange.from && dateRange.to
|
|
1044
|
-
? dateRange.from
|
|
1045
|
-
: dateToString(new Date());
|
|
1347
|
+
dateRange && dateRange.from && dateRange.to ? dateRange.from : dateToString(new Date());
|
|
1046
1348
|
}
|
|
1047
1349
|
this.currentYear = parseInt(currentDate.slice(0, 4), 10);
|
|
1048
1350
|
this.currentMonth = parseInt(currentDate.slice(5, 7), 10) - 1;
|
|
@@ -1059,8 +1361,7 @@ class CalendarComponent {
|
|
|
1059
1361
|
if (lastOfCalendar.getDate() > 6) {
|
|
1060
1362
|
lastOfCalendar.setDate(lastOfCalendar.getDate() - 7);
|
|
1061
1363
|
}
|
|
1062
|
-
const dateDiff = Math.ceil((lastOfCalendar.getTime() - firstOfCalendar.getTime()) /
|
|
1063
|
-
(1000 * 60 * 60 * 24)) + 1;
|
|
1364
|
+
const dateDiff = Math.ceil((lastOfCalendar.getTime() - firstOfCalendar.getTime()) / (1000 * 60 * 60 * 24)) + 1;
|
|
1064
1365
|
this.listCalendarDate = [];
|
|
1065
1366
|
for (let i = 0; i < dateDiff; i++) {
|
|
1066
1367
|
const datetime = dateToString(firstOfCalendar);
|
|
@@ -1175,11 +1476,11 @@ class CalendarComponent {
|
|
|
1175
1476
|
});
|
|
1176
1477
|
}
|
|
1177
1478
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1178
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: CalendarComponent, isStandalone: true, selector: "haloduck-calendar", inputs: { singleDate: "singleDate", firstDayOfWeek: "firstDayOfWeek", selectedDate: "selectedDate", selectedDateRange: "selectedDateRange" }, outputs: { dateChange: "dateChange", dateRangeChange: "dateRangeChange" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "monthSelect", first: true, predicate: ["monthSelect"], descendants: true }], ngImport: i0, template: "<div
|
|
1479
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: CalendarComponent, isStandalone: true, selector: "haloduck-calendar", inputs: { singleDate: "singleDate", firstDayOfWeek: "firstDayOfWeek", selectedDate: "selectedDate", selectedDateRange: "selectedDateRange" }, outputs: { dateChange: "dateChange", dateRangeChange: "dateRangeChange" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "monthSelect", first: true, predicate: ["monthSelect"], descendants: true }], ngImport: i0, template: "<div\n id=\"dateRangeCalendar\"\n class=\"min-w-96 brightness-125 bg-light-background dark:bg-dark-background border border-light-inactive dark:border-dark-inactive rounded text-center p-4 flex flex-col gap-4\"\n tabindex=\"1\"\n>\n <div class=\"flex items-center\">\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustYear(-1)\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n <div class=\"flex-auto text-sm font-semibold flex justify-center\">\n <div class=\"w-32\">\n <haloduck-select\n [multiselect]=\"false\"\n [atLeastOne]=\"true\"\n [options]=\"yearList\"\n [value]=\"currentYear + ''\"\n (selectedChange)=\"onSelectYear($event)\"\n >\n </haloduck-select>\n </div>\n </div>\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustYear(1)\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"flex items-center\">\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustMonth(-1)\"\n >\n <span class=\"sr-only\">\uC774\uC804 \uB2EC</span>\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n <div class=\"flex-auto text-sm font-semibold flex justify-center\">\n <div class=\"w-32\">\n <haloduck-select\n [multiselect]=\"false\"\n [atLeastOne]=\"true\"\n [options]=\"monthList\"\n [value]=\"currentMonth + ''\"\n (selectedChange)=\"onSelectMonth($event)\"\n >\n </haloduck-select>\n </div>\n </div>\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustMonth(1)\"\n >\n <span class=\"sr-only\">\uB2E4\uC74C \uB2EC</span>\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n </div>\n\n <div>\n <div\n class=\"grid grid-cols-7 gap-[1px] text-xs/6 font-semibold text-light-on-background dark:text-dark-on-background\"\n >\n <div>{{ 'haloduck.ui.calendar.Mon' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Tue' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Wed' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Thu' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Fri' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Sat' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Sun' | transloco }}</div>\n </div>\n\n <div class=\"isolate mt-2 grid grid-cols-7 gap-[1px] rounded-lg text-sm shadow overflow-hidden\">\n @for (date of listCalendarDate; track date.datetime) {\n <button\n type=\"button\"\n (click)=\"onSelectCalendarDate(date)\"\n class=\"py-1.5 hover:cursor-pointer bg-light-alternative dark:bg-dark-alternative text-light-on-alternative dark:text-dark-on-alternative\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control text-light-on-control dark:text-dark-on-control':\n date.isCurrentMonth,\n }\"\n >\n <time\n [ngClass]=\"{\n 'font-semibold bg-light-primary-light dark:bg-dark-primary-light text-on-light-primary-light dark:text-dark-on-primary-light':\n date.isToday && date.datetime !== selectedDateRange?.from,\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary':\n date.datetime === selectedDateRange?.from,\n 'bg-gray-500 font-semibold text-white': date.isTheDate,\n }\"\n class=\"mx-auto flex size-7 items-center justify-center rounded-full hover:font-bold\"\n >{{ date.date }}</time\n >\n </button>\n }\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SelectComponent, selector: "haloduck-select", inputs: ["disabled", "loading", "variant", "asButton", "useIcon", "useFilter", "multiselect", "placeholder", "atLeastOne", "showAll", "showAllItems", "options", "layout", "labelWidth", "value"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
1179
1480
|
}
|
|
1180
1481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1181
1482
|
type: Component,
|
|
1182
|
-
args: [{ selector: 'haloduck-calendar', imports: [CommonModule, SelectComponent, FormsModule, TranslocoModule], providers: [provideTranslocoScope('haloduck')], template: "<div
|
|
1483
|
+
args: [{ selector: 'haloduck-calendar', imports: [CommonModule, SelectComponent, FormsModule, TranslocoModule], providers: [provideTranslocoScope('haloduck')], template: "<div\n id=\"dateRangeCalendar\"\n class=\"min-w-96 brightness-125 bg-light-background dark:bg-dark-background border border-light-inactive dark:border-dark-inactive rounded text-center p-4 flex flex-col gap-4\"\n tabindex=\"1\"\n>\n <div class=\"flex items-center\">\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustYear(-1)\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n <div class=\"flex-auto text-sm font-semibold flex justify-center\">\n <div class=\"w-32\">\n <haloduck-select\n [multiselect]=\"false\"\n [atLeastOne]=\"true\"\n [options]=\"yearList\"\n [value]=\"currentYear + ''\"\n (selectedChange)=\"onSelectYear($event)\"\n >\n </haloduck-select>\n </div>\n </div>\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustYear(1)\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n </div>\n\n <div class=\"flex items-center\">\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustMonth(-1)\"\n >\n <span class=\"sr-only\">\uC774\uC804 \uB2EC</span>\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n <div class=\"flex-auto text-sm font-semibold flex justify-center\">\n <div class=\"w-32\">\n <haloduck-select\n [multiselect]=\"false\"\n [atLeastOne]=\"true\"\n [options]=\"monthList\"\n [value]=\"currentMonth + ''\"\n (selectedChange)=\"onSelectMonth($event)\"\n >\n </haloduck-select>\n </div>\n </div>\n <button\n type=\"button\"\n class=\"-m-1.5 flex flex-none items-center justify-center p-1.5 text-light-on-background dark:text-dark-on-background hover:scale-105 hover:cursor-pointer active:scale-95\"\n (click)=\"onAdjustMonth(1)\"\n >\n <span class=\"sr-only\">\uB2E4\uC74C \uB2EC</span>\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </button>\n </div>\n\n <div>\n <div\n class=\"grid grid-cols-7 gap-[1px] text-xs/6 font-semibold text-light-on-background dark:text-dark-on-background\"\n >\n <div>{{ 'haloduck.ui.calendar.Mon' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Tue' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Wed' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Thu' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Fri' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Sat' | transloco }}</div>\n <div>{{ 'haloduck.ui.calendar.Sun' | transloco }}</div>\n </div>\n\n <div class=\"isolate mt-2 grid grid-cols-7 gap-[1px] rounded-lg text-sm shadow overflow-hidden\">\n @for (date of listCalendarDate; track date.datetime) {\n <button\n type=\"button\"\n (click)=\"onSelectCalendarDate(date)\"\n class=\"py-1.5 hover:cursor-pointer bg-light-alternative dark:bg-dark-alternative text-light-on-alternative dark:text-dark-on-alternative\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control text-light-on-control dark:text-dark-on-control':\n date.isCurrentMonth,\n }\"\n >\n <time\n [ngClass]=\"{\n 'font-semibold bg-light-primary-light dark:bg-dark-primary-light text-on-light-primary-light dark:text-dark-on-primary-light':\n date.isToday && date.datetime !== selectedDateRange?.from,\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary':\n date.datetime === selectedDateRange?.from,\n 'bg-gray-500 font-semibold text-white': date.isTheDate,\n }\"\n class=\"mx-auto flex size-7 items-center justify-center rounded-full hover:font-bold\"\n >{{ date.date }}</time\n >\n </button>\n }\n </div>\n </div>\n</div>\n" }]
|
|
1183
1484
|
}], ctorParameters: () => [], propDecorators: { monthSelect: [{
|
|
1184
1485
|
type: ViewChild,
|
|
1185
1486
|
args: ['monthSelect', { static: false }]
|
|
@@ -1237,11 +1538,11 @@ class DialogContainerComponent {
|
|
|
1237
1538
|
this.close.emit();
|
|
1238
1539
|
}
|
|
1239
1540
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DialogContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1240
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: DialogContainerComponent, isStandalone: true, selector: "haloduck-dialog-container", inputs: { childComponent: "childComponent", data: "data" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "dialogContainer", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div
|
|
1541
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: DialogContainerComponent, isStandalone: true, selector: "haloduck-dialog-container", inputs: { childComponent: "childComponent", data: "data" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "dialogContainer", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div\n class=\"h-full w-full max-h-full max-w-full fixed inset-0 bg-black/50 flex items-center justify-center overflow-hidden\"\n>\n <!-- <div class=\"w-full h-full max-w-full max-h-full bg-white p-5 rounded-lg overflow-y-auto\"\n (click)=\"$event.stopPropagation()\"> -->\n <ng-container id=\"dialogContainer\" #dialogContainer></ng-container>\n <!-- </div> -->\n</div>\n", styles: [".custom-dialog-panel{width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:0}\n"] });
|
|
1241
1542
|
}
|
|
1242
1543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DialogContainerComponent, decorators: [{
|
|
1243
1544
|
type: Component,
|
|
1244
|
-
args: [{ selector: 'haloduck-dialog-container', template: "<div
|
|
1545
|
+
args: [{ selector: 'haloduck-dialog-container', template: "<div\n class=\"h-full w-full max-h-full max-w-full fixed inset-0 bg-black/50 flex items-center justify-center overflow-hidden\"\n>\n <!-- <div class=\"w-full h-full max-w-full max-h-full bg-white p-5 rounded-lg overflow-y-auto\"\n (click)=\"$event.stopPropagation()\"> -->\n <ng-container id=\"dialogContainer\" #dialogContainer></ng-container>\n <!-- </div> -->\n</div>\n", styles: [".custom-dialog-panel{width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:0}\n"] }]
|
|
1245
1546
|
}], propDecorators: { childComponent: [{
|
|
1246
1547
|
type: Input
|
|
1247
1548
|
}], data: [{
|
|
@@ -1278,7 +1579,7 @@ class DialogService {
|
|
|
1278
1579
|
close(overlayRef) {
|
|
1279
1580
|
if (overlayRef) {
|
|
1280
1581
|
overlayRef.dispose();
|
|
1281
|
-
this.dialogStack = this.dialogStack.filter(ref => ref !== overlayRef);
|
|
1582
|
+
this.dialogStack = this.dialogStack.filter((ref) => ref !== overlayRef);
|
|
1282
1583
|
}
|
|
1283
1584
|
else {
|
|
1284
1585
|
// 마지막 다이얼로그 닫기
|
|
@@ -1307,16 +1608,14 @@ class ConfirmDialogComponent {
|
|
|
1307
1608
|
this.context.clickedButton$.complete();
|
|
1308
1609
|
this.dialogService.close(this.context.overlayRef);
|
|
1309
1610
|
}
|
|
1310
|
-
ngOnInit() {
|
|
1311
|
-
}
|
|
1312
|
-
constructor() {
|
|
1313
|
-
}
|
|
1611
|
+
ngOnInit() { }
|
|
1612
|
+
constructor() { }
|
|
1314
1613
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1315
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: ConfirmDialogComponent, isStandalone: true, selector: "haloduck-confirm-dialog", inputs: { context: "context" }, ngImport: i0, template: "<div
|
|
1614
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: ConfirmDialogComponent, isStandalone: true, selector: "haloduck-confirm-dialog", inputs: { context: "context" }, ngImport: i0, template: "<div\n class=\"w-120 max-w-full flex flex-col gap-4 text-light-on-background dark:text-dark-on-background bg-light-background dark:bg-dark-background\"\n>\n <div class=\"font-bold\">{{ context.title }}</div>\n <p>{{ context.message }}</p>\n <div class=\"flex items-center justify-center gap-4\">\n @for (button of context.buttons; track button.id) {\n <haloduck-button [variant]=\"button.variant\" (click)=\"onButtonClicked(button.id)\">{{\n button.label\n }}</haloduck-button>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: ButtonComponent, selector: "haloduck-button", inputs: ["disabled", "variant"] }] });
|
|
1316
1615
|
}
|
|
1317
1616
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
1318
1617
|
type: Component,
|
|
1319
|
-
args: [{ selector: 'haloduck-confirm-dialog', imports: [ButtonComponent], template: "<div
|
|
1618
|
+
args: [{ selector: 'haloduck-confirm-dialog', imports: [ButtonComponent], template: "<div\n class=\"w-120 max-w-full flex flex-col gap-4 text-light-on-background dark:text-dark-on-background bg-light-background dark:bg-dark-background\"\n>\n <div class=\"font-bold\">{{ context.title }}</div>\n <p>{{ context.message }}</p>\n <div class=\"flex items-center justify-center gap-4\">\n @for (button of context.buttons; track button.id) {\n <haloduck-button [variant]=\"button.variant\" (click)=\"onButtonClicked(button.id)\">{{\n button.label\n }}</haloduck-button>\n }\n </div>\n</div>\n" }]
|
|
1320
1619
|
}], ctorParameters: () => [], propDecorators: { context: [{
|
|
1321
1620
|
type: Input
|
|
1322
1621
|
}] } });
|
|
@@ -1355,8 +1654,7 @@ class CopyButtonComponent {
|
|
|
1355
1654
|
this.isAnimating = false;
|
|
1356
1655
|
}, 500); // Animation duration
|
|
1357
1656
|
if (navigator.clipboard && window.isSecureContext) {
|
|
1358
|
-
navigator.clipboard
|
|
1359
|
-
.writeText(this.text);
|
|
1657
|
+
navigator.clipboard.writeText(this.text);
|
|
1360
1658
|
// .then(() => {
|
|
1361
1659
|
// console.log('Text copied to clipboard');
|
|
1362
1660
|
// })
|
|
@@ -1382,11 +1680,11 @@ class CopyButtonComponent {
|
|
|
1382
1680
|
}
|
|
1383
1681
|
}
|
|
1384
1682
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: CopyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1385
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: CopyButtonComponent, isStandalone: true, selector: "haloduck-copy-button", inputs: { text: "text" }, providers: [provideTranslocoScope('haloduck')], ngImport: i0, template: "<ng-container *transloco=\"let _ts; read: 'haloduck'\">\n <button
|
|
1683
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: CopyButtonComponent, isStandalone: true, selector: "haloduck-copy-button", inputs: { text: "text" }, providers: [provideTranslocoScope('haloduck')], ngImport: i0, template: "<ng-container *transloco=\"let _ts; read: 'haloduck'\">\n <button\n type=\"button\"\n class=\"group inline-flex items-center px-2 py-1 bg-light-alternative dark:bg-dark-alternative hover:brightness-125 rounded text-xs text-light-on-alternative dark:text-dark-on-alternative hover:cursor-pointer active:scale-95 transition-transform\"\n (click)=\"copyToClipboard($event)\"\n title=\"Copy to clipboard\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [class]=\"\n 'h-4 w-4 mr-1 transition-all duration-500 ' +\n (isAnimating ? 'scale-150 opacity-0' : 'scale-100 opacity-100')\n \"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <rect\n x=\"9\"\n y=\"9\"\n width=\"13\"\n height=\"13\"\n rx=\"2\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n fill=\"none\"\n />\n <rect\n x=\"3\"\n y=\"3\"\n width=\"13\"\n height=\"13\"\n rx=\"2\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n fill=\"none\"\n />\n </svg>\n <span class=\"hidden group-hover:inline\">\n @if (isAnimating) {\n {{ _ts('ui.button.Copied') }}\n } @else {\n {{ _ts('ui.button.Copy') }}\n }\n </span>\n </button>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i2$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
|
|
1386
1684
|
}
|
|
1387
1685
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: CopyButtonComponent, decorators: [{
|
|
1388
1686
|
type: Component,
|
|
1389
|
-
args: [{ selector: 'haloduck-copy-button', imports: [TranslocoModule], providers: [provideTranslocoScope('haloduck')], template: "<ng-container *transloco=\"let _ts; read: 'haloduck'\">\n <button
|
|
1687
|
+
args: [{ selector: 'haloduck-copy-button', imports: [TranslocoModule], providers: [provideTranslocoScope('haloduck')], template: "<ng-container *transloco=\"let _ts; read: 'haloduck'\">\n <button\n type=\"button\"\n class=\"group inline-flex items-center px-2 py-1 bg-light-alternative dark:bg-dark-alternative hover:brightness-125 rounded text-xs text-light-on-alternative dark:text-dark-on-alternative hover:cursor-pointer active:scale-95 transition-transform\"\n (click)=\"copyToClipboard($event)\"\n title=\"Copy to clipboard\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [class]=\"\n 'h-4 w-4 mr-1 transition-all duration-500 ' +\n (isAnimating ? 'scale-150 opacity-0' : 'scale-100 opacity-100')\n \"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <rect\n x=\"9\"\n y=\"9\"\n width=\"13\"\n height=\"13\"\n rx=\"2\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n fill=\"none\"\n />\n <rect\n x=\"3\"\n y=\"3\"\n width=\"13\"\n height=\"13\"\n rx=\"2\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n fill=\"none\"\n />\n </svg>\n <span class=\"hidden group-hover:inline\">\n @if (isAnimating) {\n {{ _ts('ui.button.Copied') }}\n } @else {\n {{ _ts('ui.button.Copy') }}\n }\n </span>\n </button>\n</ng-container>\n" }]
|
|
1390
1688
|
}], propDecorators: { text: [{
|
|
1391
1689
|
type: Input
|
|
1392
1690
|
}] } });
|
|
@@ -1442,9 +1740,7 @@ class DatePickerComponent {
|
|
|
1442
1740
|
componentRef.instance.singleDate = true;
|
|
1443
1741
|
componentRef.instance.selectedDate = this.selectedDate;
|
|
1444
1742
|
// Subscribe to events emitted by the CalendarComponent
|
|
1445
|
-
componentRef.instance.dateChange
|
|
1446
|
-
.pipe(takeUntil(this.destroy$))
|
|
1447
|
-
.subscribe((date) => {
|
|
1743
|
+
componentRef.instance.dateChange.pipe(takeUntil(this.destroy$)).subscribe((date) => {
|
|
1448
1744
|
this.onDateChange(date);
|
|
1449
1745
|
this.closeCalendar();
|
|
1450
1746
|
});
|
|
@@ -1500,7 +1796,7 @@ class DatePickerComponent {
|
|
|
1500
1796
|
multi: true,
|
|
1501
1797
|
},
|
|
1502
1798
|
provideTranslocoScope('haloduck'),
|
|
1503
|
-
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }], ngImport: i0, template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div
|
|
1799
|
+
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }], ngImport: i0, template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div\n #origin\n class=\"py-1.5 relative mt-2 gap-2 rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary':\n !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60':\n disabled,\n }\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"onClick()\"\n>\n <div class=\"flex items-center\">\n <div\n class=\"flex-1 text-light-on-control dark:text-dark-on-control sm:text-sm/6 text-center\"\n [ngClass]=\"{\n 'text-light-inactive dark:text-dark-inactive': !selectedDate && !disabled,\n 'text-light-on-control dark:text-dark-on-control': selectedDate && !disabled,\n }\"\n >\n {{ selectedDate || placeholder }}\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
1504
1800
|
}
|
|
1505
1801
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
1506
1802
|
type: Component,
|
|
@@ -1511,7 +1807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
1511
1807
|
multi: true,
|
|
1512
1808
|
},
|
|
1513
1809
|
provideTranslocoScope('haloduck'),
|
|
1514
|
-
], template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div
|
|
1810
|
+
], template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div\n #origin\n class=\"py-1.5 relative mt-2 gap-2 rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary':\n !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60':\n disabled,\n }\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"onClick()\"\n>\n <div class=\"flex items-center\">\n <div\n class=\"flex-1 text-light-on-control dark:text-dark-on-control sm:text-sm/6 text-center\"\n [ngClass]=\"{\n 'text-light-inactive dark:text-dark-inactive': !selectedDate && !disabled,\n 'text-light-on-control dark:text-dark-on-control': selectedDate && !disabled,\n }\"\n >\n {{ selectedDate || placeholder }}\n </div>\n </div>\n</div>\n" }]
|
|
1515
1811
|
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
1516
1812
|
type: Input
|
|
1517
1813
|
}], placeholder: [{
|
|
@@ -1614,8 +1910,7 @@ class DateRangeComponent {
|
|
|
1614
1910
|
default:
|
|
1615
1911
|
break;
|
|
1616
1912
|
}
|
|
1617
|
-
return
|
|
1618
|
-
dateRange.to === dateToString(to));
|
|
1913
|
+
return dateRange.from === dateToString(from) && dateRange.to === dateToString(to);
|
|
1619
1914
|
});
|
|
1620
1915
|
if (selectedOption) {
|
|
1621
1916
|
return selectedOption.id || selectedOption.value;
|
|
@@ -1651,9 +1946,7 @@ class DateRangeComponent {
|
|
|
1651
1946
|
componentRef.instance.firstDayOfWeek = this.firstDayOfWeek;
|
|
1652
1947
|
componentRef.instance.selectedDateRange = this.dateRange;
|
|
1653
1948
|
// Subscribe to events emitted by the CalendarComponent
|
|
1654
|
-
componentRef.instance.dateRangeChange
|
|
1655
|
-
.pipe(takeUntil(this.destroy$))
|
|
1656
|
-
.subscribe((date) => {
|
|
1949
|
+
componentRef.instance.dateRangeChange.pipe(takeUntil(this.destroy$)).subscribe((date) => {
|
|
1657
1950
|
this.onDateRangeChange(date);
|
|
1658
1951
|
this.closeCalendar();
|
|
1659
1952
|
});
|
|
@@ -1770,7 +2063,7 @@ class DateRangeComponent {
|
|
|
1770
2063
|
multi: true,
|
|
1771
2064
|
},
|
|
1772
2065
|
provideTranslocoScope('haloduck'),
|
|
1773
|
-
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }], ngImport: i0, template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div
|
|
2066
|
+
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }], ngImport: i0, template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div\n #origin\n class=\"relative mt-2 gap-2 rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary':\n !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60':\n disabled,\n }\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"onClick()\"\n>\n <div class=\"flex items-center\">\n <haloduck-select\n [multiselect]=\"false\"\n [disabled]=\"disabled\"\n [options]=\"dateRangeOptions\"\n [atLeastOne]=\"true\"\n (click)=\"$event.stopPropagation()\"\n variant=\"primary\"\n placeholder=\"{{ 'haloduck.ui.calendar.Period' | transloco }}\"\n [(ngModel)]=\"selectedDateRangeOptionId\"\n (ngModelChange)=\"onDateRangeOptionChange($event)\"\n >\n </haloduck-select>\n @if (getSelectedDateRangeString()) {\n <div\n class=\"flex-1 sm:text-sm/6 text-center\"\n [ngClass]=\"{\n 'text-light-on-control dark:text-dark-on-control': !disabled,\n 'text-light-on-control/60 dark:text-light-on-control/60': disabled,\n }\"\n >\n {{ getSelectedDateRangeString() }}\n </div>\n } @else {\n <div\n class=\"flex-1 sm:text-sm/6 text-center\"\n [ngClass]=\"{\n 'text-light-inactive dark:text-dark-inactive': !disabled,\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n }\"\n >\n {{ placeholder }}\n </div>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: SelectComponent, selector: "haloduck-select", inputs: ["disabled", "loading", "variant", "asButton", "useIcon", "useFilter", "multiselect", "placeholder", "atLeastOne", "showAll", "showAllItems", "options", "layout", "labelWidth", "value"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
1774
2067
|
}
|
|
1775
2068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DateRangeComponent, decorators: [{
|
|
1776
2069
|
type: Component,
|
|
@@ -1781,7 +2074,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
1781
2074
|
multi: true,
|
|
1782
2075
|
},
|
|
1783
2076
|
provideTranslocoScope('haloduck'),
|
|
1784
|
-
], template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div
|
|
2077
|
+
], template: "<label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n</label>\n<div\n #origin\n class=\"relative mt-2 gap-2 rounded-md outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive\"\n [ngClass]=\"{\n 'bg-light-control dark:bg-dark-control focus:outline-2 focus:outline-offset-2 focus:outline-light-primary dark:focus:outline-dark-primary':\n !disabled,\n 'bg-light-control/60 dark:bg-dark-control/60 text-light-on-control/60 dark:text-dark-on-control/60':\n disabled,\n }\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"onClick()\"\n>\n <div class=\"flex items-center\">\n <haloduck-select\n [multiselect]=\"false\"\n [disabled]=\"disabled\"\n [options]=\"dateRangeOptions\"\n [atLeastOne]=\"true\"\n (click)=\"$event.stopPropagation()\"\n variant=\"primary\"\n placeholder=\"{{ 'haloduck.ui.calendar.Period' | transloco }}\"\n [(ngModel)]=\"selectedDateRangeOptionId\"\n (ngModelChange)=\"onDateRangeOptionChange($event)\"\n >\n </haloduck-select>\n @if (getSelectedDateRangeString()) {\n <div\n class=\"flex-1 sm:text-sm/6 text-center\"\n [ngClass]=\"{\n 'text-light-on-control dark:text-dark-on-control': !disabled,\n 'text-light-on-control/60 dark:text-light-on-control/60': disabled,\n }\"\n >\n {{ getSelectedDateRangeString() }}\n </div>\n } @else {\n <div\n class=\"flex-1 sm:text-sm/6 text-center\"\n [ngClass]=\"{\n 'text-light-inactive dark:text-dark-inactive': !disabled,\n 'text-light-on-control/60 dark:text-dark-on-control/60': disabled,\n }\"\n >\n {{ placeholder }}\n </div>\n }\n </div>\n</div>\n" }]
|
|
1785
2078
|
}], ctorParameters: () => [], propDecorators: { dateRangeOptions: [{
|
|
1786
2079
|
type: Input
|
|
1787
2080
|
}], disabled: [{
|
|
@@ -1851,18 +2144,14 @@ class DrawCanvasComponent {
|
|
|
1851
2144
|
const touch = event.touches[0];
|
|
1852
2145
|
const rect = this.canvasRef.nativeElement.getBoundingClientRect();
|
|
1853
2146
|
this.ctx.beginPath();
|
|
1854
|
-
this.ctx.moveTo((touch.clientX - rect.left) *
|
|
1855
|
-
(this.canvasRef.nativeElement.width / rect.width), (touch.clientY - rect.top) *
|
|
1856
|
-
(this.canvasRef.nativeElement.height / rect.height));
|
|
2147
|
+
this.ctx.moveTo((touch.clientX - rect.left) * (this.canvasRef.nativeElement.width / rect.width), (touch.clientY - rect.top) * (this.canvasRef.nativeElement.height / rect.height));
|
|
1857
2148
|
}
|
|
1858
2149
|
touchDraw(event) {
|
|
1859
2150
|
if (!this.isDrawing)
|
|
1860
2151
|
return;
|
|
1861
2152
|
const touch = event.touches[0];
|
|
1862
2153
|
const rect = this.canvasRef.nativeElement.getBoundingClientRect();
|
|
1863
|
-
this.ctx.lineTo((touch.clientX - rect.left) *
|
|
1864
|
-
(this.canvasRef.nativeElement.width / rect.width), (touch.clientY - rect.top) *
|
|
1865
|
-
(this.canvasRef.nativeElement.height / rect.height));
|
|
2154
|
+
this.ctx.lineTo((touch.clientX - rect.left) * (this.canvasRef.nativeElement.width / rect.width), (touch.clientY - rect.top) * (this.canvasRef.nativeElement.height / rect.height));
|
|
1866
2155
|
this.ctx.stroke();
|
|
1867
2156
|
}
|
|
1868
2157
|
stopDrawing() {
|
|
@@ -1914,7 +2203,7 @@ class DrawCanvasComponent {
|
|
|
1914
2203
|
multi: true,
|
|
1915
2204
|
},
|
|
1916
2205
|
provideTranslocoScope('haloduck'),
|
|
1917
|
-
], viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"draw-canvas-container flex flex-col gap-2\">\n <canvas #canvas width=\"800\" height=\"400\" class=\"max-w-full draw-canvas select-none\"></canvas>\n <haloduck-button variant=\"danger\" (click)=\"onReset()\">{{
|
|
2206
|
+
], viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"draw-canvas-container flex flex-col gap-2\">\n <canvas #canvas width=\"800\" height=\"400\" class=\"max-w-full draw-canvas select-none\"></canvas>\n <haloduck-button variant=\"danger\" (click)=\"onReset()\">{{\n 'haloduck.ui.draw.Clear' | transloco\n }}</haloduck-button>\n</div>\n", styles: [".draw-canvas-container{display:flex;flex-direction:column;align-items:center}.draw-canvas{border:1px solid #ccc;cursor:crosshair}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "haloduck-button", inputs: ["disabled", "variant"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
1918
2207
|
}
|
|
1919
2208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DrawCanvasComponent, decorators: [{
|
|
1920
2209
|
type: Component,
|
|
@@ -1925,7 +2214,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
1925
2214
|
multi: true,
|
|
1926
2215
|
},
|
|
1927
2216
|
provideTranslocoScope('haloduck'),
|
|
1928
|
-
], imports: [ButtonComponent, TranslocoModule], template: "<div class=\"draw-canvas-container flex flex-col gap-2\">\n <canvas #canvas width=\"800\" height=\"400\" class=\"max-w-full draw-canvas select-none\"></canvas>\n <haloduck-button variant=\"danger\" (click)=\"onReset()\">{{
|
|
2217
|
+
], imports: [ButtonComponent, TranslocoModule], template: "<div class=\"draw-canvas-container flex flex-col gap-2\">\n <canvas #canvas width=\"800\" height=\"400\" class=\"max-w-full draw-canvas select-none\"></canvas>\n <haloduck-button variant=\"danger\" (click)=\"onReset()\">{{\n 'haloduck.ui.draw.Clear' | transloco\n }}</haloduck-button>\n</div>\n", styles: [".draw-canvas-container{display:flex;flex-direction:column;align-items:center}.draw-canvas{border:1px solid #ccc;cursor:crosshair}\n"] }]
|
|
1929
2218
|
}], propDecorators: { imagePath: [{
|
|
1930
2219
|
type: Input
|
|
1931
2220
|
}], lineColor: [{
|
|
@@ -1973,9 +2262,7 @@ class FileUploaderComponent {
|
|
|
1973
2262
|
onFileSelected(event) {
|
|
1974
2263
|
const input = event.target;
|
|
1975
2264
|
if (input.files) {
|
|
1976
|
-
const selectedFiles = this.multiple
|
|
1977
|
-
? Array.from(input.files)
|
|
1978
|
-
: [input.files[0]];
|
|
2265
|
+
const selectedFiles = this.multiple ? Array.from(input.files) : [input.files[0]];
|
|
1979
2266
|
this.addFiles(selectedFiles);
|
|
1980
2267
|
}
|
|
1981
2268
|
this.onTouched();
|
|
@@ -2021,8 +2308,7 @@ class FileUploaderComponent {
|
|
|
2021
2308
|
}
|
|
2022
2309
|
return acceptableFileType && acceptableFileSize;
|
|
2023
2310
|
});
|
|
2024
|
-
if (this.maxCount > 0 &&
|
|
2025
|
-
this.files.length + filteredFiles.length > this.maxCount) {
|
|
2311
|
+
if (this.maxCount > 0 && this.files.length + filteredFiles.length > this.maxCount) {
|
|
2026
2312
|
for (let i = this.maxCount; i < this.files.length + filteredFiles.length; i++) {
|
|
2027
2313
|
notAcceptedFiles.push({
|
|
2028
2314
|
error: ERROR_OVER_COUNT,
|
|
@@ -2103,7 +2389,7 @@ class FileUploaderComponent {
|
|
|
2103
2389
|
multi: true,
|
|
2104
2390
|
},
|
|
2105
2391
|
provideTranslocoScope('haloduck'),
|
|
2106
|
-
], ngImport: i0, template: "<div
|
|
2392
|
+
], ngImport: i0, template: "<div\n class=\"p-4 border border-light-inactive dark:border-dark-inactive rounded-md\"\n [class.drag-over]=\"isDragOver\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n>\n @if (!isUploading) {\n <label\n for=\"file-upload\"\n class=\"flex flex-col items-center justify-center w-full border-2 border-dashed border-light-inactive dark:border-dark-inactive rounded-md cursor-pointer hover:border-light-secondary dark:border-dark-secondary p-4\"\n >\n <span class=\"text-light-inactive dark:text-dark-inactive\">{{\n 'haloduck.ui.file.Drag and drop files here, or click to select files' | transloco\n }}</span>\n <input\n id=\"file-upload\"\n type=\"file\"\n class=\"hidden\"\n [attr.accept]=\"accept ? accept.join(',') : null\"\n [attr.multiple]=\"multiple ? '' : null\"\n (cancel)=\"$event.stopPropagation()\"\n (change)=\"onFileSelected($event)\"\n />\n </label>\n }\n <!-- Display file list -->\n @if (files.length > 0) {\n <ul class=\"mt-4 space-y-2\">\n @for (file of files; track file.name; let i = $index) {\n <li\n class=\"flex items-center justify-between p-2 border border-light-inactive dark:border-dark-inactive rounded-md\"\n >\n <!-- Check if the file is an image -->\n <div class=\"flex items-center space-x-4\">\n @if (file.previewUrl) {\n <img\n [src]=\"file.previewUrl\"\n alt=\"{{ file.name }}\"\n class=\"w-12 h-12 object-cover rounded-md\"\n />\n }\n <span class=\"text-sm text-light-inactive dark:text-dark-inactive\">{{ file.name }}</span>\n </div>\n @if (isUploading) {\n @if (file.isUploaded) {\n <span class=\"text-sm text-light-secondary dark:text-dark-secondary\">{{\n 'haloduck.ui.file.Uploaded' | transloco\n }}</span>\n } @else {\n <span class=\"text-sm text-light-primary dark:text-dark-primary\">{{\n 'haloduck.ui.file.Uploading...' | transloco\n }}</span>\n }\n } @else {\n <button\n type=\"button\"\n class=\"text-light-danger dark:text-dark-danger hover:brightness-125\"\n (click)=\"removeFile(i)\"\n >\n {{ 'haloduck.ui.file.Remove' | transloco }}\n </button>\n }\n </li>\n }\n </ul>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
2107
2393
|
}
|
|
2108
2394
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: FileUploaderComponent, decorators: [{
|
|
2109
2395
|
type: Component,
|
|
@@ -2114,7 +2400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
2114
2400
|
multi: true,
|
|
2115
2401
|
},
|
|
2116
2402
|
provideTranslocoScope('haloduck'),
|
|
2117
|
-
], template: "<div
|
|
2403
|
+
], template: "<div\n class=\"p-4 border border-light-inactive dark:border-dark-inactive rounded-md\"\n [class.drag-over]=\"isDragOver\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n>\n @if (!isUploading) {\n <label\n for=\"file-upload\"\n class=\"flex flex-col items-center justify-center w-full border-2 border-dashed border-light-inactive dark:border-dark-inactive rounded-md cursor-pointer hover:border-light-secondary dark:border-dark-secondary p-4\"\n >\n <span class=\"text-light-inactive dark:text-dark-inactive\">{{\n 'haloduck.ui.file.Drag and drop files here, or click to select files' | transloco\n }}</span>\n <input\n id=\"file-upload\"\n type=\"file\"\n class=\"hidden\"\n [attr.accept]=\"accept ? accept.join(',') : null\"\n [attr.multiple]=\"multiple ? '' : null\"\n (cancel)=\"$event.stopPropagation()\"\n (change)=\"onFileSelected($event)\"\n />\n </label>\n }\n <!-- Display file list -->\n @if (files.length > 0) {\n <ul class=\"mt-4 space-y-2\">\n @for (file of files; track file.name; let i = $index) {\n <li\n class=\"flex items-center justify-between p-2 border border-light-inactive dark:border-dark-inactive rounded-md\"\n >\n <!-- Check if the file is an image -->\n <div class=\"flex items-center space-x-4\">\n @if (file.previewUrl) {\n <img\n [src]=\"file.previewUrl\"\n alt=\"{{ file.name }}\"\n class=\"w-12 h-12 object-cover rounded-md\"\n />\n }\n <span class=\"text-sm text-light-inactive dark:text-dark-inactive\">{{ file.name }}</span>\n </div>\n @if (isUploading) {\n @if (file.isUploaded) {\n <span class=\"text-sm text-light-secondary dark:text-dark-secondary\">{{\n 'haloduck.ui.file.Uploaded' | transloco\n }}</span>\n } @else {\n <span class=\"text-sm text-light-primary dark:text-dark-primary\">{{\n 'haloduck.ui.file.Uploading...' | transloco\n }}</span>\n }\n } @else {\n <button\n type=\"button\"\n class=\"text-light-danger dark:text-dark-danger hover:brightness-125\"\n (click)=\"removeFile(i)\"\n >\n {{ 'haloduck.ui.file.Remove' | transloco }}\n </button>\n }\n </li>\n }\n </ul>\n }\n</div>\n" }]
|
|
2118
2404
|
}], propDecorators: { disabled: [{
|
|
2119
2405
|
type: Input
|
|
2120
2406
|
}], urlPrefix: [{
|
|
@@ -2149,11 +2435,11 @@ class FlipComponent {
|
|
|
2149
2435
|
this._isOpen.set(!this._isOpen());
|
|
2150
2436
|
}
|
|
2151
2437
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: FlipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2152
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: FlipComponent, isStandalone: true, selector: "haloduck-flip", inputs: { title: "title", isOpen: "isOpen" }, ngImport: i0, template: "<div
|
|
2438
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: FlipComponent, isStandalone: true, selector: "haloduck-flip", inputs: { title: "title", isOpen: "isOpen" }, ngImport: i0, template: "<div\n class=\"relative w-full shadow ring-1 ring-light-inactive/50 dark:ring-dark-inactive/80 sm:rounded-lg bg-light-alternative dark:bg-dark-alternative p-2 flex flex-col gap-2\"\n [class.cursor-pointer]=\"!_isOpen()\"\n (click)=\"!_isOpen() && toggle()\"\n>\n <label\n class=\"text-sm text-light-on-alternative dark:text-dark-on-alternative\"\n [class.cursor-pointer]=\"!_isOpen()\"\n >{{ title }}</label\n >\n @if (_isOpen()) {\n <ng-content></ng-content>\n }\n <button\n variant=\"secondary\"\n class=\"absolute rounded-md border border-inactive px-1 py-0.5 top-1 right-1 hover:cursor-pointer bg-light-inactive dark:bg-dark-inactive text-light-on-inactive dark:text-dark-on-inactive\"\n (click)=\"toggle(); $event.stopPropagation()\"\n >\n @if (_isOpen()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18 15l-6-6-6 6\" />\n </svg>\n } @else {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 9l6 6 6-6\" />\n </svg>\n }\n </button>\n</div>\n", styles: [""] });
|
|
2153
2439
|
}
|
|
2154
2440
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: FlipComponent, decorators: [{
|
|
2155
2441
|
type: Component,
|
|
2156
|
-
args: [{ selector: 'haloduck-flip', imports: [], template: "<div
|
|
2442
|
+
args: [{ selector: 'haloduck-flip', imports: [], template: "<div\n class=\"relative w-full shadow ring-1 ring-light-inactive/50 dark:ring-dark-inactive/80 sm:rounded-lg bg-light-alternative dark:bg-dark-alternative p-2 flex flex-col gap-2\"\n [class.cursor-pointer]=\"!_isOpen()\"\n (click)=\"!_isOpen() && toggle()\"\n>\n <label\n class=\"text-sm text-light-on-alternative dark:text-dark-on-alternative\"\n [class.cursor-pointer]=\"!_isOpen()\"\n >{{ title }}</label\n >\n @if (_isOpen()) {\n <ng-content></ng-content>\n }\n <button\n variant=\"secondary\"\n class=\"absolute rounded-md border border-inactive px-1 py-0.5 top-1 right-1 hover:cursor-pointer bg-light-inactive dark:bg-dark-inactive text-light-on-inactive dark:text-dark-on-inactive\"\n (click)=\"toggle(); $event.stopPropagation()\"\n >\n @if (_isOpen()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18 15l-6-6-6 6\" />\n </svg>\n } @else {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 9l6 6 6-6\" />\n </svg>\n }\n </button>\n</div>\n" }]
|
|
2157
2443
|
}], propDecorators: { title: [{
|
|
2158
2444
|
type: Input
|
|
2159
2445
|
}], isOpen: [{
|
|
@@ -2171,11 +2457,11 @@ class ImageViewerComponent {
|
|
|
2171
2457
|
}
|
|
2172
2458
|
}
|
|
2173
2459
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ImageViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2174
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ImageViewerComponent, isStandalone: true, selector: "haloduck-image-viewer", inputs: { context: "context", imageUrl: "imageUrl", imageAlt: "imageAlt" }, ngImport: i0, template: "<img
|
|
2460
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ImageViewerComponent, isStandalone: true, selector: "haloduck-image-viewer", inputs: { context: "context", imageUrl: "imageUrl", imageAlt: "imageAlt" }, ngImport: i0, template: "<img\n class=\"max-w-full max-h-full object-cover cursor-pointer\"\n [src]=\"context?.imageUrl\"\n [alt]=\"context?.imageAlt\"\n (click)=\"onClose()\"\n/>\n", styles: [""] });
|
|
2175
2461
|
}
|
|
2176
2462
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ImageViewerComponent, decorators: [{
|
|
2177
2463
|
type: Component,
|
|
2178
|
-
args: [{ selector: 'haloduck-image-viewer', imports: [], template: "<img
|
|
2464
|
+
args: [{ selector: 'haloduck-image-viewer', imports: [], template: "<img\n class=\"max-w-full max-h-full object-cover cursor-pointer\"\n [src]=\"context?.imageUrl\"\n [alt]=\"context?.imageAlt\"\n (click)=\"onClose()\"\n/>\n" }]
|
|
2179
2465
|
}], propDecorators: { context: [{
|
|
2180
2466
|
type: Input
|
|
2181
2467
|
}], imageUrl: [{
|
|
@@ -2340,7 +2626,7 @@ class ImageUploaderComponent {
|
|
|
2340
2626
|
multi: true,
|
|
2341
2627
|
},
|
|
2342
2628
|
provideTranslocoScope('haloduck'),
|
|
2343
|
-
], ngImport: i0, template: "<div class=\"w-full h-full flex flex-col gap-1\">\n
|
|
2629
|
+
], ngImport: i0, template: "<div class=\"w-full h-full flex flex-col gap-1\">\n <label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n </label>\n <div\n class=\"h-full w-full p-2 border border-light-inactive dark:border-dark-inactive rounded-md\"\n [class.drag-over]=\"isDragOver\"\n (dragstart)=\"onDragStart($event)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n >\n <!-- Show image preview if available -->\n @if (imageUrl) {\n @if (!disabled) {\n <div class=\"relative\">\n <button\n type=\"button\"\n class=\"absolute -top-1 -right-1 bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger rounded-full px-1 text-xs\"\n (click)=\"removeImage()\"\n >\n x\n </button>\n </div>\n }\n <img\n [src]=\"imageUrl\"\n [id]=\"id + '-image'\"\n [alt]=\"alt || ''\"\n class=\"w-full h-full rounded-md aspect-square\"\n [ngClass]=\"{\n 'filter grayscale': disabled,\n }\"\n (click)=\"previewImage(imageUrl)\"\n />\n } @else {\n <!-- Show upload area -->\n <label\n for=\"{{ id + '-input' }}\"\n class=\"flex flex-col items-center justify-center w-full h-full border-2 border-dashed border-light-inactive dark:border-dark-inactive rounded-md\"\n [ngClass]=\"{\n 'cursor-pointer hover:border-light-primary dark:hover:border-dark-primary': !disabled,\n }\"\n >\n @if (backgroundImage) {\n <img\n [src]=\"backgroundImage\"\n [alt]=\"alt || ''\"\n class=\"w-full h-full rounded-md aspect-square\"\n />\n } @else {\n <span class=\"text-light-inactive dark:text-dark-inactive text-sm p-2\">{{\n 'haloduck.ui.file.Drag and drop an image here, or click to select' | transloco\n }}</span>\n }\n\n @if (!disabled) {\n <input\n [id]=\"id + '-input'\"\n type=\"file\"\n class=\"hidden\"\n accept=\"image/*\"\n [multiple]=\"passToSibling\"\n (cancel)=\"$event.stopPropagation()\"\n (change)=\"onFileSelected($event)\"\n />\n }\n </label>\n }\n </div>\n</div>\n", styles: [".drag-over{border-color:#3b82f6}.relative{position:relative}button{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
2344
2630
|
}
|
|
2345
2631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ImageUploaderComponent, decorators: [{
|
|
2346
2632
|
type: Component,
|
|
@@ -2351,7 +2637,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
2351
2637
|
multi: true,
|
|
2352
2638
|
},
|
|
2353
2639
|
provideTranslocoScope('haloduck'),
|
|
2354
|
-
], template: "<div class=\"w-full h-full flex flex-col gap-1\">\n
|
|
2640
|
+
], template: "<div class=\"w-full h-full flex flex-col gap-1\">\n <label class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control\">\n <ng-content></ng-content>\n </label>\n <div\n class=\"h-full w-full p-2 border border-light-inactive dark:border-dark-inactive rounded-md\"\n [class.drag-over]=\"isDragOver\"\n (dragstart)=\"onDragStart($event)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n >\n <!-- Show image preview if available -->\n @if (imageUrl) {\n @if (!disabled) {\n <div class=\"relative\">\n <button\n type=\"button\"\n class=\"absolute -top-1 -right-1 bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger rounded-full px-1 text-xs\"\n (click)=\"removeImage()\"\n >\n x\n </button>\n </div>\n }\n <img\n [src]=\"imageUrl\"\n [id]=\"id + '-image'\"\n [alt]=\"alt || ''\"\n class=\"w-full h-full rounded-md aspect-square\"\n [ngClass]=\"{\n 'filter grayscale': disabled,\n }\"\n (click)=\"previewImage(imageUrl)\"\n />\n } @else {\n <!-- Show upload area -->\n <label\n for=\"{{ id + '-input' }}\"\n class=\"flex flex-col items-center justify-center w-full h-full border-2 border-dashed border-light-inactive dark:border-dark-inactive rounded-md\"\n [ngClass]=\"{\n 'cursor-pointer hover:border-light-primary dark:hover:border-dark-primary': !disabled,\n }\"\n >\n @if (backgroundImage) {\n <img\n [src]=\"backgroundImage\"\n [alt]=\"alt || ''\"\n class=\"w-full h-full rounded-md aspect-square\"\n />\n } @else {\n <span class=\"text-light-inactive dark:text-dark-inactive text-sm p-2\">{{\n 'haloduck.ui.file.Drag and drop an image here, or click to select' | transloco\n }}</span>\n }\n\n @if (!disabled) {\n <input\n [id]=\"id + '-input'\"\n type=\"file\"\n class=\"hidden\"\n accept=\"image/*\"\n [multiple]=\"passToSibling\"\n (cancel)=\"$event.stopPropagation()\"\n (change)=\"onFileSelected($event)\"\n />\n }\n </label>\n }\n </div>\n</div>\n", styles: [".drag-over{border-color:#3b82f6}.relative{position:relative}button{cursor:pointer}\n"] }]
|
|
2355
2641
|
}], propDecorators: { disabled: [{
|
|
2356
2642
|
type: Input
|
|
2357
2643
|
}], id: [{
|
|
@@ -2385,11 +2671,11 @@ class LanguageSelectorOptionComponent {
|
|
|
2385
2671
|
this.languageSelected.emit(language);
|
|
2386
2672
|
}
|
|
2387
2673
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LanguageSelectorOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2388
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: LanguageSelectorOptionComponent, isStandalone: true, selector: "haloduck-language-selector-option", outputs: { languageSelected: "languageSelected" }, providers: [TranslocoService], ngImport: i0, template: "<div
|
|
2674
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: LanguageSelectorOptionComponent, isStandalone: true, selector: "haloduck-language-selector-option", outputs: { languageSelected: "languageSelected" }, providers: [TranslocoService], ngImport: i0, template: "<div\n class=\"right-0 z-10 mt-2.5 origin-top-right rounded-md bg-light-background dark:bg-dark-background py-2 shadow-lg ring-1 ring-light-inactive dark:ring-dark-inactive\"\n role=\"menu\"\n aria-orientation=\"vertical\"\n aria-labelledby=\"user-menu-button\"\n tabindex=\"0\"\n>\n @for (language of translateService.getAvailableLangs(); track language) {\n <a\n href=\"javascript:void(0)\"\n class=\"px-3 py-2 flex items-center flex-nowrap gap-2\"\n role=\"menuitem\"\n tabindex=\"-1\"\n id=\"language-item-{{ language }}\"\n (click)=\"selectLanguage(language)\"\n >\n <img class=\"w-6 h-6\" [src]=\"'i18n/icons/' + language + '.png'\" />\n </a>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
2389
2675
|
}
|
|
2390
2676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LanguageSelectorOptionComponent, decorators: [{
|
|
2391
2677
|
type: Component,
|
|
2392
|
-
args: [{ selector: 'haloduck-language-selector-option', imports: [CommonModule], providers: [TranslocoService], template: "<div
|
|
2678
|
+
args: [{ selector: 'haloduck-language-selector-option', imports: [CommonModule], providers: [TranslocoService], template: "<div\n class=\"right-0 z-10 mt-2.5 origin-top-right rounded-md bg-light-background dark:bg-dark-background py-2 shadow-lg ring-1 ring-light-inactive dark:ring-dark-inactive\"\n role=\"menu\"\n aria-orientation=\"vertical\"\n aria-labelledby=\"user-menu-button\"\n tabindex=\"0\"\n>\n @for (language of translateService.getAvailableLangs(); track language) {\n <a\n href=\"javascript:void(0)\"\n class=\"px-3 py-2 flex items-center flex-nowrap gap-2\"\n role=\"menuitem\"\n tabindex=\"-1\"\n id=\"language-item-{{ language }}\"\n (click)=\"selectLanguage(language)\"\n >\n <img class=\"w-6 h-6\" [src]=\"'i18n/icons/' + language + '.png'\" />\n </a>\n }\n</div>\n" }]
|
|
2393
2679
|
}], propDecorators: { languageSelected: [{
|
|
2394
2680
|
type: Output
|
|
2395
2681
|
}] } });
|
|
@@ -2461,11 +2747,11 @@ class LanguageSelectorComponent {
|
|
|
2461
2747
|
});
|
|
2462
2748
|
}
|
|
2463
2749
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2464
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: LanguageSelectorComponent, isStandalone: true, selector: "haloduck-language-selector", viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }], ngImport: i0, template: "<button
|
|
2750
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: LanguageSelectorComponent, isStandalone: true, selector: "haloduck-language-selector", viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true }], ngImport: i0, template: "<button\n #origin\n type=\"button\"\n (click)=\"showLanguageOptions()\"\n class=\"-m-1.5 flex items-center p-1.5 hover:cursor-pointer\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n>\n <span class=\"max-lg:hidden flex lg:items-center\">\n <img class=\"w-6 h-6\" [src]=\"'i18n/icons/' + language() + '.png'\" />\n </span>\n</button>\n", styles: [""] });
|
|
2465
2751
|
}
|
|
2466
2752
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
|
|
2467
2753
|
type: Component,
|
|
2468
|
-
args: [{ selector: 'haloduck-language-selector', imports: [], template: "<button
|
|
2754
|
+
args: [{ selector: 'haloduck-language-selector', imports: [], template: "<button\n #origin\n type=\"button\"\n (click)=\"showLanguageOptions()\"\n class=\"-m-1.5 flex items-center p-1.5 hover:cursor-pointer\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n>\n <span class=\"max-lg:hidden flex lg:items-center\">\n <img class=\"w-6 h-6\" [src]=\"'i18n/icons/' + language() + '.png'\" />\n </span>\n</button>\n" }]
|
|
2469
2755
|
}], propDecorators: { origin: [{
|
|
2470
2756
|
type: ViewChild,
|
|
2471
2757
|
args: ['origin', { static: false }]
|
|
@@ -2539,8 +2825,7 @@ class MapToAddressComponent {
|
|
|
2539
2825
|
}
|
|
2540
2826
|
initMap() {
|
|
2541
2827
|
if (this.currentLngLat) {
|
|
2542
|
-
isDevMode() &&
|
|
2543
|
-
console.log('Using provided location:', this.currentLngLat);
|
|
2828
|
+
isDevMode() && console.log('Using provided location:', this.currentLngLat);
|
|
2544
2829
|
this.initializeMap(this.currentLngLat);
|
|
2545
2830
|
}
|
|
2546
2831
|
else {
|
|
@@ -2549,16 +2834,14 @@ class MapToAddressComponent {
|
|
|
2549
2834
|
lat: position.coords.latitude,
|
|
2550
2835
|
lng: position.coords.longitude,
|
|
2551
2836
|
};
|
|
2552
|
-
isDevMode() &&
|
|
2553
|
-
console.log('Using current location:', currentLocation);
|
|
2837
|
+
isDevMode() && console.log('Using current location:', currentLocation);
|
|
2554
2838
|
this.initializeMap(currentLocation);
|
|
2555
2839
|
}, (error) => {
|
|
2556
2840
|
if (error.code === error.PERMISSION_DENIED) {
|
|
2557
2841
|
isDevMode() &&
|
|
2558
2842
|
console.log('Location permission denied. Using default location.:', this.defaultLngLat);
|
|
2559
2843
|
}
|
|
2560
|
-
else if (error.code === error.POSITION_UNAVAILABLE ||
|
|
2561
|
-
error.code === error.TIMEOUT) {
|
|
2844
|
+
else if (error.code === error.POSITION_UNAVAILABLE || error.code === error.TIMEOUT) {
|
|
2562
2845
|
isDevMode() &&
|
|
2563
2846
|
console.log('Unable to determine location. Using default location.:', this.defaultLngLat);
|
|
2564
2847
|
}
|
|
@@ -2596,14 +2879,12 @@ class MapToAddressComponent {
|
|
|
2596
2879
|
// Explicitly update marker position
|
|
2597
2880
|
this.marker.position = event.latLng;
|
|
2598
2881
|
this.marker.map = this.map; // Ensure marker is attached to the map
|
|
2599
|
-
isDevMode() &&
|
|
2600
|
-
console.log('Marker position updated to:', event.latLng.toJSON());
|
|
2882
|
+
isDevMode() && console.log('Marker position updated to:', event.latLng.toJSON());
|
|
2601
2883
|
this.getAddress(); // Fetch address immediately after click
|
|
2602
2884
|
this.onTouched(); // Mark as touched
|
|
2603
2885
|
}
|
|
2604
2886
|
else {
|
|
2605
|
-
isDevMode() &&
|
|
2606
|
-
console.error('Failed to update marker position: event.latLng is undefined');
|
|
2887
|
+
isDevMode() && console.error('Failed to update marker position: event.latLng is undefined');
|
|
2607
2888
|
}
|
|
2608
2889
|
}
|
|
2609
2890
|
setMapToAddress() {
|
|
@@ -2701,7 +2982,7 @@ class MapToAddressComponent {
|
|
|
2701
2982
|
useExisting: MapToAddressComponent,
|
|
2702
2983
|
multi: true,
|
|
2703
2984
|
},
|
|
2704
|
-
], ngImport: i0, template: "<div class=\"w-full h-full relative\">\n <!-- \uB85C\uB529 \uC0C1\uD0DC -->\n @if(!isGoogleLoaded && !loadError) {\n
|
|
2985
|
+
], ngImport: i0, template: "<div class=\"w-full h-full relative\">\n <!-- \uB85C\uB529 \uC0C1\uD0DC -->\n @if (!isGoogleLoaded && !loadError) {\n <div class=\"absolute inset-0 flex items-center justify-center bg-gray-100 z-10\">\n <div class=\"text-center\">\n <div\n class=\"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto mb-2\"\n ></div>\n <p class=\"text-gray-600 text-sm\">\uC9C0\uB3C4\uB97C \uB85C\uB529 \uC911\uC785\uB2C8\uB2E4...</p>\n </div>\n </div>\n }\n\n <!-- \uC5D0\uB7EC \uC0C1\uD0DC -->\n @if (loadError) {\n <div class=\"absolute inset-0 flex items-center justify-center bg-red-50 z-10\">\n <div class=\"text-center p-4\">\n <div class=\"text-red-500 text-2xl mb-2\">\u26A0\uFE0F</div>\n <p class=\"text-red-700 text-sm font-medium\">{{ loadError }}</p>\n <p class=\"text-red-600 text-xs mt-1\">\n Please check your internet connection and refresh the page.\n </p>\n </div>\n </div>\n }\n\n <div id=\"map\" class=\"w-full h-full\"></div>\n</div>\n", styles: ["#map{border:1px solid #ccc;margin-bottom:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }] });
|
|
2705
2986
|
}
|
|
2706
2987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MapToAddressComponent, decorators: [{
|
|
2707
2988
|
type: Component,
|
|
@@ -2711,7 +2992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
2711
2992
|
useExisting: MapToAddressComponent,
|
|
2712
2993
|
multi: true,
|
|
2713
2994
|
},
|
|
2714
|
-
], template: "<div class=\"w-full h-full relative\">\n <!-- \uB85C\uB529 \uC0C1\uD0DC -->\n @if(!isGoogleLoaded && !loadError) {\n
|
|
2995
|
+
], template: "<div class=\"w-full h-full relative\">\n <!-- \uB85C\uB529 \uC0C1\uD0DC -->\n @if (!isGoogleLoaded && !loadError) {\n <div class=\"absolute inset-0 flex items-center justify-center bg-gray-100 z-10\">\n <div class=\"text-center\">\n <div\n class=\"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto mb-2\"\n ></div>\n <p class=\"text-gray-600 text-sm\">\uC9C0\uB3C4\uB97C \uB85C\uB529 \uC911\uC785\uB2C8\uB2E4...</p>\n </div>\n </div>\n }\n\n <!-- \uC5D0\uB7EC \uC0C1\uD0DC -->\n @if (loadError) {\n <div class=\"absolute inset-0 flex items-center justify-center bg-red-50 z-10\">\n <div class=\"text-center p-4\">\n <div class=\"text-red-500 text-2xl mb-2\">\u26A0\uFE0F</div>\n <p class=\"text-red-700 text-sm font-medium\">{{ loadError }}</p>\n <p class=\"text-red-600 text-xs mt-1\">\n Please check your internet connection and refresh the page.\n </p>\n </div>\n </div>\n }\n\n <div id=\"map\" class=\"w-full h-full\"></div>\n</div>\n", styles: ["#map{border:1px solid #ccc;margin-bottom:10px}\n"] }]
|
|
2715
2996
|
}], propDecorators: { disabled: [{
|
|
2716
2997
|
type: Input
|
|
2717
2998
|
}], language: [{
|
|
@@ -2737,9 +3018,11 @@ class SideMenuItemComponent {
|
|
|
2737
3018
|
ngOnInit() {
|
|
2738
3019
|
if (this.menuItem.iconType === 'svg') {
|
|
2739
3020
|
fetch(this.menuItem.icon || '')
|
|
2740
|
-
.then(response => {
|
|
2741
|
-
.
|
|
2742
|
-
|
|
3021
|
+
.then((response) => {
|
|
3022
|
+
return response.ok ? response : Promise.reject(response);
|
|
3023
|
+
})
|
|
3024
|
+
.then((response) => response.text())
|
|
3025
|
+
.then((svg) => (this.iconSvg = this.sanitizer.bypassSecurityTrustHtml(svg)));
|
|
2743
3026
|
}
|
|
2744
3027
|
}
|
|
2745
3028
|
onMenuItemSelected(menuItem) {
|
|
@@ -2754,11 +3037,11 @@ class SideMenuItemComponent {
|
|
|
2754
3037
|
this.router.navigate(link);
|
|
2755
3038
|
}
|
|
2756
3039
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SideMenuItemComponent, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
2757
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SideMenuItemComponent, isStandalone: true, selector: "haloduck-side-menu-item", inputs: { menuItem: "menuItem", depth: "depth", menuItemSelectHandler: "menuItemSelectHandler" }, ngImport: i0, template: "<a
|
|
3040
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SideMenuItemComponent, isStandalone: true, selector: "haloduck-side-menu-item", inputs: { menuItem: "menuItem", depth: "depth", menuItemSelectHandler: "menuItemSelectHandler" }, ngImport: i0, template: "<a\n href=\"javascript:void(0)\"\n (click)=\"onMenuItemSelected(menuItem)\"\n class=\"flex items-center gap-2 px-4 py-2 rounded-md cursor-pointer hover:text-light-on-primary dark:hover:text-dark-on-primary hover:bg-light-primary dark:hover:bg-dark-primary hover:cursor-pointer\"\n [ngClass]=\"{\n 'font-bold text-light-on-secondary dark:bg-dark-on-secondary bg-light-secondary dark:bg-dark-secondary':\n menuItem.isSelected,\n }\"\n>\n @if (menuItem.iconType === 'svg') {\n <div [innerHTML]=\"iconSvg\"></div>\n } @else {\n @if (menuItem.icon) {\n <img\n class=\"w-5 h-5\"\n [src]=\"menuItem.icon\"\n [alt]=\"menuItem.title\"\n [title]=\"menuItem.title\"\n [loading]=\"'lazy'\"\n />\n }\n }\n <span\n class=\"overflow-hidden text-ellipsis whitespace-nowrap\"\n title=\"{{ menuItem.title }}\"\n [ngStyle]=\"{ 'margin-left.px': depth ? depth * 16 : 0 }\"\n >\n {{ menuItem.title }}\n </span>\n</a>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
2758
3041
|
}
|
|
2759
3042
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SideMenuItemComponent, decorators: [{
|
|
2760
3043
|
type: Component,
|
|
2761
|
-
args: [{ selector: 'haloduck-side-menu-item', imports: [CommonModule], template: "<a
|
|
3044
|
+
args: [{ selector: 'haloduck-side-menu-item', imports: [CommonModule], template: "<a\n href=\"javascript:void(0)\"\n (click)=\"onMenuItemSelected(menuItem)\"\n class=\"flex items-center gap-2 px-4 py-2 rounded-md cursor-pointer hover:text-light-on-primary dark:hover:text-dark-on-primary hover:bg-light-primary dark:hover:bg-dark-primary hover:cursor-pointer\"\n [ngClass]=\"{\n 'font-bold text-light-on-secondary dark:bg-dark-on-secondary bg-light-secondary dark:bg-dark-secondary':\n menuItem.isSelected,\n }\"\n>\n @if (menuItem.iconType === 'svg') {\n <div [innerHTML]=\"iconSvg\"></div>\n } @else {\n @if (menuItem.icon) {\n <img\n class=\"w-5 h-5\"\n [src]=\"menuItem.icon\"\n [alt]=\"menuItem.title\"\n [title]=\"menuItem.title\"\n [loading]=\"'lazy'\"\n />\n }\n }\n <span\n class=\"overflow-hidden text-ellipsis whitespace-nowrap\"\n title=\"{{ menuItem.title }}\"\n [ngStyle]=\"{ 'margin-left.px': depth ? depth * 16 : 0 }\"\n >\n {{ menuItem.title }}\n </span>\n</a>\n" }]
|
|
2762
3045
|
}], ctorParameters: () => [{ type: i1$3.DomSanitizer }], propDecorators: { menuItem: [{
|
|
2763
3046
|
type: Input
|
|
2764
3047
|
}], depth: [{
|
|
@@ -2772,11 +3055,11 @@ class SideMenuComponent {
|
|
|
2772
3055
|
depth = 0;
|
|
2773
3056
|
menuItemSelected = new EventEmitter();
|
|
2774
3057
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SideMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2775
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SideMenuComponent, isStandalone: true, selector: "haloduck-side-menu", inputs: { menuItems: "menuItems", depth: "depth" }, outputs: { menuItemSelected: "menuItemSelected" }, ngImport: i0, template: "<div class=\"flex flex-col text-sm text-light-on-background dark:text-dark-on-background\">\n @for (menuItem of menuItems; track menuItem.link) {\n
|
|
3058
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SideMenuComponent, isStandalone: true, selector: "haloduck-side-menu", inputs: { menuItems: "menuItems", depth: "depth" }, outputs: { menuItemSelected: "menuItemSelected" }, ngImport: i0, template: "<div class=\"flex flex-col text-sm text-light-on-background dark:text-dark-on-background\">\n @for (menuItem of menuItems; track menuItem.link) {\n <haloduck-side-menu-item\n [menuItemSelectHandler]=\"menuItemSelected\"\n [menuItem]=\"menuItem\"\n [depth]=\"depth\"\n ></haloduck-side-menu-item>\n @if (menuItem.children && menuItem.children.length > 0) {\n <haloduck-side-menu\n [menuItems]=\"menuItem.children\"\n [depth]=\"depth + 1\"\n (menuItemSelected)=\"menuItemSelected.emit($event)\"\n ></haloduck-side-menu>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: SideMenuComponent, selector: "haloduck-side-menu", inputs: ["menuItems", "depth"], outputs: ["menuItemSelected"] }, { kind: "component", type: SideMenuItemComponent, selector: "haloduck-side-menu-item", inputs: ["menuItem", "depth", "menuItemSelectHandler"] }] });
|
|
2776
3059
|
}
|
|
2777
3060
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SideMenuComponent, decorators: [{
|
|
2778
3061
|
type: Component,
|
|
2779
|
-
args: [{ selector: 'haloduck-side-menu', imports: [SideMenuItemComponent], template: "<div class=\"flex flex-col text-sm text-light-on-background dark:text-dark-on-background\">\n @for (menuItem of menuItems; track menuItem.link) {\n
|
|
3062
|
+
args: [{ selector: 'haloduck-side-menu', imports: [SideMenuItemComponent], template: "<div class=\"flex flex-col text-sm text-light-on-background dark:text-dark-on-background\">\n @for (menuItem of menuItems; track menuItem.link) {\n <haloduck-side-menu-item\n [menuItemSelectHandler]=\"menuItemSelected\"\n [menuItem]=\"menuItem\"\n [depth]=\"depth\"\n ></haloduck-side-menu-item>\n @if (menuItem.children && menuItem.children.length > 0) {\n <haloduck-side-menu\n [menuItems]=\"menuItem.children\"\n [depth]=\"depth + 1\"\n (menuItemSelected)=\"menuItemSelected.emit($event)\"\n ></haloduck-side-menu>\n }\n }\n</div>\n" }]
|
|
2780
3063
|
}], propDecorators: { menuItems: [{
|
|
2781
3064
|
type: Input
|
|
2782
3065
|
}], depth: [{
|
|
@@ -2876,11 +3159,11 @@ class StlViewerComponent {
|
|
|
2876
3159
|
}
|
|
2877
3160
|
}
|
|
2878
3161
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: StlViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2879
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: StlViewerComponent, isStandalone: true, selector: "haloduck-stl-viewer", inputs: { fileUrl: "fileUrl", filename: "filename", context: "context" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["viewerContainer"], descendants: true }], ngImport: i0, template: "<div class=\"relative w-full h-full flex flex-col items-end\">\n
|
|
3162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: StlViewerComponent, isStandalone: true, selector: "haloduck-stl-viewer", inputs: { fileUrl: "fileUrl", filename: "filename", context: "context" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["viewerContainer"], descendants: true }], ngImport: i0, template: "<div class=\"relative w-full h-full flex flex-col items-end\">\n <div class=\"w-full h-full flex items-start flex-col\">\n <div #viewerContainer class=\"w-full h-full rounded-md\"></div>\n @if (loadingPercentage < 100) {\n <div\n class=\"h-2 bg-light-primary-light dark:bg-dark-primary-light\"\n [ngStyle]=\"{ width: loadingPercentage + '%' }\"\n ></div>\n }\n </div>\n <div class=\"absolute bottom-2 right-0 flex justify-end gap-2\">\n @if (context) {\n <haloduck-button variant=\"primary\" (click)=\"download()\">{{\n 'haloduck.ui.button.Download' | transloco\n }}</haloduck-button>\n <haloduck-button variant=\"danger\" (click)=\"closeDialog()\">{{\n 'haloduck.ui.button.Close' | transloco\n }}</haloduck-button>\n } @else {\n <haloduck-button variant=\"primary\" (click)=\"download()\">{{\n 'haloduck.ui.button.Download' | transloco\n }}</haloduck-button>\n <haloduck-button variant=\"secondary\" (click)=\"showStl()\">{{\n 'haloduck.ui.button.View' | transloco\n }}</haloduck-button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ButtonComponent, selector: "haloduck-button", inputs: ["disabled", "variant"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
2880
3163
|
}
|
|
2881
3164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: StlViewerComponent, decorators: [{
|
|
2882
3165
|
type: Component,
|
|
2883
|
-
args: [{ selector: 'haloduck-stl-viewer', imports: [CommonModule, ButtonComponent, TranslocoModule], providers: [provideTranslocoScope('haloduck')], template: "<div class=\"relative w-full h-full flex flex-col items-end\">\n
|
|
3166
|
+
args: [{ selector: 'haloduck-stl-viewer', imports: [CommonModule, ButtonComponent, TranslocoModule], providers: [provideTranslocoScope('haloduck')], template: "<div class=\"relative w-full h-full flex flex-col items-end\">\n <div class=\"w-full h-full flex items-start flex-col\">\n <div #viewerContainer class=\"w-full h-full rounded-md\"></div>\n @if (loadingPercentage < 100) {\n <div\n class=\"h-2 bg-light-primary-light dark:bg-dark-primary-light\"\n [ngStyle]=\"{ width: loadingPercentage + '%' }\"\n ></div>\n }\n </div>\n <div class=\"absolute bottom-2 right-0 flex justify-end gap-2\">\n @if (context) {\n <haloduck-button variant=\"primary\" (click)=\"download()\">{{\n 'haloduck.ui.button.Download' | transloco\n }}</haloduck-button>\n <haloduck-button variant=\"danger\" (click)=\"closeDialog()\">{{\n 'haloduck.ui.button.Close' | transloco\n }}</haloduck-button>\n } @else {\n <haloduck-button variant=\"primary\" (click)=\"download()\">{{\n 'haloduck.ui.button.Download' | transloco\n }}</haloduck-button>\n <haloduck-button variant=\"secondary\" (click)=\"showStl()\">{{\n 'haloduck.ui.button.View' | transloco\n }}</haloduck-button>\n }\n </div>\n</div>\n" }]
|
|
2884
3167
|
}], propDecorators: { fileUrl: [{
|
|
2885
3168
|
type: Input
|
|
2886
3169
|
}], filename: [{
|
|
@@ -3014,7 +3297,7 @@ class TableSettingService {
|
|
|
3014
3297
|
Promise.resolve().then(function () { return tableSetting_component; }).then(({ TableSettingComponent }) => {
|
|
3015
3298
|
this.currentOverlayRef = this.dialogService.open(TableSettingComponent, {
|
|
3016
3299
|
tableName,
|
|
3017
|
-
});
|
|
3300
|
+
}, ['w-full', 'max-w-xs']);
|
|
3018
3301
|
});
|
|
3019
3302
|
}
|
|
3020
3303
|
hide() {
|
|
@@ -3097,9 +3380,11 @@ class TableComponent {
|
|
|
3097
3380
|
onLoadMore = new EventEmitter();
|
|
3098
3381
|
onRowClick = new EventEmitter();
|
|
3099
3382
|
onRowDblClick = new EventEmitter();
|
|
3100
|
-
settings$ = this.tableName
|
|
3101
|
-
|
|
3102
|
-
|
|
3383
|
+
settings$ = this.tableName
|
|
3384
|
+
? this.tableSettingService.getSettings(this.tableName).pipe(shareReplay(1))
|
|
3385
|
+
: of({ showHeader: this.defaultShowHeader, autoLoad: this.defaultAutoLoad });
|
|
3386
|
+
showHeader$ = this.settings$.pipe(map((settings) => settings.showHeader));
|
|
3387
|
+
autoLoad$ = this.settings$.pipe(map((settings) => settings.autoLoad));
|
|
3103
3388
|
getColumnValue(row, column) {
|
|
3104
3389
|
const value = this.getColumnValueRaw(row, column);
|
|
3105
3390
|
if (column.customRenderFn) {
|
|
@@ -3201,7 +3486,7 @@ class TableComponent {
|
|
|
3201
3486
|
});
|
|
3202
3487
|
}
|
|
3203
3488
|
onAutoLoadTriggered() {
|
|
3204
|
-
this.autoLoad$.pipe(take(1)).subscribe(autoLoad => {
|
|
3489
|
+
this.autoLoad$.pipe(take(1)).subscribe((autoLoad) => {
|
|
3205
3490
|
if (autoLoad) {
|
|
3206
3491
|
this.lastEvaluatedKey.pipe(take(1)).subscribe((lastEvaluatedKey) => {
|
|
3207
3492
|
this.onLoadMore.emit(lastEvaluatedKey);
|
|
@@ -3218,8 +3503,8 @@ class TableComponent {
|
|
|
3218
3503
|
ngOnInit() {
|
|
3219
3504
|
if (this.tableName) {
|
|
3220
3505
|
this.settings$ = this.tableSettingService.getSettings(this.tableName).pipe(shareReplay(1));
|
|
3221
|
-
this.showHeader$ = this.settings$.pipe(map(settings => settings.showHeader));
|
|
3222
|
-
this.autoLoad$ = this.settings$.pipe(map(settings => settings.autoLoad));
|
|
3506
|
+
this.showHeader$ = this.settings$.pipe(map((settings) => settings.showHeader));
|
|
3507
|
+
this.autoLoad$ = this.settings$.pipe(map((settings) => settings.autoLoad));
|
|
3223
3508
|
}
|
|
3224
3509
|
}
|
|
3225
3510
|
openSettings() {
|
|
@@ -3229,11 +3514,11 @@ class TableComponent {
|
|
|
3229
3514
|
}
|
|
3230
3515
|
ngAfterViewInit() { }
|
|
3231
3516
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3232
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TableComponent, isStandalone: true, selector: "haloduck-table", inputs: { tableLayout: "tableLayout", tableName: "tableName", useLoadMore: "useLoadMore", columns: "columns", rows: "rows", isLoading: "isLoading", isPaging: "isPaging", sort: "sort", expandedTemplate: "expandedTemplate", customTemplates: "customTemplates", lastEvaluatedKey: "lastEvaluatedKey" }, outputs: { onSortChange: "onSortChange", onLoadMore: "onLoadMore", onRowClick: "onRowClick", onRowDblClick: "onRowDblClick" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "loadMoreRowRef", first: true, predicate: ["loadMoreRow"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"w-full h-full shadow border border-light-inactive dark:border-dark-inactive rounded-lg overflow-auto\">\n <table class=\"w-full h-full\"\n [ngClass]=\"{\n 'table-fixed': tableLayout === 'fixed',\n 'table-auto': tableLayout === 'auto',\n }\">\n <colgroup>\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <col class=\"{{ column.width || '' }}\" />\n }\n }\n </colgroup>\n @if (showHeader$ | async) {\n <thead class=\"bg-light-inactive/50 dark:bg-dark-inactive/50 rounded-tl-lg rounded-tr-lg\">\n <tr>\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <th scope=\"col\"\n class=\"{{ column.align || '' }} py-3.5 pl-4 pr-3 text-sm font-semibold text-light-on-background dark:text-dark-on-background whitespace-nowrap\">\n <span class=\"group inline-flex\">\n {{ column.label }}\n @if (column.sortable) {\n @switch (getSortDirection(column.sort?.field || column.key) | async)\n {\n @case('desc') {\n <span (click)=\"onUpdateSort(column.sort?.field || column.key, 'asc')\"\n class=\"ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive\">\n <svg class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\">\n <path fill-rule=\"evenodd\"\n d=\"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\" />\n </svg>\n </span>\n }\n @case('asc') {\n <span (click)=\"onUpdateSort(column.sort?.field || column.key, 'desc')\"\n class=\"ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive\">\n <svg class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\">\n <path fill-rule=\"evenodd\"\n d=\"M14.78 11.78a.75.75 0 0 1-1.06 0L10 8.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06Z\"\n clip-rule=\"evenodd\" />\n </svg>\n </span>\n }\n @default {\n <span (click)=\"onUpdateSort(column.sort?.field || column.key, 'asc')\"\n class=\"invisible ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive group-hover:visible group-focus:visible\">\n <svg class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\">\n <path fill-rule=\"evenodd\"\n d=\"M14.78 11.78a.75.75 0 0 1-1.06 0L10 8.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06Z\"\n clip-rule=\"evenodd\" />\n </svg>\n </span>\n }\n }\n }\n </span>\n </th>\n }\n }\n </tr>\n </thead>\n }\n <tbody class=\"overflow-scroll\">\n @for (row of rows | async; track row['id']; let lastRow = $last) {\n <tr class=\"border-t border-light-inactive dark:border-dark-inactive {{ row.bgColor || '' }}\"\n (click)=\"onRowClicked(row)\"\n (dblclick)=\"onRowDblClicked(row)\"\n [ngClass]=\"{'rounded-b-lg': lastRow && (lastEvaluatedKey | async) === null, 'even:bg-light-alternative dark:even:bg-dark-alternative odd:bg-light-background dark:odd:bg-dark-background': !row.bgColor }\"\n [ngStyle]=\"{ 'background-color': row.bgColor || '' }\">\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <td class=\"relative overflow-visible {{ column.align || '' }} whitespace-nowrap px-3 text-sm text-light-on-background dark:text-dark-on-background\"\n [ngClass]=\"{\n 'first:rounded-bl-lg last:rounded-br-lg': lastRow && (lastEvaluatedKey | async) === null,\n 'text-wrap': row.isExpanded && column.type !== 'custom',\n 'overflow-x-hidden text-ellipsis' : !row.isExpanded && column.type !== 'custom',\n 'py-2': column.type === 'custom',\n 'py-4': column.type !== 'custom'\n }\">\n @if (column.type === 'custom') {\n @if (column.customRenderTemplate) {\n <ng-container [ngTemplateOutlet]=\"customTemplates[column.customRenderTemplate]\"\n [ngTemplateOutletContext]=\"{ $implicit: row, column: column }\"></ng-container>\n }\n }\n @else {\n {{ getColumnValue(row, column) | async }}\n }\n </td>\n }\n }\n </tr>\n\n @if (row.isExpanded && expandedTemplate) {\n <tr>\n <td [attr.colspan]=\"columns.length\">\n </td>\n </tr>\n <tr class=\"even:bg-light-alternative dark:even:bg-dark-alternative odd:bg-light-background dark:odd:bg-dark-background\">\n <td [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 pb-4 text-sm text-center\">\n <ng-container [ngTemplateOutlet]=\"expandedTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n\n @if (lastRow && (lastEvaluatedKey | async) && !(isLoading | async) && useLoadMore) {\n <tr #loadMoreRow\n class=\"border-t border-light-inactive dark:border-dark-inactive bg-light-background dark:bg-dark-background\"\n haloduckAutoLoad\n [autoLoadEnabled]=\"(autoLoad$ | async) ?? true\"\n [autoLoadThreshold]=\"0.1\"\n (autoLoadTrigger)=\"onAutoLoadTriggered()\">\n <td [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 py-4 text-sm text-light-on-background dark:text-dark-on-background text-center h-16 bg-light-background dark:bg-dark-background rounded-bl-lg rounded-br-lg\">\n <div (click)=\"onLoadMoreClicked()\"\n class=\"cursor-pointer\">\n {{ 'haloduck.ui.table.Load More...' | transloco }}\n </div>\n </td>\n </tr>\n }\n\n } @empty {\n @if(!(isLoading | async)) {\n <tr>\n <td [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 py-4 text-sm text-light-on-background dark:text-dark-on-background text-center h-16 bg-light-background dark:bg-dark-background rounded-bl-lg rounded-br-lg\">\n {{ 'haloduck.ui.table.No data available.' | transloco }}\n </td>\n </tr>\n }\n }\n\n @if(isLoading | async) {\n @for ( i of [0,1,2,3,4]; track i; let lastRow = $last)\n {\n <tr class=\"bg-light-background dark:bg-dark-background border-t border-light-inactive/50 dark:border-dark-inactive/50\">\n @for (column of columns; track column.key) {\n <td class=\"whitespace-nowrap py-4 pl-4 pr-3 text-sm\"\n [ngClass]=\"{'first:rounded-bl-lg last:rounded-br-lg': lastRow}\">\n <div class=\"h-4 bg-light-inactive/50 dark:bg-dark-inactive/50 rounded-md animate-pulse\"></div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: AutoLoadDirective, selector: "[haloduckAutoLoad]", inputs: ["autoLoadEnabled", "autoLoadThreshold", "autoLoadRootMargin"], outputs: ["autoLoadTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3517
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TableComponent, isStandalone: true, selector: "haloduck-table", inputs: { tableLayout: "tableLayout", tableName: "tableName", useLoadMore: "useLoadMore", columns: "columns", rows: "rows", isLoading: "isLoading", isPaging: "isPaging", sort: "sort", expandedTemplate: "expandedTemplate", customTemplates: "customTemplates", lastEvaluatedKey: "lastEvaluatedKey" }, outputs: { onSortChange: "onSortChange", onLoadMore: "onLoadMore", onRowClick: "onRowClick", onRowDblClick: "onRowDblClick" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "loadMoreRowRef", first: true, predicate: ["loadMoreRow"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n class=\"w-full h-full shadow border border-light-inactive dark:border-dark-inactive rounded-lg overflow-auto\"\n>\n <table\n class=\"w-full h-full\"\n [ngClass]=\"{\n 'table-fixed': tableLayout === 'fixed',\n 'table-auto': tableLayout === 'auto',\n }\"\n >\n <colgroup>\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <col class=\"{{ column.width || '' }}\" />\n }\n }\n </colgroup>\n @if (showHeader$ | async) {\n <thead class=\"bg-light-inactive/50 dark:bg-dark-inactive/50 rounded-tl-lg rounded-tr-lg\">\n <tr>\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <th\n scope=\"col\"\n class=\"{{\n column.align || ''\n }} py-3.5 pl-4 pr-3 text-sm font-semibold text-light-on-background dark:text-dark-on-background whitespace-nowrap\"\n >\n <span class=\"group inline-flex\">\n {{ column.label }}\n @if (column.sortable) {\n @switch (getSortDirection(column.sort?.field || column.key) | async) {\n @case ('desc') {\n <span\n (click)=\"onUpdateSort(column.sort?.field || column.key, 'asc')\"\n class=\"ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </span>\n }\n @case ('asc') {\n <span\n (click)=\"onUpdateSort(column.sort?.field || column.key, 'desc')\"\n class=\"ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M14.78 11.78a.75.75 0 0 1-1.06 0L10 8.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </span>\n }\n @default {\n <span\n (click)=\"onUpdateSort(column.sort?.field || column.key, 'asc')\"\n class=\"invisible ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive group-hover:visible group-focus:visible\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M14.78 11.78a.75.75 0 0 1-1.06 0L10 8.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </span>\n }\n }\n }\n </span>\n </th>\n }\n }\n </tr>\n </thead>\n }\n <tbody class=\"overflow-scroll\">\n @for (row of rows | async; track row['id']; let lastRow = $last) {\n <tr\n class=\"border-t border-light-inactive dark:border-dark-inactive {{ row.bgColor || '' }}\"\n (click)=\"onRowClicked(row)\"\n (dblclick)=\"onRowDblClicked(row)\"\n [ngClass]=\"{\n 'rounded-b-lg': lastRow && (lastEvaluatedKey | async) === null,\n 'even:bg-light-alternative dark:even:bg-dark-alternative odd:bg-light-background dark:odd:bg-dark-background':\n !row.bgColor,\n }\"\n [ngStyle]=\"{ 'background-color': row.bgColor || '' }\"\n >\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <td\n class=\"relative overflow-visible {{\n column.align || ''\n }} whitespace-nowrap px-3 text-sm text-light-on-background dark:text-dark-on-background\"\n [ngClass]=\"{\n 'first:rounded-bl-lg last:rounded-br-lg':\n lastRow && (lastEvaluatedKey | async) === null,\n 'text-wrap': row.isExpanded && column.type !== 'custom',\n 'overflow-x-hidden text-ellipsis': !row.isExpanded && column.type !== 'custom',\n 'py-2': column.type === 'custom',\n 'py-4': column.type !== 'custom',\n }\"\n >\n @if (column.type === 'custom') {\n @if (column.customRenderTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"customTemplates[column.customRenderTemplate]\"\n [ngTemplateOutletContext]=\"{ $implicit: row, column: column }\"\n ></ng-container>\n }\n } @else {\n {{ getColumnValue(row, column) | async }}\n }\n </td>\n }\n }\n </tr>\n\n @if (row.isExpanded && expandedTemplate) {\n <tr>\n <td [attr.colspan]=\"columns.length\"></td>\n </tr>\n <tr\n class=\"even:bg-light-alternative dark:even:bg-dark-alternative odd:bg-light-background dark:odd:bg-dark-background\"\n >\n <td\n [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 pb-4 text-sm text-center\"\n >\n <ng-container\n [ngTemplateOutlet]=\"expandedTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n ></ng-container>\n </td>\n </tr>\n }\n\n @if (lastRow && (lastEvaluatedKey | async) && !(isLoading | async) && useLoadMore) {\n <tr\n #loadMoreRow\n class=\"border-t border-light-inactive dark:border-dark-inactive bg-light-background dark:bg-dark-background\"\n haloduckAutoLoad\n [autoLoadEnabled]=\"(autoLoad$ | async) ?? true\"\n [autoLoadThreshold]=\"0.1\"\n (autoLoadTrigger)=\"onAutoLoadTriggered()\"\n >\n <td\n [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 py-4 text-sm text-light-on-background dark:text-dark-on-background text-center h-16 bg-light-background dark:bg-dark-background rounded-bl-lg rounded-br-lg\"\n >\n <div (click)=\"onLoadMoreClicked()\" class=\"cursor-pointer\">\n {{ 'haloduck.ui.table.Load More...' | transloco }}\n </div>\n </td>\n </tr>\n }\n } @empty {\n @if (!(isLoading | async)) {\n <tr>\n <td\n [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 py-4 text-sm text-light-on-background dark:text-dark-on-background text-center h-16 bg-light-background dark:bg-dark-background rounded-bl-lg rounded-br-lg\"\n >\n {{ 'haloduck.ui.table.No data available.' | transloco }}\n </td>\n </tr>\n }\n }\n\n @if (isLoading | async) {\n @for (i of [0, 1, 2, 3, 4]; track i; let lastRow = $last) {\n <tr\n class=\"bg-light-background dark:bg-dark-background border-t border-light-inactive/50 dark:border-dark-inactive/50\"\n >\n @for (column of columns; track column.key) {\n <td\n class=\"whitespace-nowrap py-4 pl-4 pr-3 text-sm\"\n [ngClass]=\"{ 'first:rounded-bl-lg last:rounded-br-lg': lastRow }\"\n >\n <div\n class=\"h-4 bg-light-inactive/50 dark:bg-dark-inactive/50 rounded-md animate-pulse\"\n ></div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: AutoLoadDirective, selector: "[haloduckAutoLoad]", inputs: ["autoLoadEnabled", "autoLoadThreshold", "autoLoadRootMargin"], outputs: ["autoLoadTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3233
3518
|
}
|
|
3234
3519
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TableComponent, decorators: [{
|
|
3235
3520
|
type: Component,
|
|
3236
|
-
args: [{ selector: 'haloduck-table', imports: [CommonModule, TranslocoModule, AutoLoadDirective], providers: [provideTranslocoScope('haloduck')], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div
|
|
3521
|
+
args: [{ selector: 'haloduck-table', imports: [CommonModule, TranslocoModule, AutoLoadDirective], providers: [provideTranslocoScope('haloduck')], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"w-full h-full shadow border border-light-inactive dark:border-dark-inactive rounded-lg overflow-auto\"\n>\n <table\n class=\"w-full h-full\"\n [ngClass]=\"{\n 'table-fixed': tableLayout === 'fixed',\n 'table-auto': tableLayout === 'auto',\n }\"\n >\n <colgroup>\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <col class=\"{{ column.width || '' }}\" />\n }\n }\n </colgroup>\n @if (showHeader$ | async) {\n <thead class=\"bg-light-inactive/50 dark:bg-dark-inactive/50 rounded-tl-lg rounded-tr-lg\">\n <tr>\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <th\n scope=\"col\"\n class=\"{{\n column.align || ''\n }} py-3.5 pl-4 pr-3 text-sm font-semibold text-light-on-background dark:text-dark-on-background whitespace-nowrap\"\n >\n <span class=\"group inline-flex\">\n {{ column.label }}\n @if (column.sortable) {\n @switch (getSortDirection(column.sort?.field || column.key) | async) {\n @case ('desc') {\n <span\n (click)=\"onUpdateSort(column.sort?.field || column.key, 'asc')\"\n class=\"ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </span>\n }\n @case ('asc') {\n <span\n (click)=\"onUpdateSort(column.sort?.field || column.key, 'desc')\"\n class=\"ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M14.78 11.78a.75.75 0 0 1-1.06 0L10 8.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </span>\n }\n @default {\n <span\n (click)=\"onUpdateSort(column.sort?.field || column.key, 'asc')\"\n class=\"invisible ml-2 flex-none rounded text-light-on-inactive dark:text-dark-on-inactive group-hover:visible group-focus:visible\"\n >\n <svg\n class=\"size-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M14.78 11.78a.75.75 0 0 1-1.06 0L10 8.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </span>\n }\n }\n }\n </span>\n </th>\n }\n }\n </tr>\n </thead>\n }\n <tbody class=\"overflow-scroll\">\n @for (row of rows | async; track row['id']; let lastRow = $last) {\n <tr\n class=\"border-t border-light-inactive dark:border-dark-inactive {{ row.bgColor || '' }}\"\n (click)=\"onRowClicked(row)\"\n (dblclick)=\"onRowDblClicked(row)\"\n [ngClass]=\"{\n 'rounded-b-lg': lastRow && (lastEvaluatedKey | async) === null,\n 'even:bg-light-alternative dark:even:bg-dark-alternative odd:bg-light-background dark:odd:bg-dark-background':\n !row.bgColor,\n }\"\n [ngStyle]=\"{ 'background-color': row.bgColor || '' }\"\n >\n @for (column of columns; track column.key) {\n @if (!column.hidden || !(column.hidden | async)) {\n <td\n class=\"relative overflow-visible {{\n column.align || ''\n }} whitespace-nowrap px-3 text-sm text-light-on-background dark:text-dark-on-background\"\n [ngClass]=\"{\n 'first:rounded-bl-lg last:rounded-br-lg':\n lastRow && (lastEvaluatedKey | async) === null,\n 'text-wrap': row.isExpanded && column.type !== 'custom',\n 'overflow-x-hidden text-ellipsis': !row.isExpanded && column.type !== 'custom',\n 'py-2': column.type === 'custom',\n 'py-4': column.type !== 'custom',\n }\"\n >\n @if (column.type === 'custom') {\n @if (column.customRenderTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"customTemplates[column.customRenderTemplate]\"\n [ngTemplateOutletContext]=\"{ $implicit: row, column: column }\"\n ></ng-container>\n }\n } @else {\n {{ getColumnValue(row, column) | async }}\n }\n </td>\n }\n }\n </tr>\n\n @if (row.isExpanded && expandedTemplate) {\n <tr>\n <td [attr.colspan]=\"columns.length\"></td>\n </tr>\n <tr\n class=\"even:bg-light-alternative dark:even:bg-dark-alternative odd:bg-light-background dark:odd:bg-dark-background\"\n >\n <td\n [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 pb-4 text-sm text-center\"\n >\n <ng-container\n [ngTemplateOutlet]=\"expandedTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n ></ng-container>\n </td>\n </tr>\n }\n\n @if (lastRow && (lastEvaluatedKey | async) && !(isLoading | async) && useLoadMore) {\n <tr\n #loadMoreRow\n class=\"border-t border-light-inactive dark:border-dark-inactive bg-light-background dark:bg-dark-background\"\n haloduckAutoLoad\n [autoLoadEnabled]=\"(autoLoad$ | async) ?? true\"\n [autoLoadThreshold]=\"0.1\"\n (autoLoadTrigger)=\"onAutoLoadTriggered()\"\n >\n <td\n [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 py-4 text-sm text-light-on-background dark:text-dark-on-background text-center h-16 bg-light-background dark:bg-dark-background rounded-bl-lg rounded-br-lg\"\n >\n <div (click)=\"onLoadMoreClicked()\" class=\"cursor-pointer\">\n {{ 'haloduck.ui.table.Load More...' | transloco }}\n </div>\n </td>\n </tr>\n }\n } @empty {\n @if (!(isLoading | async)) {\n <tr>\n <td\n [attr.colspan]=\"columns.length\"\n class=\"whitespace-nowrap px-3 py-4 text-sm text-light-on-background dark:text-dark-on-background text-center h-16 bg-light-background dark:bg-dark-background rounded-bl-lg rounded-br-lg\"\n >\n {{ 'haloduck.ui.table.No data available.' | transloco }}\n </td>\n </tr>\n }\n }\n\n @if (isLoading | async) {\n @for (i of [0, 1, 2, 3, 4]; track i; let lastRow = $last) {\n <tr\n class=\"bg-light-background dark:bg-dark-background border-t border-light-inactive/50 dark:border-dark-inactive/50\"\n >\n @for (column of columns; track column.key) {\n <td\n class=\"whitespace-nowrap py-4 pl-4 pr-3 text-sm\"\n [ngClass]=\"{ 'first:rounded-bl-lg last:rounded-br-lg': lastRow }\"\n >\n <div\n class=\"h-4 bg-light-inactive/50 dark:bg-dark-inactive/50 rounded-md animate-pulse\"\n ></div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n" }]
|
|
3237
3522
|
}], propDecorators: { loadMoreRowRef: [{
|
|
3238
3523
|
type: ViewChild,
|
|
3239
3524
|
args: ['loadMoreRow', { read: ElementRef }]
|
|
@@ -3317,7 +3602,7 @@ class ToggleComponent {
|
|
|
3317
3602
|
useExisting: forwardRef(() => ToggleComponent),
|
|
3318
3603
|
multi: true,
|
|
3319
3604
|
},
|
|
3320
|
-
], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }], ngImport: i0, template: "<div
|
|
3605
|
+
], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }], ngImport: i0, template: "<div\n class=\"flex gap-2\"\n [ngClass]=\"{\n 'items-center justify-start': 'horizontal' === layout,\n 'flex-col items-start justify-center ': 'vertical' === layout,\n }\"\n>\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n <button\n class=\"w-12 p-1 rounded-l-full rounded-r-full outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-light-primary dark:foucs:outline-dark-primary bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/60 flex hover:cursor-pointer\"\n (click)=\"onToggle()\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'justify-end': true === value,\n 'justify-center': null === value,\n 'justify-start': false === value,\n }\"\n >\n <div\n class=\"shrink-0 h-[1.5rem] rounded-l-full rounded-r-full\"\n [ngClass]=\"{\n 'bg-light-primary dark:bg-dark-primary disabled:bg-light-primary/60 dark:disabled:bg-dark-primary/60':\n true === value,\n 'bg-light-inactive dark:bg-dark-inactive disabled:bg-light-inactive/60 dark:disabled:bg-dark-inactive/60':\n false === value,\n 'w-[1.5rem]': true === value || false === value,\n 'bg-light-primary-light dark:bg-dark-primary-light disabled:bg-light-primary-light/60 dark:disabled:bg-dark-primary-light/60 w-[2.4rem]':\n null === value,\n }\"\n ></div>\n </button>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
3321
3606
|
}
|
|
3322
3607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
3323
3608
|
type: Component,
|
|
@@ -3327,7 +3612,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
3327
3612
|
useExisting: forwardRef(() => ToggleComponent),
|
|
3328
3613
|
multi: true,
|
|
3329
3614
|
},
|
|
3330
|
-
], template: "<div
|
|
3615
|
+
], template: "<div\n class=\"flex gap-2\"\n [ngClass]=\"{\n 'items-center justify-start': 'horizontal' === layout,\n 'flex-col items-start justify-center ': 'vertical' === layout,\n }\"\n>\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n <button\n class=\"w-12 p-1 rounded-l-full rounded-r-full outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive focus:outline-2 focus:outline-light-primary dark:foucs:outline-dark-primary bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/60 flex hover:cursor-pointer\"\n (click)=\"onToggle()\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'justify-end': true === value,\n 'justify-center': null === value,\n 'justify-start': false === value,\n }\"\n >\n <div\n class=\"shrink-0 h-[1.5rem] rounded-l-full rounded-r-full\"\n [ngClass]=\"{\n 'bg-light-primary dark:bg-dark-primary disabled:bg-light-primary/60 dark:disabled:bg-dark-primary/60':\n true === value,\n 'bg-light-inactive dark:bg-dark-inactive disabled:bg-light-inactive/60 dark:disabled:bg-dark-inactive/60':\n false === value,\n 'w-[1.5rem]': true === value || false === value,\n 'bg-light-primary-light dark:bg-dark-primary-light disabled:bg-light-primary-light/60 dark:disabled:bg-dark-primary-light/60 w-[2.4rem]':\n null === value,\n }\"\n ></div>\n </button>\n</div>\n" }]
|
|
3331
3616
|
}], propDecorators: { layout: [{
|
|
3332
3617
|
type: Input
|
|
3333
3618
|
}], value: [{
|
|
@@ -3368,38 +3653,34 @@ class TableSettingComponent {
|
|
|
3368
3653
|
}
|
|
3369
3654
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TableSettingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3370
3655
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TableSettingComponent, isStandalone: true, selector: "haloduck-table-setting", inputs: { context: "context" }, providers: [provideTranslocoScope('haloduck')], ngImport: i0, template: `
|
|
3371
|
-
<div class="
|
|
3372
|
-
<
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
{{ 'haloduck.ui.table.settings' | transloco }}
|
|
3377
|
-
</h2>
|
|
3378
|
-
</div>
|
|
3379
|
-
|
|
3380
|
-
@if (currentSettings$ | async; as settings) {
|
|
3381
|
-
<div class="space-y-4">
|
|
3382
|
-
<haloduck-toggle
|
|
3383
|
-
[(ngModel)]="settings.showHeader"
|
|
3384
|
-
(ngModelChange)="onSettingChange(settings)"
|
|
3385
|
-
>
|
|
3386
|
-
{{ 'haloduck.ui.table.Show headers' | transloco }}
|
|
3387
|
-
</haloduck-toggle>
|
|
3656
|
+
<div class="flex justify-between items-center mb-4">
|
|
3657
|
+
<h2 class="text-md font-semibold text-light-on-background dark:text-dark-on-background">
|
|
3658
|
+
{{ 'haloduck.ui.table.settings' | transloco }}
|
|
3659
|
+
</h2>
|
|
3660
|
+
</div>
|
|
3388
3661
|
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3662
|
+
@if (currentSettings$ | async; as settings) {
|
|
3663
|
+
<div class="flex flex-col gap-4 p-4">
|
|
3664
|
+
<haloduck-toggle
|
|
3665
|
+
[(ngModel)]="settings.showHeader"
|
|
3666
|
+
(ngModelChange)="onSettingChange(settings)"
|
|
3667
|
+
>
|
|
3668
|
+
{{ 'haloduck.ui.table.Show headers' | transloco }}
|
|
3669
|
+
</haloduck-toggle>
|
|
3397
3670
|
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3671
|
+
<haloduck-toggle
|
|
3672
|
+
[(ngModel)]="settings.autoLoad"
|
|
3673
|
+
(ngModelChange)="onSettingChange(settings)"
|
|
3674
|
+
>
|
|
3675
|
+
{{ 'haloduck.ui.table.Auto load' | transloco }}
|
|
3676
|
+
</haloduck-toggle>
|
|
3402
3677
|
</div>
|
|
3678
|
+
}
|
|
3679
|
+
|
|
3680
|
+
<div class="flex justify-end mt-6">
|
|
3681
|
+
<haloduck-button variant="none" size="sm" (click)="close()">
|
|
3682
|
+
{{ 'haloduck.ui.button.Close' | transloco }}
|
|
3683
|
+
</haloduck-button>
|
|
3403
3684
|
</div>
|
|
3404
3685
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslocoModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ButtonComponent, selector: "haloduck-button", inputs: ["disabled", "variant"] }, { kind: "component", type: ToggleComponent, selector: "haloduck-toggle", inputs: ["layout", "value", "disabled", "nullable"], outputs: ["toggled"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3405
3686
|
}
|
|
@@ -3407,46 +3688,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
3407
3688
|
type: Component,
|
|
3408
3689
|
args: [{
|
|
3409
3690
|
selector: 'haloduck-table-setting',
|
|
3410
|
-
imports: [
|
|
3411
|
-
CommonModule,
|
|
3412
|
-
TranslocoModule,
|
|
3413
|
-
FormsModule,
|
|
3414
|
-
ButtonComponent,
|
|
3415
|
-
ToggleComponent,
|
|
3416
|
-
],
|
|
3691
|
+
imports: [CommonModule, TranslocoModule, FormsModule, ButtonComponent, ToggleComponent],
|
|
3417
3692
|
template: `
|
|
3418
|
-
<div class="
|
|
3419
|
-
<
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
{{ 'haloduck.ui.table.settings' | transloco }}
|
|
3424
|
-
</h2>
|
|
3425
|
-
</div>
|
|
3426
|
-
|
|
3427
|
-
@if (currentSettings$ | async; as settings) {
|
|
3428
|
-
<div class="space-y-4">
|
|
3429
|
-
<haloduck-toggle
|
|
3430
|
-
[(ngModel)]="settings.showHeader"
|
|
3431
|
-
(ngModelChange)="onSettingChange(settings)"
|
|
3432
|
-
>
|
|
3433
|
-
{{ 'haloduck.ui.table.Show headers' | transloco }}
|
|
3434
|
-
</haloduck-toggle>
|
|
3693
|
+
<div class="flex justify-between items-center mb-4">
|
|
3694
|
+
<h2 class="text-md font-semibold text-light-on-background dark:text-dark-on-background">
|
|
3695
|
+
{{ 'haloduck.ui.table.settings' | transloco }}
|
|
3696
|
+
</h2>
|
|
3697
|
+
</div>
|
|
3435
3698
|
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3699
|
+
@if (currentSettings$ | async; as settings) {
|
|
3700
|
+
<div class="flex flex-col gap-4 p-4">
|
|
3701
|
+
<haloduck-toggle
|
|
3702
|
+
[(ngModel)]="settings.showHeader"
|
|
3703
|
+
(ngModelChange)="onSettingChange(settings)"
|
|
3704
|
+
>
|
|
3705
|
+
{{ 'haloduck.ui.table.Show headers' | transloco }}
|
|
3706
|
+
</haloduck-toggle>
|
|
3444
3707
|
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3708
|
+
<haloduck-toggle
|
|
3709
|
+
[(ngModel)]="settings.autoLoad"
|
|
3710
|
+
(ngModelChange)="onSettingChange(settings)"
|
|
3711
|
+
>
|
|
3712
|
+
{{ 'haloduck.ui.table.Auto load' | transloco }}
|
|
3713
|
+
</haloduck-toggle>
|
|
3449
3714
|
</div>
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
<div class="flex justify-end mt-6">
|
|
3718
|
+
<haloduck-button variant="none" size="sm" (click)="close()">
|
|
3719
|
+
{{ 'haloduck.ui.button.Close' | transloco }}
|
|
3720
|
+
</haloduck-button>
|
|
3450
3721
|
</div>
|
|
3451
3722
|
`,
|
|
3452
3723
|
providers: [provideTranslocoScope('haloduck')],
|
|
@@ -3508,11 +3779,11 @@ class TabsComponent {
|
|
|
3508
3779
|
this.selectedIndex = this.tabs.length - 1;
|
|
3509
3780
|
}
|
|
3510
3781
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3511
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TabsComponent, isStandalone: true, selector: "haloduck-tabs", inputs: { tabs: "tabs", selectedIndex: "selectedIndex", layout: "layout", labelWidth: "labelWidth" }, outputs: { selectedIndexChange: "selectedIndexChange" }, viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex gap-2 items-start w-full\"
|
|
3782
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TabsComponent, isStandalone: true, selector: "haloduck-tabs", inputs: { tabs: "tabs", selectedIndex: "selectedIndex", layout: "layout", labelWidth: "labelWidth" }, outputs: { selectedIndexChange: "selectedIndexChange" }, viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex gap-2 items-start w-full\" [ngClass]=\"{ 'flex-col': layout === 'vertical' }\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control {{\n labelWidth\n }}\"\n [ngClass]=\"{ 'w-full': layout === 'vertical' }\"\n >\n <ng-content select=\"[slot=label]\"></ng-content>\n </label>\n\n <div class=\"flex-1 w-full\">\n <div\n class=\"flex items-center gap-1 border-b border-light-inactive dark:border-dark-inactive text-sm/6\"\n >\n @for (tab of tabs; track tab.label; let i = $index) {\n <button\n type=\"button\"\n class=\"px-3 py-2 rounded-t-md\"\n [ngClass]=\"{\n 'text-light-on-control dark:text-dark-on-control': i !== selectedIndex,\n 'text-light-primary dark:text-dark-primary border-b-2 border-light-primary dark:border-dark-primary':\n i === selectedIndex,\n }\"\n (click)=\"select(i)\"\n >\n {{ tab.label }}\n </button>\n }\n </div>\n\n <div class=\"mt-3\">\n @if (current) {\n <ng-container\n *ngComponentOutlet=\"current!.component; inputs: current!.inputs || {}\"\n ></ng-container>\n }\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }] });
|
|
3512
3783
|
}
|
|
3513
3784
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TabsComponent, decorators: [{
|
|
3514
3785
|
type: Component,
|
|
3515
|
-
args: [{ selector: 'haloduck-tabs', imports: [CommonModule], template: "<div class=\"flex gap-2 items-start w-full\"
|
|
3786
|
+
args: [{ selector: 'haloduck-tabs', imports: [CommonModule], template: "<div class=\"flex gap-2 items-start w-full\" [ngClass]=\"{ 'flex-col': layout === 'vertical' }\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control {{\n labelWidth\n }}\"\n [ngClass]=\"{ 'w-full': layout === 'vertical' }\"\n >\n <ng-content select=\"[slot=label]\"></ng-content>\n </label>\n\n <div class=\"flex-1 w-full\">\n <div\n class=\"flex items-center gap-1 border-b border-light-inactive dark:border-dark-inactive text-sm/6\"\n >\n @for (tab of tabs; track tab.label; let i = $index) {\n <button\n type=\"button\"\n class=\"px-3 py-2 rounded-t-md\"\n [ngClass]=\"{\n 'text-light-on-control dark:text-dark-on-control': i !== selectedIndex,\n 'text-light-primary dark:text-dark-primary border-b-2 border-light-primary dark:border-dark-primary':\n i === selectedIndex,\n }\"\n (click)=\"select(i)\"\n >\n {{ tab.label }}\n </button>\n }\n </div>\n\n <div class=\"mt-3\">\n @if (current) {\n <ng-container\n *ngComponentOutlet=\"current!.component; inputs: current!.inputs || {}\"\n ></ng-container>\n }\n </div>\n </div>\n</div>\n" }]
|
|
3516
3787
|
}], propDecorators: { tabs: [{
|
|
3517
3788
|
type: Input
|
|
3518
3789
|
}], selectedIndex: [{
|
|
@@ -3537,9 +3808,7 @@ class TagInputComponent {
|
|
|
3537
3808
|
// Two-way binding support independent of CVA
|
|
3538
3809
|
set value(tags) {
|
|
3539
3810
|
if (Array.isArray(tags)) {
|
|
3540
|
-
this.tags = tags
|
|
3541
|
-
.map((t) => (t ?? '').trim())
|
|
3542
|
-
.filter((t) => t.length > 0);
|
|
3811
|
+
this.tags = tags.map((t) => (t ?? '').trim()).filter((t) => t.length > 0);
|
|
3543
3812
|
}
|
|
3544
3813
|
else {
|
|
3545
3814
|
this.tags = [];
|
|
@@ -3552,9 +3821,7 @@ class TagInputComponent {
|
|
|
3552
3821
|
onTouched = () => { };
|
|
3553
3822
|
writeValue(value) {
|
|
3554
3823
|
if (Array.isArray(value)) {
|
|
3555
|
-
this.tags = value
|
|
3556
|
-
.map((t) => (t ?? '').trim())
|
|
3557
|
-
.filter((t) => t.length > 0);
|
|
3824
|
+
this.tags = value.map((t) => (t ?? '').trim()).filter((t) => t.length > 0);
|
|
3558
3825
|
}
|
|
3559
3826
|
else {
|
|
3560
3827
|
this.tags = [];
|
|
@@ -3628,7 +3895,10 @@ class TagInputComponent {
|
|
|
3628
3895
|
return;
|
|
3629
3896
|
}
|
|
3630
3897
|
// If user pasted multiple comma-separated values, split and add all
|
|
3631
|
-
const parts = raw
|
|
3898
|
+
const parts = raw
|
|
3899
|
+
.split(',')
|
|
3900
|
+
.map((p) => p.trim())
|
|
3901
|
+
.filter((p) => p.length > 0);
|
|
3632
3902
|
for (const part of parts) {
|
|
3633
3903
|
this.addTag(part);
|
|
3634
3904
|
}
|
|
@@ -3645,9 +3915,7 @@ class TagInputComponent {
|
|
|
3645
3915
|
this.emitChanges();
|
|
3646
3916
|
}
|
|
3647
3917
|
emitChanges() {
|
|
3648
|
-
const cleaned = this.tags
|
|
3649
|
-
.map((t) => (t ?? '').trim())
|
|
3650
|
-
.filter((t) => t.length > 0);
|
|
3918
|
+
const cleaned = this.tags.map((t) => (t ?? '').trim()).filter((t) => t.length > 0);
|
|
3651
3919
|
if (cleaned.length !== this.tags.length || cleaned.some((t, i) => t !== this.tags[i])) {
|
|
3652
3920
|
this.tags = cleaned;
|
|
3653
3921
|
}
|
|
@@ -3662,7 +3930,7 @@ class TagInputComponent {
|
|
|
3662
3930
|
multi: true,
|
|
3663
3931
|
},
|
|
3664
3932
|
provideTranslocoScope('haloduck'),
|
|
3665
|
-
], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n <label
|
|
3933
|
+
], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n\n <div\n class=\"tag-input-wrapper block w-full rounded-md bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/80 px-2 py-1.5 text-base text-light-on-control dark:text-dark-on-control disabled:cursor-not-allowed disabled:text-light-on-control/60 dark:disabled:text-dark-on-control/80 outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive sm:text-sm/6\"\n >\n <div class=\"flex flex-wrap items-center gap-2\">\n @for (tag of tags; track tag; let i = $index) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary px-2 py-0.5 text-xs\"\n >\n {{ tag }}\n @if (!disabled) {\n <button\n type=\"button\"\n (click)=\"removeTag(i)\"\n class=\"text-light-on-secondary/80 hover:text-light-on-secondary dark:text-dark-on-secondary/80 dark:hover:text-dark-on-secondary hover:cursor-pointer\"\n >\n \u00D7\n </button>\n }\n </span>\n }\n\n <input\n #inputEl\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n class=\"flex-1 min-w-[8rem] bg-transparent outline-none placeholder:text-light-inactive dark:placeholder:text-dark-inactive\"\n [value]=\"inputValue\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.tag-input-wrapper:focus-within{outline-width:2px;outline-offset:2px;outline-color:var(--color-light-primary)!important}@media (prefers-color-scheme: dark){.tag-input-wrapper:focus-within{outline-color:var(--color-dark-primary)!important}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
3666
3934
|
}
|
|
3667
3935
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TagInputComponent, decorators: [{
|
|
3668
3936
|
type: Component,
|
|
@@ -3673,7 +3941,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
3673
3941
|
multi: true,
|
|
3674
3942
|
},
|
|
3675
3943
|
provideTranslocoScope('haloduck'),
|
|
3676
|
-
], template: "<div class=\"flex flex-col gap-2\">\n <label
|
|
3944
|
+
], template: "<div class=\"flex flex-col gap-2\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n\n <div\n class=\"tag-input-wrapper block w-full rounded-md bg-light-control dark:bg-dark-control disabled:bg-light-control/60 dark:disabled:bg-dark-control/80 px-2 py-1.5 text-base text-light-on-control dark:text-dark-on-control disabled:cursor-not-allowed disabled:text-light-on-control/60 dark:disabled:text-dark-on-control/80 outline -outline-offset-1 outline-light-inactive dark:outline-dark-inactive placeholder:text-light-inactive dark:placeholder:text-dark-inactive sm:text-sm/6\"\n >\n <div class=\"flex flex-wrap items-center gap-2\">\n @for (tag of tags; track tag; let i = $index) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary px-2 py-0.5 text-xs\"\n >\n {{ tag }}\n @if (!disabled) {\n <button\n type=\"button\"\n (click)=\"removeTag(i)\"\n class=\"text-light-on-secondary/80 hover:text-light-on-secondary dark:text-dark-on-secondary/80 dark:hover:text-dark-on-secondary hover:cursor-pointer\"\n >\n \u00D7\n </button>\n }\n </span>\n }\n\n <input\n #inputEl\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n class=\"flex-1 min-w-[8rem] bg-transparent outline-none placeholder:text-light-inactive dark:placeholder:text-dark-inactive\"\n [value]=\"inputValue\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.tag-input-wrapper:focus-within{outline-width:2px;outline-offset:2px;outline-color:var(--color-light-primary)!important}@media (prefers-color-scheme: dark){.tag-input-wrapper:focus-within{outline-color:var(--color-dark-primary)!important}}\n"] }]
|
|
3677
3945
|
}], propDecorators: { label: [{
|
|
3678
3946
|
type: ViewChild,
|
|
3679
3947
|
args: ['label']
|
|
@@ -3699,9 +3967,7 @@ class TagViewerComponent {
|
|
|
3699
3967
|
// Accept input as `value` for consistency with tag-input
|
|
3700
3968
|
set value(tags) {
|
|
3701
3969
|
if (Array.isArray(tags)) {
|
|
3702
|
-
this.tags = tags
|
|
3703
|
-
.map((t) => (t ?? '').trim())
|
|
3704
|
-
.filter((t) => t.length > 0);
|
|
3970
|
+
this.tags = tags.map((t) => (t ?? '').trim()).filter((t) => t.length > 0);
|
|
3705
3971
|
}
|
|
3706
3972
|
else {
|
|
3707
3973
|
this.tags = [];
|
|
@@ -3717,11 +3983,11 @@ class TagViewerComponent {
|
|
|
3717
3983
|
}
|
|
3718
3984
|
}
|
|
3719
3985
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TagViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3720
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TagViewerComponent, isStandalone: true, selector: "haloduck-tag-viewer", inputs: { shouldWrap: "shouldWrap", value: "value" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n <label
|
|
3986
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: TagViewerComponent, isStandalone: true, selector: "haloduck-tag-viewer", inputs: { shouldWrap: "shouldWrap", value: "value" }, providers: [provideTranslocoScope('haloduck')], viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n\n <div\n class=\"block w-full rounded-md px-2 py-1.5 text-base text-light-on-control dark:text-dark-on-control sm:text-sm/6\"\n >\n <div class=\"flex items-center gap-2\" [ngClass]=\"shouldWrap ? 'flex-wrap' : 'flex-nowrap'\">\n @for (tag of tags; track tag) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary px-2 py-0.5 text-xs\"\n >\n {{ tag }}\n </span>\n }\n </div>\n </div>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
3721
3987
|
}
|
|
3722
3988
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TagViewerComponent, decorators: [{
|
|
3723
3989
|
type: Component,
|
|
3724
|
-
args: [{ selector: 'haloduck-tag-viewer', imports: [CommonModule], providers: [provideTranslocoScope('haloduck')], template: "<div class=\"flex flex-col gap-2\">\n <label
|
|
3990
|
+
args: [{ selector: 'haloduck-tag-viewer', imports: [CommonModule], providers: [provideTranslocoScope('haloduck')], template: "<div class=\"flex flex-col gap-2\">\n <label\n #label\n class=\"block text-sm/6 font-medium text-light-on-control dark:text-dark-on-control text-left\"\n >\n <ng-content></ng-content>\n </label>\n\n <div\n class=\"block w-full rounded-md px-2 py-1.5 text-base text-light-on-control dark:text-dark-on-control sm:text-sm/6\"\n >\n <div class=\"flex items-center gap-2\" [ngClass]=\"shouldWrap ? 'flex-wrap' : 'flex-nowrap'\">\n @for (tag of tags; track tag) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary px-2 py-0.5 text-xs\"\n >\n {{ tag }}\n </span>\n }\n </div>\n </div>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
3725
3991
|
}], propDecorators: { label: [{
|
|
3726
3992
|
type: ViewChild,
|
|
3727
3993
|
args: ['label']
|
|
@@ -3807,8 +4073,8 @@ class GroupedDirective {
|
|
|
3807
4073
|
if (!classString)
|
|
3808
4074
|
return;
|
|
3809
4075
|
// 공백으로 구분된 클래스들을 분리하여 각각 추가
|
|
3810
|
-
const classes = classString.split(' ').filter(className => className.trim());
|
|
3811
|
-
classes.forEach(className => {
|
|
4076
|
+
const classes = classString.split(' ').filter((className) => className.trim());
|
|
4077
|
+
classes.forEach((className) => {
|
|
3812
4078
|
if (className.trim()) {
|
|
3813
4079
|
this.renderer.addClass(element, className.trim());
|
|
3814
4080
|
}
|
|
@@ -3817,15 +4083,49 @@ class GroupedDirective {
|
|
|
3817
4083
|
removeBorderClasses(element) {
|
|
3818
4084
|
// 기본 테두리 클래스들 제거
|
|
3819
4085
|
const defaultBorderClasses = [
|
|
3820
|
-
'border',
|
|
3821
|
-
'border-
|
|
3822
|
-
'
|
|
3823
|
-
'border-
|
|
3824
|
-
'border-
|
|
3825
|
-
'border-
|
|
3826
|
-
'border-
|
|
4086
|
+
'border',
|
|
4087
|
+
'border-2',
|
|
4088
|
+
'border-3',
|
|
4089
|
+
'border-4',
|
|
4090
|
+
'border-8',
|
|
4091
|
+
'border-solid',
|
|
4092
|
+
'border-dashed',
|
|
4093
|
+
'border-dotted',
|
|
4094
|
+
'border-double',
|
|
4095
|
+
'border-none',
|
|
4096
|
+
'rounded-none',
|
|
4097
|
+
'rounded-sm',
|
|
4098
|
+
'rounded',
|
|
4099
|
+
'rounded-md',
|
|
4100
|
+
'rounded-lg',
|
|
4101
|
+
'rounded-xl',
|
|
4102
|
+
'rounded-2xl',
|
|
4103
|
+
'rounded-3xl',
|
|
4104
|
+
'rounded-full',
|
|
4105
|
+
'border-gray-200',
|
|
4106
|
+
'border-gray-300',
|
|
4107
|
+
'border-gray-400',
|
|
4108
|
+
'border-gray-500',
|
|
4109
|
+
'border-gray-600',
|
|
4110
|
+
'border-gray-700',
|
|
4111
|
+
'border-gray-800',
|
|
4112
|
+
'border-gray-900',
|
|
4113
|
+
'border-blue-500',
|
|
4114
|
+
'border-blue-700',
|
|
4115
|
+
'border-red-500',
|
|
4116
|
+
'border-red-600',
|
|
4117
|
+
'border-green-500',
|
|
4118
|
+
'border-green-600',
|
|
4119
|
+
'border-amber-500',
|
|
4120
|
+
'border-amber-600',
|
|
4121
|
+
'border-violet-500',
|
|
4122
|
+
'border-violet-600',
|
|
4123
|
+
'border-pink-500',
|
|
4124
|
+
'border-pink-600',
|
|
4125
|
+
'border-white',
|
|
4126
|
+
'border-black',
|
|
3827
4127
|
];
|
|
3828
|
-
defaultBorderClasses.forEach(className => {
|
|
4128
|
+
defaultBorderClasses.forEach((className) => {
|
|
3829
4129
|
this.renderer.removeClass(element, className);
|
|
3830
4130
|
});
|
|
3831
4131
|
}
|
|
@@ -3853,7 +4153,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
3853
4153
|
type: Directive,
|
|
3854
4154
|
args: [{
|
|
3855
4155
|
selector: '[haloduckGrouped]',
|
|
3856
|
-
standalone: true
|
|
4156
|
+
standalone: true,
|
|
3857
4157
|
}]
|
|
3858
4158
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { haloduckGrouped: [{
|
|
3859
4159
|
type: Input
|
|
@@ -3882,18 +4182,14 @@ class BreadcrumbService {
|
|
|
3882
4182
|
titleService = inject(Title);
|
|
3883
4183
|
constructor(router) {
|
|
3884
4184
|
this.router = router;
|
|
3885
|
-
this.router.events
|
|
3886
|
-
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
3887
|
-
.subscribe(() => {
|
|
4185
|
+
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
|
|
3888
4186
|
const root = this.router.routerState.snapshot.root;
|
|
3889
4187
|
const breadcrumbs = this.createBreadcrumbs(root);
|
|
3890
4188
|
this.breadcrumbs.next(breadcrumbs);
|
|
3891
4189
|
setTimeout(() => {
|
|
3892
4190
|
const titlePrefix = this.coreService.getStage() === 'prod'
|
|
3893
4191
|
? ''
|
|
3894
|
-
: `[${this.coreService.getStage()}] ` +
|
|
3895
|
-
this.coreService.getAppName() +
|
|
3896
|
-
'::';
|
|
4192
|
+
: `[${this.coreService.getStage()}] ` + this.coreService.getAppName() + '::';
|
|
3897
4193
|
const title = titlePrefix +
|
|
3898
4194
|
breadcrumbs.reduce((acc, breadcrumb) => {
|
|
3899
4195
|
return acc ? `${acc}>${breadcrumb.label}` : breadcrumb.label;
|
|
@@ -3908,9 +4204,7 @@ class BreadcrumbService {
|
|
|
3908
4204
|
return breadcrumbs;
|
|
3909
4205
|
}
|
|
3910
4206
|
for (const child of children) {
|
|
3911
|
-
const routeURL = child.url
|
|
3912
|
-
.map((segment) => segment.path)
|
|
3913
|
-
.join('/');
|
|
4207
|
+
const routeURL = child.url.map((segment) => segment.path).join('/');
|
|
3914
4208
|
if (routeURL !== '') {
|
|
3915
4209
|
url += `/${routeURL}`;
|
|
3916
4210
|
}
|
|
@@ -3938,11 +4232,11 @@ class BreadcrumbComponent {
|
|
|
3938
4232
|
});
|
|
3939
4233
|
}
|
|
3940
4234
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3941
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: BreadcrumbComponent, isStandalone: true, selector: "haloduck-breadcrumb", ngImport: i0, template: "<nav
|
|
4235
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: BreadcrumbComponent, isStandalone: true, selector: "haloduck-breadcrumb", ngImport: i0, template: "<nav\n class=\"flex border-b border-light-inactive dark:border-dark-inactive bg-light-background dark:bg-dark-background\"\n aria-label=\"Breadcrumb\"\n>\n <ol role=\"list\" class=\"flex w-full max-w-(--breakpoint-xl) space-x-4 px-4 sm:px-6 lg:px-8\">\n <li class=\"flex\">\n <div class=\"flex items-center\">\n <a\n routerLink=\"/\"\n class=\"text-light-on-background dark:text-dark-on-background hover:scale-105\"\n >\n <svg\n class=\"size-5 shrink-0\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n <span class=\"sr-only\">Home</span>\n </a>\n </div>\n </li>\n @for (breadcrumb of listBreadcrumb; track breadcrumb.label; let last = $last) {\n <li class=\"flex\">\n <div class=\"flex items-center\">\n <svg\n class=\"h-full w-6 shrink-0 text-light-inactive dark:text-dark-inactive\"\n viewBox=\"0 0 24 44\"\n preserveAspectRatio=\"none\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M.293 0l22 22-22 22h1.414l22-22-22-22H.293z\" />\n </svg>\n @if (!last) {\n <a\n href=\"javascript:void(0)\"\n [routerLink]=\"breadcrumb.url\"\n class=\"ml-4 text-sm font-medium hover:font-bold text-light-on-background dark:text-dark-on-background\"\n >{{ breadcrumb.label | transloco }}</a\n >\n } @else {\n <span\n class=\"ml-4 text-sm font-medium text-light-on-background dark:text-dark-on-background\"\n >{{ breadcrumb.label | transloco }}</span\n >\n }\n </div>\n </li>\n }\n </ol>\n</nav>\n", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2$1.TranslocoPipe, name: "transloco" }] });
|
|
3942
4236
|
}
|
|
3943
4237
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
3944
4238
|
type: Component,
|
|
3945
|
-
args: [{ selector: 'haloduck-breadcrumb', imports: [RouterLink, TranslocoModule], template: "<nav
|
|
4239
|
+
args: [{ selector: 'haloduck-breadcrumb', imports: [RouterLink, TranslocoModule], template: "<nav\n class=\"flex border-b border-light-inactive dark:border-dark-inactive bg-light-background dark:bg-dark-background\"\n aria-label=\"Breadcrumb\"\n>\n <ol role=\"list\" class=\"flex w-full max-w-(--breakpoint-xl) space-x-4 px-4 sm:px-6 lg:px-8\">\n <li class=\"flex\">\n <div class=\"flex items-center\">\n <a\n routerLink=\"/\"\n class=\"text-light-on-background dark:text-dark-on-background hover:scale-105\"\n >\n <svg\n class=\"size-5 shrink-0\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n <span class=\"sr-only\">Home</span>\n </a>\n </div>\n </li>\n @for (breadcrumb of listBreadcrumb; track breadcrumb.label; let last = $last) {\n <li class=\"flex\">\n <div class=\"flex items-center\">\n <svg\n class=\"h-full w-6 shrink-0 text-light-inactive dark:text-dark-inactive\"\n viewBox=\"0 0 24 44\"\n preserveAspectRatio=\"none\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M.293 0l22 22-22 22h1.414l22-22-22-22H.293z\" />\n </svg>\n @if (!last) {\n <a\n href=\"javascript:void(0)\"\n [routerLink]=\"breadcrumb.url\"\n class=\"ml-4 text-sm font-medium hover:font-bold text-light-on-background dark:text-dark-on-background\"\n >{{ breadcrumb.label | transloco }}</a\n >\n } @else {\n <span\n class=\"ml-4 text-sm font-medium text-light-on-background dark:text-dark-on-background\"\n >{{ breadcrumb.label | transloco }}</span\n >\n }\n </div>\n </li>\n }\n </ol>\n</nav>\n" }]
|
|
3946
4240
|
}] });
|
|
3947
4241
|
|
|
3948
4242
|
class NotificationComponent {
|
|
@@ -3952,11 +4246,11 @@ class NotificationComponent {
|
|
|
3952
4246
|
this.notificationService.removeNotificationById(id);
|
|
3953
4247
|
}
|
|
3954
4248
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3955
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: NotificationComponent, isStandalone: true, selector: "haloduck-notification", ngImport: i0, template: "@for (notification of listNotification$ |async; track notification.id) {\n<div
|
|
4249
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: NotificationComponent, isStandalone: true, selector: "haloduck-notification", ngImport: i0, template: "@for (notification of listNotification$ | async; track notification.id) {\n <div\n class=\"relative rounded-lg m-4 px-8 py-4 bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary animate-fadeIn\"\n [ngClass]=\"{\n 'bg-light-primary-dark dark:bg-dark-primary-dark text-light-on-primary-dark dark:text-dark-on-primary-dark':\n notification.type === 'info',\n 'bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary':\n notification.type === 'success',\n 'bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger':\n notification.type === 'error',\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary':\n notification.type === 'warning',\n }\"\n >\n {{ notification.message }}\n <div class=\"absolute top-0 right-0\">\n <button type=\"button\" (click)=\"removeNotification(notification.id)\">\n <span class=\"sr-only\">Close</span>\n <svg\n class=\"size-6 text-white\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
3956
4250
|
}
|
|
3957
4251
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
3958
4252
|
type: Component,
|
|
3959
|
-
args: [{ selector: 'haloduck-notification', standalone: true, imports: [CommonModule], template: "@for (notification of listNotification$ |async; track notification.id) {\n<div
|
|
4253
|
+
args: [{ selector: 'haloduck-notification', standalone: true, imports: [CommonModule], template: "@for (notification of listNotification$ | async; track notification.id) {\n <div\n class=\"relative rounded-lg m-4 px-8 py-4 bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary animate-fadeIn\"\n [ngClass]=\"{\n 'bg-light-primary-dark dark:bg-dark-primary-dark text-light-on-primary-dark dark:text-dark-on-primary-dark':\n notification.type === 'info',\n 'bg-light-primary dark:bg-dark-primary text-light-on-primary dark:text-dark-on-primary':\n notification.type === 'success',\n 'bg-light-danger dark:bg-dark-danger text-light-on-danger dark:text-dark-on-danger':\n notification.type === 'error',\n 'bg-light-secondary dark:bg-dark-secondary text-light-on-secondary dark:text-dark-on-secondary':\n notification.type === 'warning',\n }\"\n >\n {{ notification.message }}\n <div class=\"absolute top-0 right-0\">\n <button type=\"button\" (click)=\"removeNotification(notification.id)\">\n <span class=\"sr-only\">Close</span>\n <svg\n class=\"size-6 text-white\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n </div>\n}\n" }]
|
|
3960
4254
|
}] });
|
|
3961
4255
|
|
|
3962
4256
|
class PictureNameComponent {
|
|
@@ -3964,11 +4258,11 @@ class PictureNameComponent {
|
|
|
3964
4258
|
pictureKey;
|
|
3965
4259
|
cdnUrl = '';
|
|
3966
4260
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PictureNameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3967
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: PictureNameComponent, isStandalone: true, selector: "haloduck-picture-name", inputs: { name: "name", pictureKey: "pictureKey", cdnUrl: "cdnUrl" }, ngImport: i0, template: "<div class=\"flex items-center justify-start gap-2\">\n
|
|
4261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: PictureNameComponent, isStandalone: true, selector: "haloduck-picture-name", inputs: { name: "name", pictureKey: "pictureKey", cdnUrl: "cdnUrl" }, ngImport: i0, template: "<div class=\"flex items-center justify-start gap-2\">\n @if (pictureKey) {\n <img src=\"{{ cdnUrl }}/{{ pictureKey }}\" alt=\"\uC0AC\uC9C4\" class=\"w-8 h-8 rounded-full\" />\n } @else {\n <div class=\"w-8 h-8 bg-light-inactive dark:bg-dark-inactive rounded-full\"></div>\n }\n {{ name }}\n @if (name) {\n \n <!-- TODO -->\n }\n</div>\n", styles: [""] });
|
|
3968
4262
|
}
|
|
3969
4263
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PictureNameComponent, decorators: [{
|
|
3970
4264
|
type: Component,
|
|
3971
|
-
args: [{ selector: 'haloduck-picture-name', imports: [], template: "<div class=\"flex items-center justify-start gap-2\">\n
|
|
4265
|
+
args: [{ selector: 'haloduck-picture-name', imports: [], template: "<div class=\"flex items-center justify-start gap-2\">\n @if (pictureKey) {\n <img src=\"{{ cdnUrl }}/{{ pictureKey }}\" alt=\"\uC0AC\uC9C4\" class=\"w-8 h-8 rounded-full\" />\n } @else {\n <div class=\"w-8 h-8 bg-light-inactive dark:bg-dark-inactive rounded-full\"></div>\n }\n {{ name }}\n @if (name) {\n \n <!-- TODO -->\n }\n</div>\n" }]
|
|
3972
4266
|
}], propDecorators: { name: [{
|
|
3973
4267
|
type: Input
|
|
3974
4268
|
}], pictureKey: [{
|