@ojiepermana/angular-component 22.0.44 → 22.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +9 -11
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +100 -32
- package/fesm2022/ojiepermana-angular-component-alert.mjs +5 -9
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +7 -13
- package/fesm2022/ojiepermana-angular-component-badge.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +16 -19
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +4 -7
- package/fesm2022/ojiepermana-angular-component-button.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +7 -5
- package/fesm2022/ojiepermana-angular-component-card.mjs +8 -15
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +15 -18
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +40 -11
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +8 -6
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +36 -16
- package/fesm2022/ojiepermana-angular-component-command.mjs +25 -21
- package/fesm2022/ojiepermana-angular-component-composer.mjs +15 -18
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +36 -11
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +85 -30
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +31 -26
- package/fesm2022/ojiepermana-angular-component-editor.mjs +37 -28
- package/fesm2022/ojiepermana-angular-component-empty.mjs +7 -13
- package/fesm2022/ojiepermana-angular-component-form.mjs +32 -24
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-icon.mjs +51 -6
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +17 -15
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +15 -14
- package/fesm2022/ojiepermana-angular-component-input.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-item.mjs +11 -21
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +27 -26
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +3 -5
- package/fesm2022/ojiepermana-angular-component-label.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +25 -12
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +22 -13
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +70 -36
- package/fesm2022/ojiepermana-angular-component-progress.mjs +7 -5
- package/fesm2022/ojiepermana-angular-component-radio.mjs +21 -10
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +22 -11
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +8 -6
- package/fesm2022/ojiepermana-angular-component-select.mjs +29 -17
- package/fesm2022/ojiepermana-angular-component-separator.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +89 -30
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-slider.mjs +25 -13
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +6 -5
- package/fesm2022/ojiepermana-angular-component-switch.mjs +17 -8
- package/fesm2022/ojiepermana-angular-component-table.mjs +9 -17
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +5 -9
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +22 -17
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +12 -6
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +2 -3
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +7 -6
- package/package.json +10 -1
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +42 -3
- package/types/ojiepermana-angular-component-combobox.d.ts +4 -1
- package/types/ojiepermana-angular-component-command.d.ts +7 -2
- package/types/ojiepermana-angular-component-dialog.d.ts +33 -3
- package/types/ojiepermana-angular-component-form.d.ts +9 -0
- package/types/ojiepermana-angular-component-icon.d.ts +48 -1
- package/types/ojiepermana-angular-component-radio.d.ts +4 -1
- package/types/ojiepermana-angular-component-sheet.d.ts +33 -3
- package/types/ojiepermana-angular-component-timeline.d.ts +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, input, output, signal, inject, PLATFORM_ID, computed, effect, forwardRef,
|
|
3
|
+
import { Directive, input, output, signal, inject, PLATFORM_ID, computed, effect, forwardRef, Component, viewChild } from '@angular/core';
|
|
4
4
|
import EmblaCarousel from 'embla-carousel';
|
|
5
5
|
import { cn } from '@ojiepermana/angular-component/utils';
|
|
6
6
|
|
|
@@ -52,9 +52,7 @@ class CarouselComponent extends CarouselContextBase {
|
|
|
52
52
|
this.resetState();
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
const carousel = EmblaCarousel(viewport, { ...opts, axis: orientation === 'horizontal' ? 'x' : 'y' }, [
|
|
56
|
-
...plugins,
|
|
57
|
-
]);
|
|
55
|
+
const carousel = EmblaCarousel(viewport, { ...opts, axis: orientation === 'horizontal' ? 'x' : 'y' }, [...plugins]);
|
|
58
56
|
const updateState = () => this.updateState(carousel);
|
|
59
57
|
this.api = carousel;
|
|
60
58
|
this.apiChange.emit(carousel);
|
|
@@ -129,13 +127,12 @@ class CarouselComponent extends CarouselContextBase {
|
|
|
129
127
|
this.canScrollNext.set(false);
|
|
130
128
|
}
|
|
131
129
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
132
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: CarouselComponent, isStandalone: true, selector: "Carousel", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, opts: { classPropertyName: "opts", publicName: "opts", isSignal: true, isRequired: false, transformFunction: null }, plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apiReady: "apiReady", apiChange: "apiChange" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "classes()", "attr.role": "\"region\"", "attr.aria-roledescription": "\"carousel\"", "attr.aria-label": "label()", "attr.data-orientation": "orientation()", "attr.tabindex": "keyboard() ? 0 : null" } }, providers: [{ provide: CarouselContextBase, useExisting: forwardRef(() => CarouselComponent) }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true
|
|
130
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: CarouselComponent, isStandalone: true, selector: "Carousel", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, opts: { classPropertyName: "opts", publicName: "opts", isSignal: true, isRequired: false, transformFunction: null }, plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apiReady: "apiReady", apiChange: "apiChange" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "classes()", "attr.role": "\"region\"", "attr.aria-roledescription": "\"carousel\"", "attr.aria-label": "label()", "attr.data-orientation": "orientation()", "attr.tabindex": "keyboard() ? 0 : null" } }, providers: [{ provide: CarouselContextBase, useExisting: forwardRef(() => CarouselComponent) }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
133
131
|
}
|
|
134
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselComponent, decorators: [{
|
|
135
133
|
type: Component,
|
|
136
134
|
args: [{
|
|
137
135
|
selector: 'Carousel',
|
|
138
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
139
136
|
providers: [{ provide: CarouselContextBase, useExisting: forwardRef(() => CarouselComponent) }],
|
|
140
137
|
host: {
|
|
141
138
|
'[class]': 'classes()',
|
|
@@ -172,13 +169,12 @@ class CarouselContentComponent {
|
|
|
172
169
|
<div #viewport class="overflow-hidden">
|
|
173
170
|
<div [class]="contentClasses()"><ng-content /></div>
|
|
174
171
|
</div>
|
|
175
|
-
`, isInline: true
|
|
172
|
+
`, isInline: true });
|
|
176
173
|
}
|
|
177
174
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselContentComponent, decorators: [{
|
|
178
175
|
type: Component,
|
|
179
176
|
args: [{
|
|
180
177
|
selector: 'CarouselContent',
|
|
181
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
182
178
|
host: {
|
|
183
179
|
'[class]': '"block"',
|
|
184
180
|
},
|
|
@@ -198,13 +194,12 @@ class CarouselItemComponent {
|
|
|
198
194
|
classes = computed(() => cn('min-w-0 shrink-0 grow-0 basis-full', this.ctx.orientation() === 'horizontal' ? 'pl-4' : 'pt-4', this.class()), /* @ts-ignore */
|
|
199
195
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
200
196
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: CarouselItemComponent, isStandalone: true, selector: "CarouselItem", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "\"group\"", "attr.aria-roledescription": "\"slide\"", "attr.aria-label": "ariaLabel()" } }, ngImport: i0, template: `<ng-content />`, isInline: true
|
|
197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: CarouselItemComponent, isStandalone: true, selector: "CarouselItem", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "\"group\"", "attr.aria-roledescription": "\"slide\"", "attr.aria-label": "ariaLabel()" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
202
198
|
}
|
|
203
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselItemComponent, decorators: [{
|
|
204
200
|
type: Component,
|
|
205
201
|
args: [{
|
|
206
202
|
selector: 'CarouselItem',
|
|
207
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
208
203
|
host: {
|
|
209
204
|
'[class]': 'classes()',
|
|
210
205
|
'[attr.role]': '"group"',
|
|
@@ -232,16 +227,16 @@ class CarouselPreviousComponent {
|
|
|
232
227
|
stroke="currentColor"
|
|
233
228
|
stroke-width="2"
|
|
234
229
|
stroke-linecap="round"
|
|
235
|
-
stroke-linejoin="round"
|
|
230
|
+
stroke-linejoin="round"
|
|
231
|
+
>
|
|
236
232
|
<path d="m15 18-6-6 6-6" />
|
|
237
233
|
</svg>
|
|
238
|
-
`, isInline: true
|
|
234
|
+
`, isInline: true });
|
|
239
235
|
}
|
|
240
236
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselPreviousComponent, decorators: [{
|
|
241
237
|
type: Component,
|
|
242
238
|
args: [{
|
|
243
239
|
selector: 'button[CarouselPrevious]',
|
|
244
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
245
240
|
host: {
|
|
246
241
|
'[class]': 'classes()',
|
|
247
242
|
type: 'button',
|
|
@@ -258,7 +253,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
258
253
|
stroke="currentColor"
|
|
259
254
|
stroke-width="2"
|
|
260
255
|
stroke-linecap="round"
|
|
261
|
-
stroke-linejoin="round"
|
|
256
|
+
stroke-linejoin="round"
|
|
257
|
+
>
|
|
262
258
|
<path d="m15 18-6-6 6-6" />
|
|
263
259
|
</svg>
|
|
264
260
|
`,
|
|
@@ -282,16 +278,16 @@ class CarouselNextComponent {
|
|
|
282
278
|
stroke="currentColor"
|
|
283
279
|
stroke-width="2"
|
|
284
280
|
stroke-linecap="round"
|
|
285
|
-
stroke-linejoin="round"
|
|
281
|
+
stroke-linejoin="round"
|
|
282
|
+
>
|
|
286
283
|
<path d="m9 18 6-6-6-6" />
|
|
287
284
|
</svg>
|
|
288
|
-
`, isInline: true
|
|
285
|
+
`, isInline: true });
|
|
289
286
|
}
|
|
290
287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CarouselNextComponent, decorators: [{
|
|
291
288
|
type: Component,
|
|
292
289
|
args: [{
|
|
293
290
|
selector: 'button[CarouselNext]',
|
|
294
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
295
291
|
host: {
|
|
296
292
|
'[class]': 'classes()',
|
|
297
293
|
type: 'button',
|
|
@@ -308,7 +304,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
308
304
|
stroke="currentColor"
|
|
309
305
|
stroke-width="2"
|
|
310
306
|
stroke-linecap="round"
|
|
311
|
-
stroke-linejoin="round"
|
|
307
|
+
stroke-linejoin="round"
|
|
308
|
+
>
|
|
312
309
|
<path d="m9 18 6-6-6-6" />
|
|
313
310
|
</svg>
|
|
314
311
|
`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, viewChild, signal, computed, forwardRef,
|
|
2
|
+
import { input, booleanAttribute, output, viewChild, signal, computed, forwardRef, Component } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { uniqueId, cn } from '@ojiepermana/angular-component/utils';
|
|
5
5
|
|
|
@@ -82,7 +82,9 @@ class CheckboxComponent {
|
|
|
82
82
|
this.disabledState.set(d);
|
|
83
83
|
}
|
|
84
84
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: CheckboxComponent, isStandalone: true, selector: "Checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: CheckboxComponent, isStandalone: true, selector: "Checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [
|
|
86
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxComponent), multi: true },
|
|
87
|
+
], viewQueries: [{ propertyName: "ref", first: true, predicate: ["ref"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
86
88
|
<label [class]="labelClasses()" [attr.for]="id()">
|
|
87
89
|
<input
|
|
88
90
|
#ref
|
|
@@ -99,28 +101,42 @@ class CheckboxComponent {
|
|
|
99
101
|
[attr.aria-labelledby]="ariaLabelledby()"
|
|
100
102
|
[attr.aria-invalid]="ariaInvalidAttr()"
|
|
101
103
|
(change)="handleChange($event)"
|
|
102
|
-
(blur)="handleBlur()"
|
|
104
|
+
(blur)="handleBlur()"
|
|
105
|
+
/>
|
|
103
106
|
<span aria-hidden="true" [class]="boxClasses()">
|
|
104
107
|
@if (indeterminate()) {
|
|
105
|
-
<svg
|
|
108
|
+
<svg
|
|
109
|
+
viewBox="0 0 24 24"
|
|
110
|
+
fill="none"
|
|
111
|
+
stroke="currentColor"
|
|
112
|
+
stroke-width="3"
|
|
113
|
+
class="size-3"
|
|
114
|
+
>
|
|
106
115
|
<path d="M5 12h14" />
|
|
107
116
|
</svg>
|
|
108
117
|
} @else if (checked()) {
|
|
109
|
-
<svg
|
|
118
|
+
<svg
|
|
119
|
+
viewBox="0 0 24 24"
|
|
120
|
+
fill="none"
|
|
121
|
+
stroke="currentColor"
|
|
122
|
+
stroke-width="3"
|
|
123
|
+
class="size-3"
|
|
124
|
+
>
|
|
110
125
|
<path d="M20 6 9 17l-5-5" />
|
|
111
126
|
</svg>
|
|
112
127
|
}
|
|
113
128
|
</span>
|
|
114
129
|
<ng-content />
|
|
115
130
|
</label>
|
|
116
|
-
`, isInline: true
|
|
131
|
+
`, isInline: true });
|
|
117
132
|
}
|
|
118
133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
119
134
|
type: Component,
|
|
120
135
|
args: [{
|
|
121
136
|
selector: 'Checkbox',
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
providers: [
|
|
138
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxComponent), multi: true },
|
|
139
|
+
],
|
|
124
140
|
host: { '[class]': 'hostClasses()' },
|
|
125
141
|
template: `
|
|
126
142
|
<label [class]="labelClasses()" [attr.for]="id()">
|
|
@@ -139,14 +155,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
139
155
|
[attr.aria-labelledby]="ariaLabelledby()"
|
|
140
156
|
[attr.aria-invalid]="ariaInvalidAttr()"
|
|
141
157
|
(change)="handleChange($event)"
|
|
142
|
-
(blur)="handleBlur()"
|
|
158
|
+
(blur)="handleBlur()"
|
|
159
|
+
/>
|
|
143
160
|
<span aria-hidden="true" [class]="boxClasses()">
|
|
144
161
|
@if (indeterminate()) {
|
|
145
|
-
<svg
|
|
162
|
+
<svg
|
|
163
|
+
viewBox="0 0 24 24"
|
|
164
|
+
fill="none"
|
|
165
|
+
stroke="currentColor"
|
|
166
|
+
stroke-width="3"
|
|
167
|
+
class="size-3"
|
|
168
|
+
>
|
|
146
169
|
<path d="M5 12h14" />
|
|
147
170
|
</svg>
|
|
148
171
|
} @else if (checked()) {
|
|
149
|
-
<svg
|
|
172
|
+
<svg
|
|
173
|
+
viewBox="0 0 24 24"
|
|
174
|
+
fill="none"
|
|
175
|
+
stroke="currentColor"
|
|
176
|
+
stroke-width="3"
|
|
177
|
+
class="size-3"
|
|
178
|
+
>
|
|
150
179
|
<path d="M20 6 9 17l-5-5" />
|
|
151
180
|
</svg>
|
|
152
181
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, model, input, computed, forwardRef,
|
|
2
|
+
import { Directive, model, input, computed, forwardRef, Component, inject } from '@angular/core';
|
|
3
3
|
import { uniqueId, cn } from '@ojiepermana/angular-component/utils';
|
|
4
4
|
|
|
5
5
|
class CollapsibleContextBase {
|
|
@@ -32,14 +32,17 @@ class CollapsibleComponent extends CollapsibleContextBase {
|
|
|
32
32
|
this.open.update((value) => !value);
|
|
33
33
|
}
|
|
34
34
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CollapsibleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: CollapsibleComponent, isStandalone: true, selector: "Collapsible", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "class": "classes()", "attr.data-state": "open() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : null" } }, providers: [
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: CollapsibleComponent, isStandalone: true, selector: "Collapsible", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "class": "classes()", "attr.data-state": "open() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : null" } }, providers: [
|
|
36
|
+
{ provide: CollapsibleContextBase, useExisting: forwardRef(() => CollapsibleComponent) },
|
|
37
|
+
], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
36
38
|
}
|
|
37
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CollapsibleComponent, decorators: [{
|
|
38
40
|
type: Component,
|
|
39
41
|
args: [{
|
|
40
42
|
selector: 'Collapsible',
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
providers: [
|
|
44
|
+
{ provide: CollapsibleContextBase, useExisting: forwardRef(() => CollapsibleComponent) },
|
|
45
|
+
],
|
|
43
46
|
host: {
|
|
44
47
|
'[class]': 'classes()',
|
|
45
48
|
'[attr.data-state]': 'open() ? "open" : "closed"',
|
|
@@ -88,13 +91,12 @@ class CollapsibleContentComponent {
|
|
|
88
91
|
@if (renderContent()) {
|
|
89
92
|
<ng-content />
|
|
90
93
|
}
|
|
91
|
-
`, isInline: true
|
|
94
|
+
`, isInline: true });
|
|
92
95
|
}
|
|
93
96
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: CollapsibleContentComponent, decorators: [{
|
|
94
97
|
type: Component,
|
|
95
98
|
args: [{
|
|
96
99
|
selector: 'CollapsibleContent',
|
|
97
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
98
100
|
host: {
|
|
99
101
|
'[class]': 'classes()',
|
|
100
102
|
'[attr.id]': 'ctx.contentId',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Overlay } from '@angular/cdk/overlay';
|
|
2
2
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ViewContainerRef, DestroyRef, input, model, signal, computed, viewChild, forwardRef,
|
|
4
|
+
import { inject, ViewContainerRef, DestroyRef, input, model, signal, computed, viewChild, forwardRef, Component } from '@angular/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import { uniqueId, cn, overlayDismissals } from '@ojiepermana/angular-component/utils';
|
|
@@ -23,6 +23,9 @@ class ComboboxComponent {
|
|
|
23
23
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
24
24
|
placeholder = input('Select…', /* @ts-ignore */
|
|
25
25
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/** Accessible name for the combobox trigger (its text content is the value, not a name). */
|
|
27
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
28
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
26
29
|
searchPlaceholder = input('Search…', /* @ts-ignore */
|
|
27
30
|
...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
28
31
|
emptyText = input('No results found.', /* @ts-ignore */
|
|
@@ -119,18 +122,23 @@ class ComboboxComponent {
|
|
|
119
122
|
this.cvaDisabled.set(state);
|
|
120
123
|
}
|
|
121
124
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: ComboboxComponent, isStandalone: true, selector: "Combobox", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null },
|
|
125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: ComboboxComponent, isStandalone: true, selector: "Combobox", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange" }, host: { properties: { "class": "classes()" } }, providers: [
|
|
126
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ComboboxComponent), multi: true },
|
|
127
|
+
], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
123
128
|
<button
|
|
124
129
|
#trigger
|
|
125
130
|
type="button"
|
|
126
131
|
[attr.id]="triggerId"
|
|
127
132
|
role="combobox"
|
|
128
133
|
aria-haspopup="listbox"
|
|
134
|
+
[attr.aria-label]="ariaLabelledby() ? null : (ariaLabel() ?? placeholder())"
|
|
135
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
129
136
|
[attr.aria-expanded]="isOpen()"
|
|
130
137
|
[attr.aria-controls]="isOpen() ? panelId : null"
|
|
131
138
|
[class]="triggerClasses()"
|
|
132
139
|
[disabled]="isDisabled() || null"
|
|
133
|
-
(click)="toggle()"
|
|
140
|
+
(click)="toggle()"
|
|
141
|
+
>
|
|
134
142
|
<span [class.text-muted-foreground]="!selectedLabel()">
|
|
135
143
|
{{ selectedLabel() || placeholder() }}
|
|
136
144
|
</span>
|
|
@@ -141,7 +149,8 @@ class ComboboxComponent {
|
|
|
141
149
|
stroke="currentColor"
|
|
142
150
|
stroke-width="2"
|
|
143
151
|
stroke-linecap="round"
|
|
144
|
-
stroke-linejoin="round"
|
|
152
|
+
stroke-linejoin="round"
|
|
153
|
+
>
|
|
145
154
|
<polyline points="6 9 12 15 18 9" />
|
|
146
155
|
</svg>
|
|
147
156
|
</button>
|
|
@@ -149,7 +158,8 @@ class ComboboxComponent {
|
|
|
149
158
|
<ng-template #panel>
|
|
150
159
|
<div
|
|
151
160
|
[attr.id]="panelId"
|
|
152
|
-
class="w-(--combobox-trigger-width) rounded-md border bg-popover text-popover-foreground shadow-md"
|
|
161
|
+
class="w-(--combobox-trigger-width) rounded-md border bg-popover text-popover-foreground shadow-md"
|
|
162
|
+
>
|
|
153
163
|
<Command>
|
|
154
164
|
<input CommandInput [placeholder]="searchPlaceholder()" />
|
|
155
165
|
<CommandList>
|
|
@@ -161,7 +171,8 @@ class ComboboxComponent {
|
|
|
161
171
|
CommandItem
|
|
162
172
|
[value]="opt.label"
|
|
163
173
|
[disabled]="!!opt.disabled"
|
|
164
|
-
(selected)="pick(opt)"
|
|
174
|
+
(selected)="pick(opt)"
|
|
175
|
+
>
|
|
165
176
|
{{ opt.label }}
|
|
166
177
|
@if (isSelected(opt)) {
|
|
167
178
|
<svg
|
|
@@ -171,7 +182,8 @@ class ComboboxComponent {
|
|
|
171
182
|
stroke="currentColor"
|
|
172
183
|
stroke-width="2"
|
|
173
184
|
stroke-linecap="round"
|
|
174
|
-
stroke-linejoin="round"
|
|
185
|
+
stroke-linejoin="round"
|
|
186
|
+
>
|
|
175
187
|
<polyline points="20 6 9 17 4 12" />
|
|
176
188
|
</svg>
|
|
177
189
|
}
|
|
@@ -182,13 +194,12 @@ class ComboboxComponent {
|
|
|
182
194
|
</Command>
|
|
183
195
|
</div>
|
|
184
196
|
</ng-template>
|
|
185
|
-
`, isInline: true, dependencies: [{ kind: "component", type: CommandComponent, selector: "Command", inputs: ["query", "class"], outputs: ["queryChange"] }, { kind: "component", type: CommandInputComponent, selector: "input[CommandInput]", inputs: ["placeholder", "class"] }, { kind: "component", type: CommandListComponent, selector: "CommandList", inputs: ["class"] }, { kind: "component", type: CommandEmptyComponent, selector: "CommandEmpty", inputs: ["class"] }, { kind: "component", type: CommandGroupComponent, selector: "CommandGroup", inputs: ["heading", "class"] }, { kind: "component", type: CommandItemComponent, selector: "CommandItem, button[CommandItem]", inputs: ["value", "disabled", "class"], outputs: ["selected"] }]
|
|
197
|
+
`, isInline: true, dependencies: [{ kind: "component", type: CommandComponent, selector: "Command", inputs: ["query", "class"], outputs: ["queryChange"] }, { kind: "component", type: CommandInputComponent, selector: "input[CommandInput]", inputs: ["placeholder", "class"] }, { kind: "component", type: CommandListComponent, selector: "CommandList", inputs: ["class", "aria-label"] }, { kind: "component", type: CommandEmptyComponent, selector: "CommandEmpty", inputs: ["class"] }, { kind: "component", type: CommandGroupComponent, selector: "CommandGroup", inputs: ["heading", "class"] }, { kind: "component", type: CommandItemComponent, selector: "CommandItem, button[CommandItem]", inputs: ["value", "disabled", "class"], outputs: ["selected"] }] });
|
|
186
198
|
}
|
|
187
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
188
200
|
type: Component,
|
|
189
201
|
args: [{
|
|
190
202
|
selector: 'Combobox',
|
|
191
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
192
203
|
imports: [
|
|
193
204
|
CommandComponent,
|
|
194
205
|
CommandInputComponent,
|
|
@@ -197,7 +208,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
197
208
|
CommandGroupComponent,
|
|
198
209
|
CommandItemComponent,
|
|
199
210
|
],
|
|
200
|
-
providers: [
|
|
211
|
+
providers: [
|
|
212
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ComboboxComponent), multi: true },
|
|
213
|
+
],
|
|
201
214
|
host: { '[class]': 'classes()' },
|
|
202
215
|
template: `
|
|
203
216
|
<button
|
|
@@ -206,11 +219,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
206
219
|
[attr.id]="triggerId"
|
|
207
220
|
role="combobox"
|
|
208
221
|
aria-haspopup="listbox"
|
|
222
|
+
[attr.aria-label]="ariaLabelledby() ? null : (ariaLabel() ?? placeholder())"
|
|
223
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
209
224
|
[attr.aria-expanded]="isOpen()"
|
|
210
225
|
[attr.aria-controls]="isOpen() ? panelId : null"
|
|
211
226
|
[class]="triggerClasses()"
|
|
212
227
|
[disabled]="isDisabled() || null"
|
|
213
|
-
(click)="toggle()"
|
|
228
|
+
(click)="toggle()"
|
|
229
|
+
>
|
|
214
230
|
<span [class.text-muted-foreground]="!selectedLabel()">
|
|
215
231
|
{{ selectedLabel() || placeholder() }}
|
|
216
232
|
</span>
|
|
@@ -221,7 +237,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
221
237
|
stroke="currentColor"
|
|
222
238
|
stroke-width="2"
|
|
223
239
|
stroke-linecap="round"
|
|
224
|
-
stroke-linejoin="round"
|
|
240
|
+
stroke-linejoin="round"
|
|
241
|
+
>
|
|
225
242
|
<polyline points="6 9 12 15 18 9" />
|
|
226
243
|
</svg>
|
|
227
244
|
</button>
|
|
@@ -229,7 +246,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
229
246
|
<ng-template #panel>
|
|
230
247
|
<div
|
|
231
248
|
[attr.id]="panelId"
|
|
232
|
-
class="w-(--combobox-trigger-width) rounded-md border bg-popover text-popover-foreground shadow-md"
|
|
249
|
+
class="w-(--combobox-trigger-width) rounded-md border bg-popover text-popover-foreground shadow-md"
|
|
250
|
+
>
|
|
233
251
|
<Command>
|
|
234
252
|
<input CommandInput [placeholder]="searchPlaceholder()" />
|
|
235
253
|
<CommandList>
|
|
@@ -241,7 +259,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
241
259
|
CommandItem
|
|
242
260
|
[value]="opt.label"
|
|
243
261
|
[disabled]="!!opt.disabled"
|
|
244
|
-
(selected)="pick(opt)"
|
|
262
|
+
(selected)="pick(opt)"
|
|
263
|
+
>
|
|
245
264
|
{{ opt.label }}
|
|
246
265
|
@if (isSelected(opt)) {
|
|
247
266
|
<svg
|
|
@@ -251,7 +270,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
251
270
|
stroke="currentColor"
|
|
252
271
|
stroke-width="2"
|
|
253
272
|
stroke-linecap="round"
|
|
254
|
-
stroke-linejoin="round"
|
|
273
|
+
stroke-linejoin="round"
|
|
274
|
+
>
|
|
255
275
|
<polyline points="20 6 9 17 4 12" />
|
|
256
276
|
</svg>
|
|
257
277
|
}
|
|
@@ -264,7 +284,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
264
284
|
</ng-template>
|
|
265
285
|
`,
|
|
266
286
|
}]
|
|
267
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
287
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
268
288
|
|
|
269
289
|
/**
|
|
270
290
|
* Generated bundle index. Do not edit.
|