@akcelik/strct 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3157,6 +3157,145 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
3157
3157
|
`, host: { class: 'strct-pg', role: 'navigation', 'aria-label': 'Pagination' }, styles: [".strct-pg{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--t2)}.strct-pg__btn{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:30px;padding:0 7px;border-radius:6px;font-family:var(--font);font-size:12px;cursor:pointer;color:var(--t2);background:transparent;border:1px solid transparent;transition:background .14s ease,border-color .14s ease,color .14s ease}.strct-pg__btn:hover{background:var(--bg-3)}.strct-pg__btn--active{color:var(--acc);border-color:var(--acc30);background:var(--acc-m)}.strct-pg__btn:disabled{color:var(--t4);cursor:not-allowed;background:transparent}.strct-pg__nav{color:var(--t2)}.strct-pg__dots{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:30px;color:var(--t3)}\n"] }]
|
|
3158
3158
|
}], propDecorators: { total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }] } });
|
|
3159
3159
|
|
|
3160
|
+
/**
|
|
3161
|
+
* A two-level navigation menu: categories (level 1) each holding a flat list of
|
|
3162
|
+
* items (level 2) — not a tree. Categories can be collapsible (chevrons) or
|
|
3163
|
+
* static section labels, and item/category icons can be hidden.
|
|
3164
|
+
*
|
|
3165
|
+
* <strct-section-menu [sections]="nav" [(activeId)]="active"
|
|
3166
|
+
* [collapsible]="true" [showIcons]="true"
|
|
3167
|
+
* (select)="go($event)" />
|
|
3168
|
+
*/
|
|
3169
|
+
class StrctSectionMenu {
|
|
3170
|
+
/** Categories with their items (max two levels). */
|
|
3171
|
+
sections = input.required(...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
|
|
3172
|
+
/** Active item id (two-way). */
|
|
3173
|
+
activeId = model(null, ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
|
|
3174
|
+
/** Categories collapse via a chevron; `false` renders static section labels. */
|
|
3175
|
+
collapsible = input(true, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3176
|
+
/** Show category / item icons. */
|
|
3177
|
+
showIcons = input(true, { ...(ngDevMode ? { debugName: "showIcons" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3178
|
+
/** Accessible label for the nav landmark. */
|
|
3179
|
+
ariaLabel = input('Sections', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3180
|
+
/** Emitted when an item is chosen. */
|
|
3181
|
+
select = output();
|
|
3182
|
+
/** Per-section open overrides (keyed by label); absent ⇒ use `expanded`. */
|
|
3183
|
+
overrides = signal(new Map(), ...(ngDevMode ? [{ debugName: "overrides" }] : /* istanbul ignore next */ []));
|
|
3184
|
+
isOpen(sec) {
|
|
3185
|
+
if (!this.collapsible())
|
|
3186
|
+
return true;
|
|
3187
|
+
return this.overrides().get(sec.label) ?? sec.expanded !== false;
|
|
3188
|
+
}
|
|
3189
|
+
toggle(sec) {
|
|
3190
|
+
const open = this.isOpen(sec);
|
|
3191
|
+
const next = new Map(this.overrides());
|
|
3192
|
+
next.set(sec.label, !open);
|
|
3193
|
+
this.overrides.set(next);
|
|
3194
|
+
}
|
|
3195
|
+
pick(item) {
|
|
3196
|
+
if (item.disabled)
|
|
3197
|
+
return;
|
|
3198
|
+
this.activeId.set(item.id);
|
|
3199
|
+
this.select.emit(item);
|
|
3200
|
+
}
|
|
3201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StrctSectionMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: StrctSectionMenu, isStandalone: true, selector: "strct-section-menu", inputs: { sections: { classPropertyName: "sections", publicName: "sections", isSignal: true, isRequired: true, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, showIcons: { classPropertyName: "showIcons", publicName: "showIcons", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeId: "activeIdChange", select: "select" }, host: { classAttribute: "strct-sm-host" }, ngImport: i0, template: `
|
|
3203
|
+
<nav class="strct-sm" [attr.aria-label]="ariaLabel()">
|
|
3204
|
+
@for (sec of sections(); track sec.label) {
|
|
3205
|
+
<div class="strct-sm__section" [class.strct-sm__section--collapsible]="collapsible()">
|
|
3206
|
+
@if (collapsible()) {
|
|
3207
|
+
<button
|
|
3208
|
+
type="button"
|
|
3209
|
+
class="strct-sm__cat"
|
|
3210
|
+
[attr.aria-expanded]="isOpen(sec)"
|
|
3211
|
+
(click)="toggle(sec)"
|
|
3212
|
+
>
|
|
3213
|
+
<span class="strct-sm__chevron" [class.strct-sm__chevron--open]="isOpen(sec)">
|
|
3214
|
+
<strct-icon name="chevronRight" [size]="12" [strokeWidth]="1.7" />
|
|
3215
|
+
</span>
|
|
3216
|
+
@if (showIcons() && sec.icon) {
|
|
3217
|
+
<strct-icon class="strct-sm__cat-icon" [name]="sec.icon" [size]="15" [strokeWidth]="1.4" />
|
|
3218
|
+
}
|
|
3219
|
+
<span class="strct-sm__cat-label">{{ sec.label }}</span>
|
|
3220
|
+
</button>
|
|
3221
|
+
} @else {
|
|
3222
|
+
<div class="strct-sm__cat-static">{{ sec.label }}</div>
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
@if (isOpen(sec)) {
|
|
3226
|
+
<div class="strct-sm__items" role="group">
|
|
3227
|
+
@for (item of sec.items; track item.id) {
|
|
3228
|
+
<button
|
|
3229
|
+
type="button"
|
|
3230
|
+
class="strct-sm__item"
|
|
3231
|
+
[class.strct-sm__item--active]="item.id === activeId()"
|
|
3232
|
+
[disabled]="item.disabled"
|
|
3233
|
+
[attr.aria-current]="item.id === activeId() ? 'page' : null"
|
|
3234
|
+
(click)="pick(item)"
|
|
3235
|
+
>
|
|
3236
|
+
@if (showIcons() && item.icon) {
|
|
3237
|
+
<strct-icon class="strct-sm__item-icon" [name]="item.icon" [size]="15" [strokeWidth]="1.4" />
|
|
3238
|
+
}
|
|
3239
|
+
<span class="strct-sm__item-label">{{ item.label }}</span>
|
|
3240
|
+
</button>
|
|
3241
|
+
}
|
|
3242
|
+
</div>
|
|
3243
|
+
}
|
|
3244
|
+
</div>
|
|
3245
|
+
}
|
|
3246
|
+
</nav>
|
|
3247
|
+
`, isInline: true, styles: [".strct-sm{display:flex;flex-direction:column;gap:1px}.strct-sm__section--collapsible+.strct-sm__section--collapsible{margin-top:1px}.strct-sm__cat{display:flex;align-items:center;gap:8px;width:100%;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:var(--t2);font-size:13px;font-weight:500;font-family:var(--font);cursor:pointer;text-align:left;transition:background .13s ease,color .13s ease}.strct-sm__cat:hover{background:var(--bg-3);color:var(--t1)}.strct-sm__cat:focus-visible,.strct-sm__item:focus-visible{outline:2px solid var(--acc50);outline-offset:-2px}.strct-sm__chevron{display:inline-flex;color:var(--t3);flex-shrink:0;transition:transform .15s ease}.strct-sm__chevron--open{transform:rotate(90deg)}.strct-sm__cat-icon{color:var(--t3);flex-shrink:0}.strct-sm__cat-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.strct-sm__cat-static{padding:11px 10px 5px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--t3)}.strct-sm__items{display:flex;flex-direction:column}.strct-sm__item{display:flex;align-items:center;gap:9px;width:100%;padding:7px 10px;border:0;border-radius:6px;background:transparent;color:var(--t1);font-size:13px;font-family:var(--font);cursor:pointer;text-align:left;transition:background .13s ease}.strct-sm__section--collapsible .strct-sm__item{padding-left:31px}.strct-sm__item:hover:not(:disabled){background:var(--bg-3)}.strct-sm__item--active{background:var(--acc-m);color:var(--acc);font-weight:500}.strct-sm__item--active .strct-sm__item-icon{color:var(--acc)}.strct-sm__item:disabled{opacity:.5;cursor:not-allowed}.strct-sm__item-icon{color:var(--t2);flex-shrink:0}.strct-sm__item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: StrctIcon, selector: "strct-icon", inputs: ["name", "size", "strokeWidth", "badge", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3248
|
+
}
|
|
3249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: StrctSectionMenu, decorators: [{
|
|
3250
|
+
type: Component,
|
|
3251
|
+
args: [{ selector: 'strct-section-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [StrctIcon], template: `
|
|
3252
|
+
<nav class="strct-sm" [attr.aria-label]="ariaLabel()">
|
|
3253
|
+
@for (sec of sections(); track sec.label) {
|
|
3254
|
+
<div class="strct-sm__section" [class.strct-sm__section--collapsible]="collapsible()">
|
|
3255
|
+
@if (collapsible()) {
|
|
3256
|
+
<button
|
|
3257
|
+
type="button"
|
|
3258
|
+
class="strct-sm__cat"
|
|
3259
|
+
[attr.aria-expanded]="isOpen(sec)"
|
|
3260
|
+
(click)="toggle(sec)"
|
|
3261
|
+
>
|
|
3262
|
+
<span class="strct-sm__chevron" [class.strct-sm__chevron--open]="isOpen(sec)">
|
|
3263
|
+
<strct-icon name="chevronRight" [size]="12" [strokeWidth]="1.7" />
|
|
3264
|
+
</span>
|
|
3265
|
+
@if (showIcons() && sec.icon) {
|
|
3266
|
+
<strct-icon class="strct-sm__cat-icon" [name]="sec.icon" [size]="15" [strokeWidth]="1.4" />
|
|
3267
|
+
}
|
|
3268
|
+
<span class="strct-sm__cat-label">{{ sec.label }}</span>
|
|
3269
|
+
</button>
|
|
3270
|
+
} @else {
|
|
3271
|
+
<div class="strct-sm__cat-static">{{ sec.label }}</div>
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
@if (isOpen(sec)) {
|
|
3275
|
+
<div class="strct-sm__items" role="group">
|
|
3276
|
+
@for (item of sec.items; track item.id) {
|
|
3277
|
+
<button
|
|
3278
|
+
type="button"
|
|
3279
|
+
class="strct-sm__item"
|
|
3280
|
+
[class.strct-sm__item--active]="item.id === activeId()"
|
|
3281
|
+
[disabled]="item.disabled"
|
|
3282
|
+
[attr.aria-current]="item.id === activeId() ? 'page' : null"
|
|
3283
|
+
(click)="pick(item)"
|
|
3284
|
+
>
|
|
3285
|
+
@if (showIcons() && item.icon) {
|
|
3286
|
+
<strct-icon class="strct-sm__item-icon" [name]="item.icon" [size]="15" [strokeWidth]="1.4" />
|
|
3287
|
+
}
|
|
3288
|
+
<span class="strct-sm__item-label">{{ item.label }}</span>
|
|
3289
|
+
</button>
|
|
3290
|
+
}
|
|
3291
|
+
</div>
|
|
3292
|
+
}
|
|
3293
|
+
</div>
|
|
3294
|
+
}
|
|
3295
|
+
</nav>
|
|
3296
|
+
`, host: { class: 'strct-sm-host' }, styles: [".strct-sm{display:flex;flex-direction:column;gap:1px}.strct-sm__section--collapsible+.strct-sm__section--collapsible{margin-top:1px}.strct-sm__cat{display:flex;align-items:center;gap:8px;width:100%;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:var(--t2);font-size:13px;font-weight:500;font-family:var(--font);cursor:pointer;text-align:left;transition:background .13s ease,color .13s ease}.strct-sm__cat:hover{background:var(--bg-3);color:var(--t1)}.strct-sm__cat:focus-visible,.strct-sm__item:focus-visible{outline:2px solid var(--acc50);outline-offset:-2px}.strct-sm__chevron{display:inline-flex;color:var(--t3);flex-shrink:0;transition:transform .15s ease}.strct-sm__chevron--open{transform:rotate(90deg)}.strct-sm__cat-icon{color:var(--t3);flex-shrink:0}.strct-sm__cat-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.strct-sm__cat-static{padding:11px 10px 5px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--t3)}.strct-sm__items{display:flex;flex-direction:column}.strct-sm__item{display:flex;align-items:center;gap:9px;width:100%;padding:7px 10px;border:0;border-radius:6px;background:transparent;color:var(--t1);font-size:13px;font-family:var(--font);cursor:pointer;text-align:left;transition:background .13s ease}.strct-sm__section--collapsible .strct-sm__item{padding-left:31px}.strct-sm__item:hover:not(:disabled){background:var(--bg-3)}.strct-sm__item--active{background:var(--acc-m);color:var(--acc);font-weight:500}.strct-sm__item--active .strct-sm__item-icon{color:var(--acc)}.strct-sm__item:disabled{opacity:.5;cursor:not-allowed}.strct-sm__item-icon{color:var(--t2);flex-shrink:0}.strct-sm__item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
3297
|
+
}], propDecorators: { sections: [{ type: i0.Input, args: [{ isSignal: true, alias: "sections", required: true }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }, { type: i0.Output, args: ["activeIdChange"] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], showIcons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcons", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], select: [{ type: i0.Output, args: ["select"] }] } });
|
|
3298
|
+
|
|
3160
3299
|
let fieldCounter = 0;
|
|
3161
3300
|
/**
|
|
3162
3301
|
* Form-field wrapper: a label (with optional required marker), the projected
|
|
@@ -7749,5 +7888,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
7749
7888
|
* Generated bundle index. Do not edit.
|
|
7750
7889
|
*/
|
|
7751
7890
|
|
|
7752
|
-
export { STRCT_ICONS, STRCT_ICON_GROUPS, STRCT_MASKS, STRCT_PALETTES, STRCT_RAW_ICONS, StrctAccordion, StrctAccordionPanel, StrctAlert, StrctAvatar, StrctBadge, StrctBreadcrumb, StrctBreadcrumbItem, StrctButton, StrctButtonGroup, StrctCard, StrctCardBlock, StrctCardFooter, StrctCardHeader, StrctCascadeHost, StrctCascadeNode, StrctCascadeSelect, StrctCellDef, StrctChart, StrctCheckbox, StrctChips, StrctColorPicker, StrctCombobox, StrctContextMenu, StrctContextMenuTrigger, StrctDatagrid, StrctDatagridActionBar, StrctDatepicker, StrctDivider, StrctDonut, StrctDrawer, StrctDrawerFooter, StrctDropdown, StrctDropdownDivider, StrctDropdownItem, StrctEmptyState, StrctField, StrctFile, StrctFooter, StrctGauge, StrctHeader, StrctIcon, StrctInput, StrctInputMask, StrctInputOtp, StrctKnob, StrctLogin, StrctMenuPanel, StrctMenuService, StrctMetricTile, StrctModal, StrctNav, StrctNavItem, StrctOverlay, StrctPagination, StrctPassword, StrctProgress, StrctRadio, StrctRadioGroup, StrctRail, StrctRange, StrctRating, StrctRowDetailDef, StrctShell, StrctShellService, StrctSignpost, StrctSkeleton, StrctSparkline, StrctSpeedDial, StrctSpinner, StrctStack, StrctStackItem, StrctStep, StrctSubmenu, StrctTab, StrctTable, StrctTabs, StrctTag, StrctThemeService, StrctThemeSwitcher, StrctTimeline, StrctTimelineItem, StrctToastOutlet, StrctToastService, StrctToggle, StrctTooltip, StrctTree, StrctTreeNode, StrctVerticalNav, StrctWizard, registerStrctIcon };
|
|
7891
|
+
export { STRCT_ICONS, STRCT_ICON_GROUPS, STRCT_MASKS, STRCT_PALETTES, STRCT_RAW_ICONS, StrctAccordion, StrctAccordionPanel, StrctAlert, StrctAvatar, StrctBadge, StrctBreadcrumb, StrctBreadcrumbItem, StrctButton, StrctButtonGroup, StrctCard, StrctCardBlock, StrctCardFooter, StrctCardHeader, StrctCascadeHost, StrctCascadeNode, StrctCascadeSelect, StrctCellDef, StrctChart, StrctCheckbox, StrctChips, StrctColorPicker, StrctCombobox, StrctContextMenu, StrctContextMenuTrigger, StrctDatagrid, StrctDatagridActionBar, StrctDatepicker, StrctDivider, StrctDonut, StrctDrawer, StrctDrawerFooter, StrctDropdown, StrctDropdownDivider, StrctDropdownItem, StrctEmptyState, StrctField, StrctFile, StrctFooter, StrctGauge, StrctHeader, StrctIcon, StrctInput, StrctInputMask, StrctInputOtp, StrctKnob, StrctLogin, StrctMenuPanel, StrctMenuService, StrctMetricTile, StrctModal, StrctNav, StrctNavItem, StrctOverlay, StrctPagination, StrctPassword, StrctProgress, StrctRadio, StrctRadioGroup, StrctRail, StrctRange, StrctRating, StrctRowDetailDef, StrctSectionMenu, StrctShell, StrctShellService, StrctSignpost, StrctSkeleton, StrctSparkline, StrctSpeedDial, StrctSpinner, StrctStack, StrctStackItem, StrctStep, StrctSubmenu, StrctTab, StrctTable, StrctTabs, StrctTag, StrctThemeService, StrctThemeSwitcher, StrctTimeline, StrctTimelineItem, StrctToastOutlet, StrctToastService, StrctToggle, StrctTooltip, StrctTree, StrctTreeNode, StrctVerticalNav, StrctWizard, registerStrctIcon };
|
|
7753
7892
|
//# sourceMappingURL=akcelik-strct.mjs.map
|