@area8975/ui 0.2.2-dev.49 → 0.2.2-dev.50
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 +3 -2
- package/fesm2022/area8975-ui-alert.mjs +113 -0
- package/fesm2022/area8975-ui-alert.mjs.map +1 -0
- package/fesm2022/area8975-ui-avatar.mjs +157 -0
- package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
- package/fesm2022/area8975-ui-badge.mjs +116 -0
- package/fesm2022/area8975-ui-badge.mjs.map +1 -0
- package/fesm2022/area8975-ui-button.mjs +314 -0
- package/fesm2022/area8975-ui-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-calendar.mjs +549 -0
- package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
- package/fesm2022/area8975-ui-card-header.mjs +96 -0
- package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
- package/fesm2022/area8975-ui-card.mjs +73 -0
- package/fesm2022/area8975-ui-card.mjs.map +1 -0
- package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
- package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
- package/fesm2022/area8975-ui-charts.mjs +2813 -0
- package/fesm2022/area8975-ui-charts.mjs.map +1 -0
- package/fesm2022/area8975-ui-checkbox.mjs +202 -0
- package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
- package/fesm2022/area8975-ui-colour.mjs +200 -0
- package/fesm2022/area8975-ui-colour.mjs.map +1 -0
- package/fesm2022/area8975-ui-container.mjs +40 -0
- package/fesm2022/area8975-ui-container.mjs.map +1 -0
- package/fesm2022/area8975-ui-counter.mjs +246 -0
- package/fesm2022/area8975-ui-counter.mjs.map +1 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
- package/fesm2022/area8975-ui-datepicker.mjs +547 -0
- package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
- package/fesm2022/area8975-ui-disclosure.mjs +279 -0
- package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
- package/fesm2022/area8975-ui-drawer.mjs +106 -0
- package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown.mjs +208 -0
- package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropzone.mjs +332 -0
- package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
- package/fesm2022/area8975-ui-field.mjs +191 -0
- package/fesm2022/area8975-ui-field.mjs.map +1 -0
- package/fesm2022/area8975-ui-file-input.mjs +340 -0
- package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-file.mjs +47 -0
- package/fesm2022/area8975-ui-file.mjs.map +1 -0
- package/fesm2022/area8975-ui-format.mjs +70 -0
- package/fesm2022/area8975-ui-format.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-addon.mjs +42 -0
- package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-group.mjs +86 -0
- package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-input.mjs +682 -0
- package/fesm2022/area8975-ui-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-kpi.mjs +167 -0
- package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
- package/fesm2022/area8975-ui-layout.mjs +63 -0
- package/fesm2022/area8975-ui-layout.mjs.map +1 -0
- package/fesm2022/area8975-ui-loading.mjs +76 -0
- package/fesm2022/area8975-ui-loading.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal.mjs +235 -0
- package/fesm2022/area8975-ui-modal.mjs.map +1 -0
- package/fesm2022/area8975-ui-money.mjs +230 -0
- package/fesm2022/area8975-ui-money.mjs.map +1 -0
- package/fesm2022/area8975-ui-overlay.mjs +317 -0
- package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
- package/fesm2022/area8975-ui-pagination.mjs +152 -0
- package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
- package/fesm2022/area8975-ui-private.mjs +63 -0
- package/fesm2022/area8975-ui-private.mjs.map +1 -0
- package/fesm2022/area8975-ui-progress.mjs +307 -0
- package/fesm2022/area8975-ui-progress.mjs.map +1 -0
- package/fesm2022/area8975-ui-radio.mjs +199 -0
- package/fesm2022/area8975-ui-radio.mjs.map +1 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
- package/fesm2022/area8975-ui-search.mjs +266 -0
- package/fesm2022/area8975-ui-search.mjs.map +1 -0
- package/fesm2022/area8975-ui-segmented.mjs +118 -0
- package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
- package/fesm2022/area8975-ui-select.mjs +926 -0
- package/fesm2022/area8975-ui-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar.mjs +109 -0
- package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
- package/fesm2022/area8975-ui-skeleton.mjs +116 -0
- package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
- package/fesm2022/area8975-ui-stat.mjs +55 -0
- package/fesm2022/area8975-ui-stat.mjs.map +1 -0
- package/fesm2022/area8975-ui-switch.mjs +132 -0
- package/fesm2022/area8975-ui-switch.mjs.map +1 -0
- package/fesm2022/area8975-ui-tab.mjs +217 -0
- package/fesm2022/area8975-ui-tab.mjs.map +1 -0
- package/fesm2022/area8975-ui-table-filters.mjs +499 -0
- package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
- package/fesm2022/area8975-ui-table.mjs +1237 -0
- package/fesm2022/area8975-ui-table.mjs.map +1 -0
- package/fesm2022/area8975-ui-textarea.mjs +375 -0
- package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
- package/fesm2022/area8975-ui-theme.mjs +246 -0
- package/fesm2022/area8975-ui-theme.mjs.map +1 -0
- package/fesm2022/area8975-ui-time-select.mjs +170 -0
- package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-toast.mjs +269 -0
- package/fesm2022/area8975-ui-toast.mjs.map +1 -0
- package/fesm2022/area8975-ui-toaster.mjs +117 -0
- package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
- package/fesm2022/area8975-ui-tooltip.mjs +196 -0
- package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
- package/fesm2022/area8975-ui-user-menu.mjs +186 -0
- package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui.mjs +0 -16520
- package/package.json +237 -1
- package/types/area8975-ui-alert.d.ts +25 -0
- package/types/area8975-ui-avatar.d.ts +40 -0
- package/types/area8975-ui-badge.d.ts +31 -0
- package/types/area8975-ui-button.d.ts +129 -0
- package/types/area8975-ui-calendar.d.ts +177 -0
- package/types/area8975-ui-card-header.d.ts +28 -0
- package/types/area8975-ui-card.d.ts +18 -0
- package/types/area8975-ui-chart-palette.d.ts +176 -0
- package/types/area8975-ui-charts.d.ts +747 -0
- package/types/area8975-ui-checkbox.d.ts +61 -0
- package/types/area8975-ui-colour.d.ts +31 -0
- package/types/area8975-ui-container.d.ts +5 -0
- package/types/area8975-ui-counter.d.ts +43 -0
- package/types/area8975-ui-date-range-picker.d.ts +132 -0
- package/types/area8975-ui-datepicker.d.ts +124 -0
- package/types/area8975-ui-disclosure.d.ts +79 -0
- package/types/area8975-ui-drawer.d.ts +25 -0
- package/types/area8975-ui-dropdown-button.d.ts +32 -0
- package/types/area8975-ui-dropdown-menu.d.ts +25 -0
- package/types/area8975-ui-dropdown.d.ts +56 -0
- package/types/area8975-ui-dropzone.d.ts +96 -0
- package/types/area8975-ui-field.d.ts +72 -0
- package/types/area8975-ui-file-input.d.ts +72 -0
- package/types/area8975-ui-file.d.ts +21 -0
- package/types/area8975-ui-format.d.ts +37 -0
- package/types/area8975-ui-input-addon.d.ts +10 -0
- package/types/area8975-ui-input-group.d.ts +18 -0
- package/types/area8975-ui-input.d.ts +224 -0
- package/types/area8975-ui-kpi.d.ts +36 -0
- package/types/area8975-ui-layout.d.ts +7 -0
- package/types/area8975-ui-loading.d.ts +16 -0
- package/types/area8975-ui-modal-close-btn.d.ts +14 -0
- package/types/area8975-ui-modal.d.ts +45 -0
- package/types/area8975-ui-money.d.ts +77 -0
- package/types/area8975-ui-overlay.d.ts +75 -0
- package/types/area8975-ui-pagination.d.ts +27 -0
- package/types/area8975-ui-private.d.ts +20 -0
- package/types/area8975-ui-progress.d.ts +127 -0
- package/types/area8975-ui-radio.d.ts +61 -0
- package/types/area8975-ui-rich-text-editor.d.ts +165 -0
- package/types/area8975-ui-search.d.ts +56 -0
- package/types/area8975-ui-segmented.d.ts +41 -0
- package/types/area8975-ui-select.d.ts +293 -0
- package/types/area8975-ui-sidebar-group.d.ts +15 -0
- package/types/area8975-ui-sidebar-item.d.ts +20 -0
- package/types/area8975-ui-sidebar.d.ts +16 -0
- package/types/area8975-ui-skeleton.d.ts +35 -0
- package/types/area8975-ui-stat.d.ts +13 -0
- package/types/area8975-ui-switch.d.ts +32 -0
- package/types/area8975-ui-tab.d.ts +45 -0
- package/types/area8975-ui-table-filters.d.ts +138 -0
- package/types/area8975-ui-table.d.ts +371 -0
- package/types/area8975-ui-textarea.d.ts +126 -0
- package/types/area8975-ui-theme.d.ts +61 -0
- package/types/area8975-ui-time-select.d.ts +35 -0
- package/types/area8975-ui-toast.d.ts +78 -0
- package/types/area8975-ui-toaster.d.ts +23 -0
- package/types/area8975-ui-tooltip.d.ts +47 -0
- package/types/area8975-ui-user-menu.d.ts +39 -0
- package/types/area8975-ui.d.ts +1 -4546
- package/fesm2022/area8975-ui.mjs.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, input } from "@angular/core";
|
|
3
|
+
var UiStatComponent = class UiStatComponent {
|
|
4
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
5
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
6
|
+
minVersion: "12.0.0",
|
|
7
|
+
version: "22.2.1",
|
|
8
|
+
ngImport: i0,
|
|
9
|
+
type: UiStatComponent,
|
|
10
|
+
deps: [],
|
|
11
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
12
|
+
});
|
|
13
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
14
|
+
minVersion: "17.1.0",
|
|
15
|
+
version: "22.2.1",
|
|
16
|
+
type: UiStatComponent,
|
|
17
|
+
isStandalone: true,
|
|
18
|
+
selector: "ui-stat",
|
|
19
|
+
inputs: { label: {
|
|
20
|
+
classPropertyName: "label",
|
|
21
|
+
publicName: "label",
|
|
22
|
+
isSignal: true,
|
|
23
|
+
isRequired: true,
|
|
24
|
+
transformFunction: null
|
|
25
|
+
} },
|
|
26
|
+
host: { classAttribute: "block min-w-0" },
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
template: "<dl>\n <dt class=\"text-muted-foreground-1 ui-text-body-alt\">{{ label() }}</dt>\n <dd class=\"flex flex-wrap items-center gap-x-2 gap-y-1 mt-1\">\n <span class=\"font-semibold text-foreground ui-text-h3\">\n <ng-content />\n </span>\n <ng-content select=\"[stat-change]\" />\n </dd>\n <dd class=\"empty:hidden mt-1 text-muted-foreground-1 ui-text-caption\"><ng-content select=\"[stat-note]\" /></dd>\n</dl>\n"
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
32
|
+
minVersion: "12.0.0",
|
|
33
|
+
version: "22.2.1",
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
type: UiStatComponent,
|
|
36
|
+
decorators: [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{
|
|
39
|
+
selector: "ui-stat",
|
|
40
|
+
host: { class: "block min-w-0" },
|
|
41
|
+
template: "<dl>\n <dt class=\"text-muted-foreground-1 ui-text-body-alt\">{{ label() }}</dt>\n <dd class=\"flex flex-wrap items-center gap-x-2 gap-y-1 mt-1\">\n <span class=\"font-semibold text-foreground ui-text-h3\">\n <ng-content />\n </span>\n <ng-content select=\"[stat-change]\" />\n </dd>\n <dd class=\"empty:hidden mt-1 text-muted-foreground-1 ui-text-caption\"><ng-content select=\"[stat-note]\" /></dd>\n</dl>\n"
|
|
42
|
+
}]
|
|
43
|
+
}],
|
|
44
|
+
propDecorators: { label: [{
|
|
45
|
+
type: i0.Input,
|
|
46
|
+
args: [{
|
|
47
|
+
isSignal: true,
|
|
48
|
+
alias: "label",
|
|
49
|
+
required: true
|
|
50
|
+
}]
|
|
51
|
+
}] }
|
|
52
|
+
});
|
|
53
|
+
export { UiStatComponent };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=area8975-ui-stat.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area8975-ui-stat.mjs","names":[],"sources":["../../../projects/ui/stat/stat.component.ts","../../../projects/ui/stat/stat.component.html"],"sourcesContent":["import { Component, input } from '@angular/core';\n\n\n/** Each stat is its own `dl`, so wrap a row of them in a plain div. */\n@Component({\n selector: 'ui-stat',\n templateUrl: './stat.component.html',\n host: { class: 'block min-w-0' }\n})\nexport class UiStatComponent {\n readonly label = input.required<string>();\n}\n","<dl>\n <dt class=\"text-muted-foreground-1 ui-text-body-alt\">{{ label() }}</dt>\n <dd class=\"flex flex-wrap items-center gap-x-2 gap-y-1 mt-1\">\n <span class=\"font-semibold text-foreground ui-text-h3\">\n <ng-content />\n </span>\n <ng-content select=\"[stat-change]\" />\n </dd>\n <dd class=\"empty:hidden mt-1 text-muted-foreground-1 ui-text-caption\"><ng-content select=\"[stat-note]\" /></dd>\n</dl>\n"],"mappings":";;AASA,IAAa,kBAAb,MAAa,gBAAe;CACf,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CADhC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAf,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAe,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,OAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,gBAAA,gBAAA;EAAA,UAAA;EAAA,UCT5B;CAUA,CAAA;;ADDa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAL3B,MAAA;EACa,MAAA,CAAA;GAAA,UAAA;GAAS,MAEb,EAAE,OAAO,gBAAe;GAAE,UAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, booleanAttribute, input, model } from "@angular/core";
|
|
3
|
+
import { UiCheckboxComponent } from "@area8975/ui/checkbox";
|
|
4
|
+
var UiSwitchComponent = class UiSwitchComponent {
|
|
5
|
+
value = model.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
6
|
+
id = input("", ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
7
|
+
name = input("", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
8
|
+
disabled = input(false, {
|
|
9
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
10
|
+
transform: booleanAttribute
|
|
11
|
+
});
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
|
+
minVersion: "12.0.0",
|
|
14
|
+
version: "22.2.1",
|
|
15
|
+
ngImport: i0,
|
|
16
|
+
type: UiSwitchComponent,
|
|
17
|
+
deps: [],
|
|
18
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
19
|
+
});
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
21
|
+
minVersion: "17.1.0",
|
|
22
|
+
version: "22.2.1",
|
|
23
|
+
type: UiSwitchComponent,
|
|
24
|
+
isStandalone: true,
|
|
25
|
+
selector: "ui-switch",
|
|
26
|
+
inputs: {
|
|
27
|
+
value: {
|
|
28
|
+
classPropertyName: "value",
|
|
29
|
+
publicName: "value",
|
|
30
|
+
isSignal: true,
|
|
31
|
+
isRequired: true,
|
|
32
|
+
transformFunction: null
|
|
33
|
+
},
|
|
34
|
+
id: {
|
|
35
|
+
classPropertyName: "id",
|
|
36
|
+
publicName: "id",
|
|
37
|
+
isSignal: true,
|
|
38
|
+
isRequired: false,
|
|
39
|
+
transformFunction: null
|
|
40
|
+
},
|
|
41
|
+
name: {
|
|
42
|
+
classPropertyName: "name",
|
|
43
|
+
publicName: "name",
|
|
44
|
+
isSignal: true,
|
|
45
|
+
isRequired: false,
|
|
46
|
+
transformFunction: null
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
classPropertyName: "disabled",
|
|
50
|
+
publicName: "disabled",
|
|
51
|
+
isSignal: true,
|
|
52
|
+
isRequired: false,
|
|
53
|
+
transformFunction: null
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
outputs: { value: "valueChange" },
|
|
57
|
+
host: { properties: { "attr.id": "null" } },
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
template: "<label class=\"inline-flex items-center gap-2 cursor-pointer\" [class.opacity-50]=\"disabled()\">\n <span class=\"relative inline-flex items-center rounded-full focus-within:ring-2 focus-within:ring-primary-200/50\">\n <!--\n reuses ui-checkbox for the real state/behaviour, class-bound track/thumb below\n react to value() directly instead of peer-checked, since peer-* relies on the\n input and the styled element being real DOM siblings, which breaks once the\n input is nested inside ui-checkbox's own host element\n -->\n <ui-checkbox\n [(value)]=\"value\"\n [disabled]=\"disabled()\"\n [id]=\"id()\"\n [name]=\"name()\"\n classes=\"sr-only\"\n />\n\n <span\n class=\"w-9 h-5 rounded-full transition-colors\"\n [class.bg-primary-600]=\"value()\"\n [class.bg-surface-1]=\"!value()\"\n ></span>\n\n <span\n class=\"absolute left-0.5 size-4 rounded-full bg-white shadow transition-transform\"\n [class.translate-x-4]=\"value()\"\n ></span>\n </span>\n\n <ng-content />\n</label>\n",
|
|
60
|
+
dependencies: [{
|
|
61
|
+
kind: "component",
|
|
62
|
+
type: UiCheckboxComponent,
|
|
63
|
+
selector: "ui-checkbox",
|
|
64
|
+
inputs: [
|
|
65
|
+
"value",
|
|
66
|
+
"id",
|
|
67
|
+
"name",
|
|
68
|
+
"required",
|
|
69
|
+
"disabled",
|
|
70
|
+
"indeterminate",
|
|
71
|
+
"validationState",
|
|
72
|
+
"classes"
|
|
73
|
+
],
|
|
74
|
+
outputs: ["valueChange", "validationStateChange"]
|
|
75
|
+
}]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
79
|
+
minVersion: "12.0.0",
|
|
80
|
+
version: "22.2.1",
|
|
81
|
+
ngImport: i0,
|
|
82
|
+
type: UiSwitchComponent,
|
|
83
|
+
decorators: [{
|
|
84
|
+
type: Component,
|
|
85
|
+
args: [{
|
|
86
|
+
selector: "ui-switch",
|
|
87
|
+
imports: [UiCheckboxComponent],
|
|
88
|
+
host: { "[attr.id]": "null" },
|
|
89
|
+
template: "<label class=\"inline-flex items-center gap-2 cursor-pointer\" [class.opacity-50]=\"disabled()\">\n <span class=\"relative inline-flex items-center rounded-full focus-within:ring-2 focus-within:ring-primary-200/50\">\n <!--\n reuses ui-checkbox for the real state/behaviour, class-bound track/thumb below\n react to value() directly instead of peer-checked, since peer-* relies on the\n input and the styled element being real DOM siblings, which breaks once the\n input is nested inside ui-checkbox's own host element\n -->\n <ui-checkbox\n [(value)]=\"value\"\n [disabled]=\"disabled()\"\n [id]=\"id()\"\n [name]=\"name()\"\n classes=\"sr-only\"\n />\n\n <span\n class=\"w-9 h-5 rounded-full transition-colors\"\n [class.bg-primary-600]=\"value()\"\n [class.bg-surface-1]=\"!value()\"\n ></span>\n\n <span\n class=\"absolute left-0.5 size-4 rounded-full bg-white shadow transition-transform\"\n [class.translate-x-4]=\"value()\"\n ></span>\n </span>\n\n <ng-content />\n</label>\n"
|
|
90
|
+
}]
|
|
91
|
+
}],
|
|
92
|
+
propDecorators: {
|
|
93
|
+
value: [{
|
|
94
|
+
type: i0.Input,
|
|
95
|
+
args: [{
|
|
96
|
+
isSignal: true,
|
|
97
|
+
alias: "value",
|
|
98
|
+
required: true
|
|
99
|
+
}]
|
|
100
|
+
}, {
|
|
101
|
+
type: i0.Output,
|
|
102
|
+
args: ["valueChange"]
|
|
103
|
+
}],
|
|
104
|
+
id: [{
|
|
105
|
+
type: i0.Input,
|
|
106
|
+
args: [{
|
|
107
|
+
isSignal: true,
|
|
108
|
+
alias: "id",
|
|
109
|
+
required: false
|
|
110
|
+
}]
|
|
111
|
+
}],
|
|
112
|
+
name: [{
|
|
113
|
+
type: i0.Input,
|
|
114
|
+
args: [{
|
|
115
|
+
isSignal: true,
|
|
116
|
+
alias: "name",
|
|
117
|
+
required: false
|
|
118
|
+
}]
|
|
119
|
+
}],
|
|
120
|
+
disabled: [{
|
|
121
|
+
type: i0.Input,
|
|
122
|
+
args: [{
|
|
123
|
+
isSignal: true,
|
|
124
|
+
alias: "disabled",
|
|
125
|
+
required: false
|
|
126
|
+
}]
|
|
127
|
+
}]
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export { UiSwitchComponent };
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=area8975-ui-switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area8975-ui-switch.mjs","names":[],"sources":["../../../projects/ui/switch/switch.component.ts","../../../projects/ui/switch/switch.component.html"],"sourcesContent":["import { booleanAttribute, Component, input, model } from '@angular/core';\n\nimport { UiCheckboxComponent } from '@area8975/ui/checkbox';\n\n\n// restyles ui-checkbox into a track-and-thumb switch, same behaviour underneath\n@Component({\n selector: 'ui-switch',\n templateUrl: './switch.component.html',\n imports: [UiCheckboxComponent],\n host: { '[attr.id]': 'null' }\n})\nexport class UiSwitchComponent {\n readonly value = model.required<boolean>();\n\n readonly id = input<string>('');\n readonly name = input<string>('');\n readonly disabled = input(false, { transform: booleanAttribute });\n}\n","<label class=\"inline-flex items-center gap-2 cursor-pointer\" [class.opacity-50]=\"disabled()\">\n <span class=\"relative inline-flex items-center rounded-full focus-within:ring-2 focus-within:ring-primary-200/50\">\n <!--\n reuses ui-checkbox for the real state/behaviour, class-bound track/thumb below\n react to value() directly instead of peer-checked, since peer-* relies on the\n input and the styled element being real DOM siblings, which breaks once the\n input is nested inside ui-checkbox's own host element\n -->\n <ui-checkbox\n [(value)]=\"value\"\n [disabled]=\"disabled()\"\n [id]=\"id()\"\n [name]=\"name()\"\n classes=\"sr-only\"\n />\n\n <span\n class=\"w-9 h-5 rounded-full transition-colors\"\n [class.bg-primary-600]=\"value()\"\n [class.bg-surface-1]=\"!value()\"\n ></span>\n\n <span\n class=\"absolute left-0.5 size-4 rounded-full bg-white shadow transition-transform\"\n [class.translate-x-4]=\"value()\"\n ></span>\n </span>\n\n <ng-content />\n</label>\n"],"mappings":";;;AAYA,IAAa,oBAAb,MAAa,kBAAiB;CACjB,QAAQ,MAAM,SAAmB,GAAA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,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EAN7B,MAAA;EACa,MAAA,CAAA;GAAA,UAAA;GAAW,SAEZ,CAAC,mBAAmB;GAAC,MACxB,EAAE,aAAa,OAAM;GAAE,UAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, Directive, booleanAttribute, computed, contentChild, contentChildren, effect, input, model, signal } from "@angular/core";
|
|
4
|
+
import { UiButtonComponent } from "@area8975/ui/button";
|
|
5
|
+
var UiTabDirective = class UiTabDirective {
|
|
6
|
+
label = input.required({
|
|
7
|
+
...ngDevMode ? { debugName: "label" } : /* istanbul ignore next */ {},
|
|
8
|
+
alias: "uiTab"
|
|
9
|
+
});
|
|
10
|
+
disabled = input(false, {
|
|
11
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
12
|
+
transform: booleanAttribute
|
|
13
|
+
});
|
|
14
|
+
active = model(false, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
16
|
+
minVersion: "12.0.0",
|
|
17
|
+
version: "22.2.1",
|
|
18
|
+
ngImport: i0,
|
|
19
|
+
type: UiTabDirective,
|
|
20
|
+
deps: [],
|
|
21
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
22
|
+
});
|
|
23
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
24
|
+
minVersion: "17.1.0",
|
|
25
|
+
version: "22.2.1",
|
|
26
|
+
type: UiTabDirective,
|
|
27
|
+
isStandalone: true,
|
|
28
|
+
selector: "[uiTab]",
|
|
29
|
+
inputs: {
|
|
30
|
+
label: {
|
|
31
|
+
classPropertyName: "label",
|
|
32
|
+
publicName: "uiTab",
|
|
33
|
+
isSignal: true,
|
|
34
|
+
isRequired: true,
|
|
35
|
+
transformFunction: null
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
classPropertyName: "disabled",
|
|
39
|
+
publicName: "disabled",
|
|
40
|
+
isSignal: true,
|
|
41
|
+
isRequired: false,
|
|
42
|
+
transformFunction: null
|
|
43
|
+
},
|
|
44
|
+
active: {
|
|
45
|
+
classPropertyName: "active",
|
|
46
|
+
publicName: "active",
|
|
47
|
+
isSignal: true,
|
|
48
|
+
isRequired: false,
|
|
49
|
+
transformFunction: null
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
outputs: { active: "activeChange" },
|
|
53
|
+
host: { properties: { "hidden": "!active()" } },
|
|
54
|
+
ngImport: i0
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
58
|
+
minVersion: "12.0.0",
|
|
59
|
+
version: "22.2.1",
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
type: UiTabDirective,
|
|
62
|
+
decorators: [{
|
|
63
|
+
type: Directive,
|
|
64
|
+
args: [{
|
|
65
|
+
selector: "[uiTab]",
|
|
66
|
+
host: { "[hidden]": "!active()" }
|
|
67
|
+
}]
|
|
68
|
+
}],
|
|
69
|
+
propDecorators: {
|
|
70
|
+
label: [{
|
|
71
|
+
type: i0.Input,
|
|
72
|
+
args: [{
|
|
73
|
+
isSignal: true,
|
|
74
|
+
alias: "uiTab",
|
|
75
|
+
required: true
|
|
76
|
+
}]
|
|
77
|
+
}],
|
|
78
|
+
disabled: [{
|
|
79
|
+
type: i0.Input,
|
|
80
|
+
args: [{
|
|
81
|
+
isSignal: true,
|
|
82
|
+
alias: "disabled",
|
|
83
|
+
required: false
|
|
84
|
+
}]
|
|
85
|
+
}],
|
|
86
|
+
active: [{
|
|
87
|
+
type: i0.Input,
|
|
88
|
+
args: [{
|
|
89
|
+
isSignal: true,
|
|
90
|
+
alias: "active",
|
|
91
|
+
required: false
|
|
92
|
+
}]
|
|
93
|
+
}, {
|
|
94
|
+
type: i0.Output,
|
|
95
|
+
args: ["activeChange"]
|
|
96
|
+
}]
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var UiTabComponent = class UiTabComponent {
|
|
100
|
+
tabs = contentChildren(UiTabDirective, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
101
|
+
selectedIndex = signal(0, ...ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []);
|
|
102
|
+
actions = contentChild("actions", ...ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []);
|
|
103
|
+
appearance = input("solid", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
|
|
104
|
+
generatedButtonClasses = computed(() => [`ui-tab-button--${this.appearance()}`, "font-medium"].filter(Boolean).join(" "), ...ngDevMode ? [{ debugName: "generatedButtonClasses" }] : /* istanbul ignore next */ []);
|
|
105
|
+
constructor() {
|
|
106
|
+
effect(() => {
|
|
107
|
+
const tabs = this.tabs();
|
|
108
|
+
if (!tabs.length || tabs.some((tab) => tab.active())) return;
|
|
109
|
+
tabs[0].active.set(true);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
select(index) {
|
|
113
|
+
const tabs = this.tabs();
|
|
114
|
+
const target = tabs[index];
|
|
115
|
+
if (!target || target.disabled()) return;
|
|
116
|
+
tabs.forEach((tab, i) => tab.active.set(i === index));
|
|
117
|
+
}
|
|
118
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
119
|
+
minVersion: "12.0.0",
|
|
120
|
+
version: "22.2.1",
|
|
121
|
+
ngImport: i0,
|
|
122
|
+
type: UiTabComponent,
|
|
123
|
+
deps: [],
|
|
124
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
125
|
+
});
|
|
126
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
127
|
+
minVersion: "17.0.0",
|
|
128
|
+
version: "22.2.1",
|
|
129
|
+
type: UiTabComponent,
|
|
130
|
+
isStandalone: true,
|
|
131
|
+
selector: "ui-tab",
|
|
132
|
+
inputs: { appearance: {
|
|
133
|
+
classPropertyName: "appearance",
|
|
134
|
+
publicName: "appearance",
|
|
135
|
+
isSignal: true,
|
|
136
|
+
isRequired: false,
|
|
137
|
+
transformFunction: null
|
|
138
|
+
} },
|
|
139
|
+
host: { classAttribute: "block" },
|
|
140
|
+
queries: [{
|
|
141
|
+
propertyName: "tabs",
|
|
142
|
+
predicate: UiTabDirective,
|
|
143
|
+
isSignal: true
|
|
144
|
+
}, {
|
|
145
|
+
propertyName: "actions",
|
|
146
|
+
first: true,
|
|
147
|
+
predicate: ["actions"],
|
|
148
|
+
descendants: true,
|
|
149
|
+
isSignal: true
|
|
150
|
+
}],
|
|
151
|
+
ngImport: i0,
|
|
152
|
+
template: "<div class=\"flex\" role=\"tablist\">\n <div class=\"flex justify-between w-full\">\n <nav class=\"flex gap-x-2.5\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ui-button\n role=\"tab\"\n appearance=\"none\"\n [classes]=\"generatedButtonClasses()\"\n [disabled]=\"tab.disabled()\"\n [class.active]=\"tab.active()\"\n (click)=\"select(i)\"\n >\n {{ tab.label() }}\n </ui-button>\n }\n </nav>\n <div class=\"flex gap-x-2.5\">\n <ng-container *ngTemplateOutlet=\"actions()\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n",
|
|
153
|
+
styles: ["@layer properties;::ng-deep .ui-tab-button--solid{border-color:transparent;background-color:transparent;color:var(--color-primary-500, var(--color-blue-500));--tw-ring-color: var(--color-primary-600, var(--color-blue-600));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)))!important;transition-duration:var(--tw-duration, var(--default-transition-duration, .15s))!important}::ng-deep .active>.ui-tab-button--solid{border-color:var(--color-primary-600, var(--color-blue-600));background-color:var(--color-primary-600, var(--color-blue-600));color:var(--color-white, #fff)}::ng-deep .ui-tab-button--underline{border-radius:0!important;border-bottom-style:var(--tw-border-style)!important;border-bottom-width:2px!important;border-color:transparent;background-color:transparent;color:var(--foreground)}::ng-deep .active>.ui-tab-button--underline{border-bottom-color:var(--color-primary-600, var(--color-blue-600));color:var(--color-primary-600, var(--color-blue-600))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
154
|
+
dependencies: [{
|
|
155
|
+
kind: "component",
|
|
156
|
+
type: UiButtonComponent,
|
|
157
|
+
selector: "ui-button",
|
|
158
|
+
inputs: [
|
|
159
|
+
"appearance",
|
|
160
|
+
"intent",
|
|
161
|
+
"size",
|
|
162
|
+
"classes",
|
|
163
|
+
"type",
|
|
164
|
+
"ariaLabel",
|
|
165
|
+
"disabled",
|
|
166
|
+
"loading"
|
|
167
|
+
]
|
|
168
|
+
}, {
|
|
169
|
+
kind: "directive",
|
|
170
|
+
type: NgTemplateOutlet,
|
|
171
|
+
selector: "[ngTemplateOutlet]",
|
|
172
|
+
inputs: [
|
|
173
|
+
"ngTemplateOutletContext",
|
|
174
|
+
"ngTemplateOutlet",
|
|
175
|
+
"ngTemplateOutletInjector"
|
|
176
|
+
]
|
|
177
|
+
}]
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
181
|
+
minVersion: "12.0.0",
|
|
182
|
+
version: "22.2.1",
|
|
183
|
+
ngImport: i0,
|
|
184
|
+
type: UiTabComponent,
|
|
185
|
+
decorators: [{
|
|
186
|
+
type: Component,
|
|
187
|
+
args: [{
|
|
188
|
+
selector: "ui-tab",
|
|
189
|
+
imports: [UiButtonComponent, NgTemplateOutlet],
|
|
190
|
+
host: { class: "block" },
|
|
191
|
+
template: "<div class=\"flex\" role=\"tablist\">\n <div class=\"flex justify-between w-full\">\n <nav class=\"flex gap-x-2.5\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ui-button\n role=\"tab\"\n appearance=\"none\"\n [classes]=\"generatedButtonClasses()\"\n [disabled]=\"tab.disabled()\"\n [class.active]=\"tab.active()\"\n (click)=\"select(i)\"\n >\n {{ tab.label() }}\n </ui-button>\n }\n </nav>\n <div class=\"flex gap-x-2.5\">\n <ng-container *ngTemplateOutlet=\"actions()\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n",
|
|
192
|
+
styles: ["@layer properties;::ng-deep .ui-tab-button--solid{border-color:transparent;background-color:transparent;color:var(--color-primary-500, var(--color-blue-500));--tw-ring-color: var(--color-primary-600, var(--color-blue-600));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)))!important;transition-duration:var(--tw-duration, var(--default-transition-duration, .15s))!important}::ng-deep .active>.ui-tab-button--solid{border-color:var(--color-primary-600, var(--color-blue-600));background-color:var(--color-primary-600, var(--color-blue-600));color:var(--color-white, #fff)}::ng-deep .ui-tab-button--underline{border-radius:0!important;border-bottom-style:var(--tw-border-style)!important;border-bottom-width:2px!important;border-color:transparent;background-color:transparent;color:var(--foreground)}::ng-deep .active>.ui-tab-button--underline{border-bottom-color:var(--color-primary-600, var(--color-blue-600));color:var(--color-primary-600, var(--color-blue-600))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
193
|
+
}]
|
|
194
|
+
}],
|
|
195
|
+
ctorParameters: () => [],
|
|
196
|
+
propDecorators: {
|
|
197
|
+
tabs: [{
|
|
198
|
+
type: i0.ContentChildren,
|
|
199
|
+
args: [i0.forwardRef(() => UiTabDirective), { isSignal: true }]
|
|
200
|
+
}],
|
|
201
|
+
actions: [{
|
|
202
|
+
type: i0.ContentChild,
|
|
203
|
+
args: ["actions", { isSignal: true }]
|
|
204
|
+
}],
|
|
205
|
+
appearance: [{
|
|
206
|
+
type: i0.Input,
|
|
207
|
+
args: [{
|
|
208
|
+
isSignal: true,
|
|
209
|
+
alias: "appearance",
|
|
210
|
+
required: false
|
|
211
|
+
}]
|
|
212
|
+
}]
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
export { UiTabComponent, UiTabDirective };
|
|
216
|
+
|
|
217
|
+
//# sourceMappingURL=area8975-ui-tab.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area8975-ui-tab.mjs","names":[],"sources":["../../../projects/ui/tab/tab.directive.ts","../../../projects/ui/tab/tab.component.ts","../../../projects/ui/tab/tab.component.html"],"sourcesContent":["import { booleanAttribute, Directive, input, model } from '@angular/core';\n\n\n@Directive({\n selector: '[uiTab]',\n host: { '[hidden]': '!active()' }\n})\nexport class UiTabDirective {\n label = input.required<string>({ alias: 'uiTab' });\n disabled = input(false, { transform: booleanAttribute });\n active = model<boolean>(false);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChild,\n contentChildren,\n effect,\n input,\n signal,\n TemplateRef\n} from '@angular/core';\n\nimport { UiButtonComponent } from '@area8975/ui/button';\n\nimport { UiTabDirective } from './tab.directive';\n\n\nexport type TabButtonAppearance =\n | 'solid'\n | 'underline';\n\n@Component({\n selector: 'ui-tab',\n templateUrl: './tab.component.html',\n styleUrl: './tab.component.css',\n imports: [UiButtonComponent, NgTemplateOutlet],\n host: { class: 'block' }\n})\nexport class UiTabComponent {\n readonly tabs = contentChildren(UiTabDirective);\n readonly selectedIndex = signal<number>(0);\n readonly actions = contentChild<TemplateRef<unknown>>('actions');\n\n readonly appearance = input<TabButtonAppearance>('solid');\n\n readonly generatedButtonClasses = computed(() =>\n [\n `ui-tab-button--${this.appearance()}`,\n 'font-medium'\n ]\n .filter(Boolean)\n .join(' ')\n );\n\n constructor() {\n effect(() => {\n const tabs = this.tabs();\n if (!tabs.length || tabs.some(tab => tab.active())) { return; }\n\n tabs[0].active.set(true);\n });\n }\n\n select(index: number) {\n const tabs = this.tabs();\n\n const target = tabs[index];\n if (!target || target.disabled()) { return; }\n\n tabs.forEach((tab, i) => tab.active.set(i === index));\n }\n}\n","<div class=\"flex\" role=\"tablist\">\n <div class=\"flex justify-between w-full\">\n <nav class=\"flex gap-x-2.5\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ui-button\n role=\"tab\"\n appearance=\"none\"\n [classes]=\"generatedButtonClasses()\"\n [disabled]=\"tab.disabled()\"\n [class.active]=\"tab.active()\"\n (click)=\"select(i)\"\n >\n {{ tab.label() }}\n </ui-button>\n }\n </nav>\n <div class=\"flex gap-x-2.5\">\n <ng-container *ngTemplateOutlet=\"actions()\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"],"mappings":";;;;AAOA,IAAa,iBAAb,MAAa,eAAc;CACvB,QAAQ,MAAM,SAAQ;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAW,OAAO;CAAO,CAAA;CAC/C,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,SAAS,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAHrB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,QAAA,eAAA;EAAA,MAAA,EAAA,YAAA,EAAA,UAAA,YAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAJ1B,MAAA;EAAU,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