@edsis/angular 22.1.6 → 22.2.10
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/LICENSE +21 -0
- package/README.md +87 -399
- package/SECURITY.md +18 -0
- package/SUPPORT.md +15 -0
- package/chart/README.md +275 -0
- package/component/README.md +89 -0
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +184 -0
- package/component/alert-dialog/README.md +255 -0
- package/component/aspect-ratio/README.md +116 -0
- package/component/avatar/README.md +182 -0
- package/component/badge/README.md +143 -0
- package/component/breadcrumb/README.md +223 -0
- package/component/button/README.md +141 -0
- package/component/button-group/README.md +214 -0
- package/component/calendar/README.md +125 -0
- package/component/card/README.md +232 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +153 -0
- package/component/collapsible/README.md +216 -0
- package/component/combobox/README.md +202 -0
- package/component/command/README.md +287 -0
- package/component/composer/README.md +241 -0
- package/component/context-menu/README.md +268 -0
- package/component/date-picker/README.md +202 -0
- package/component/dialog/README.md +276 -0
- package/component/drawer/README.md +146 -0
- package/component/dropdown-menu/README.md +336 -0
- package/component/editor/README.md +152 -0
- package/component/empty/README.md +193 -0
- package/component/form/README.md +216 -0
- package/component/hover-card/README.md +150 -0
- package/component/icon/README.md +52 -0
- package/component/input/README.md +160 -0
- package/component/input-group/README.md +245 -0
- package/component/input-otp/README.md +331 -0
- package/component/item/README.md +254 -0
- package/component/kanban/README.md +81 -0
- package/component/kbd/README.md +141 -0
- package/component/label/README.md +137 -0
- package/component/menubar/README.md +270 -0
- package/component/native-select/README.md +176 -0
- package/component/navigation-menu/README.md +165 -0
- package/component/pagination/README.md +151 -0
- package/component/pillbox/README.md +68 -0
- package/component/popover/README.md +54 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +212 -0
- package/component/resizable/README.md +178 -0
- package/component/scroll-area/README.md +150 -0
- package/component/select/README.md +228 -0
- package/component/separator/README.md +175 -0
- package/component/sheet/README.md +190 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/switch/README.md +170 -0
- package/component/table/README.md +292 -0
- package/component/tabs/README.md +220 -0
- package/component/textarea/README.md +169 -0
- package/component/timeline/README.md +94 -0
- package/component/toast/README.md +173 -0
- package/component/toggle/README.md +133 -0
- package/component/toggle-group/README.md +234 -0
- package/component/tooltip/README.md +230 -0
- package/fesm2022/edsis-angular-chart-area.mjs +508 -0
- package/fesm2022/edsis-angular-chart-bar.mjs +946 -0
- package/fesm2022/edsis-angular-chart-core.mjs +1319 -0
- package/fesm2022/edsis-angular-chart-line.mjs +544 -0
- package/fesm2022/edsis-angular-chart-pie.mjs +531 -0
- package/fesm2022/edsis-angular-chart-primitives.mjs +1647 -0
- package/fesm2022/edsis-angular-chart-radar.mjs +693 -0
- package/fesm2022/edsis-angular-chart-radial.mjs +542 -0
- package/fesm2022/edsis-angular-chart-scatter.mjs +486 -0
- package/fesm2022/edsis-angular-chart.mjs +3 -0
- package/fesm2022/edsis-angular-component-accordion.mjs +513 -0
- package/fesm2022/edsis-angular-component-alert-dialog.mjs +1001 -0
- package/fesm2022/edsis-angular-component-alert.mjs +268 -0
- package/fesm2022/edsis-angular-component-aspect-ratio.mjs +80 -0
- package/fesm2022/edsis-angular-component-avatar.mjs +410 -0
- package/fesm2022/edsis-angular-component-badge.mjs +111 -0
- package/fesm2022/edsis-angular-component-breadcrumb.mjs +464 -0
- package/fesm2022/edsis-angular-component-button-group.mjs +252 -0
- package/fesm2022/edsis-angular-component-button.mjs +155 -0
- package/fesm2022/edsis-angular-component-calendar.mjs +835 -0
- package/fesm2022/edsis-angular-component-card.mjs +460 -0
- package/fesm2022/edsis-angular-component-carousel.mjs +700 -0
- package/fesm2022/edsis-angular-component-checkbox.mjs +398 -0
- package/fesm2022/edsis-angular-component-collapsible.mjs +305 -0
- package/fesm2022/edsis-angular-component-combobox.mjs +544 -0
- package/fesm2022/edsis-angular-component-command.mjs +815 -0
- package/fesm2022/edsis-angular-component-composer.mjs +840 -0
- package/fesm2022/edsis-angular-component-context-menu.mjs +197 -0
- package/fesm2022/edsis-angular-component-date-picker.mjs +798 -0
- package/fesm2022/edsis-angular-component-dialog.mjs +798 -0
- package/fesm2022/edsis-angular-component-drawer.mjs +1 -0
- package/fesm2022/edsis-angular-component-dropdown-menu.mjs +1259 -0
- package/fesm2022/edsis-angular-component-editor.mjs +1000 -0
- package/fesm2022/edsis-angular-component-empty.mjs +351 -0
- package/fesm2022/edsis-angular-component-form.mjs +821 -0
- package/fesm2022/edsis-angular-component-hover-card.mjs +486 -0
- package/fesm2022/edsis-angular-component-icon.mjs +253 -0
- package/fesm2022/edsis-angular-component-input-group.mjs +453 -0
- package/fesm2022/edsis-angular-component-input-otp.mjs +957 -0
- package/fesm2022/edsis-angular-component-input.mjs +87 -0
- package/fesm2022/edsis-angular-component-item.mjs +720 -0
- package/fesm2022/edsis-angular-component-kanban.mjs +812 -0
- package/fesm2022/edsis-angular-component-kbd.mjs +124 -0
- package/fesm2022/edsis-angular-component-label.mjs +82 -0
- package/fesm2022/edsis-angular-component-menubar.mjs +481 -0
- package/fesm2022/edsis-angular-component-native-select.mjs +168 -0
- package/fesm2022/edsis-angular-component-navigation-menu.mjs +685 -0
- package/fesm2022/edsis-angular-component-pagination.mjs +425 -0
- package/fesm2022/edsis-angular-component-pillbox.mjs +1679 -0
- package/fesm2022/edsis-angular-component-popover.mjs +292 -0
- package/fesm2022/edsis-angular-component-progress.mjs +184 -0
- package/fesm2022/edsis-angular-component-radio.mjs +491 -0
- package/fesm2022/edsis-angular-component-resizable.mjs +703 -0
- package/fesm2022/edsis-angular-component-scroll-area.mjs +133 -0
- package/fesm2022/edsis-angular-component-segmented-control.mjs +408 -0
- package/fesm2022/edsis-angular-component-select.mjs +743 -0
- package/fesm2022/edsis-angular-component-separator.mjs +102 -0
- package/fesm2022/edsis-angular-component-sheet.mjs +874 -0
- package/fesm2022/edsis-angular-component-skeleton.mjs +62 -0
- package/fesm2022/edsis-angular-component-slider.mjs +676 -0
- package/fesm2022/edsis-angular-component-spinner.mjs +157 -0
- package/fesm2022/edsis-angular-component-switch.mjs +361 -0
- package/fesm2022/edsis-angular-component-table.mjs +446 -0
- package/fesm2022/edsis-angular-component-tabs.mjs +592 -0
- package/fesm2022/edsis-angular-component-textarea.mjs +85 -0
- package/fesm2022/edsis-angular-component-timeline.mjs +619 -0
- package/fesm2022/edsis-angular-component-toast.mjs +231 -0
- package/fesm2022/edsis-angular-component-toggle-group.mjs +579 -0
- package/fesm2022/edsis-angular-component-toggle.mjs +189 -0
- package/fesm2022/edsis-angular-component-tooltip.mjs +804 -0
- package/fesm2022/edsis-angular-component-utils-core.mjs +181 -0
- package/fesm2022/edsis-angular-component-utils-overlay.mjs +54 -0
- package/fesm2022/edsis-angular-component-utils-scale.mjs +76 -0
- package/fesm2022/edsis-angular-component-utils.mjs +2 -0
- package/fesm2022/edsis-angular-component.mjs +0 -0
- package/fesm2022/edsis-angular-navigation-core.mjs +15 -0
- package/fesm2022/edsis-angular-navigation-icon.mjs +35 -0
- package/fesm2022/edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs +234 -0
- package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs +834 -0
- package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs +823 -0
- package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs +670 -0
- package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs +689 -0
- package/fesm2022/edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs +1522 -0
- package/fesm2022/edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs +346 -0
- package/fesm2022/edsis-angular-navigation-service.mjs +558 -0
- package/fesm2022/edsis-angular-navigation-types.mjs +151 -0
- package/fesm2022/edsis-angular-navigation.mjs +3338 -0
- package/fesm2022/edsis-angular-sdk.mjs +100 -0
- package/fesm2022/edsis-angular-theme-component-settings.mjs +1863 -0
- package/fesm2022/edsis-angular-theme-layout-services.mjs +252 -0
- package/fesm2022/edsis-angular-theme-layout-types.mjs +45 -0
- package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +2568 -0
- package/fesm2022/edsis-angular-theme-layout.mjs +1089 -0
- package/fesm2022/edsis-angular-theme-on-fill.mjs +89 -0
- package/fesm2022/edsis-angular-theme-page-core.mjs +315 -0
- package/fesm2022/edsis-angular-theme-page-filter.mjs +409 -0
- package/fesm2022/edsis-angular-theme-page-overview.mjs +88 -0
- package/fesm2022/edsis-angular-theme-page-root.mjs +693 -0
- package/fesm2022/edsis-angular-theme-page-side.mjs +342 -0
- package/fesm2022/edsis-angular-theme-page-slots.mjs +258 -0
- package/fesm2022/edsis-angular-theme-page.mjs +7 -0
- package/fesm2022/edsis-angular-theme-shell-services.mjs +231 -0
- package/fesm2022/edsis-angular-theme-shell-types.mjs +102 -0
- package/fesm2022/edsis-angular-theme-shell.mjs +1352 -0
- package/fesm2022/edsis-angular-theme-styles.mjs +605 -0
- package/fesm2022/edsis-angular-theme.mjs +0 -0
- package/fesm2022/edsis-angular.mjs +5 -8
- package/navigation/README.md +576 -0
- package/package.json +481 -52
- package/sdk/README.md +212 -0
- package/sdk/schematics/collection.json +20 -0
- package/sdk/schematics/init/index.js +83 -0
- package/sdk/schematics/init/schema.json +19 -0
- package/sdk/schematics/ng-add/index.js +147 -0
- package/sdk/schematics/ng-add/schema.json +14 -0
- package/sdk/schematics/package.json +3 -0
- package/sdk/schematics/sdk/index.js +175 -0
- package/sdk/schematics/sdk/schema.json +19 -0
- package/sdk/sdk.config.example.json +24 -0
- package/sdk/src/config/loader.js +43 -0
- package/sdk/src/config/schema.js +59 -0
- package/sdk/src/emit/client.js +251 -0
- package/sdk/src/emit/metadata.js +310 -0
- package/sdk/src/emit/models.js +104 -0
- package/sdk/src/emit/navigation.js +56 -0
- package/sdk/src/emit/operations.js +118 -0
- package/sdk/src/emit/public-api.js +54 -0
- package/sdk/src/emit/services.js +110 -0
- package/sdk/src/engine.js +67 -0
- package/sdk/src/layout/per-domain.js +360 -0
- package/sdk/src/package.json +3 -0
- package/sdk/src/parser/bundle.js +25 -0
- package/sdk/src/parser/ir.js +429 -0
- package/sdk/src/parser/types.js +7 -0
- package/sdk/src/render/template.js +152 -0
- package/sdk/src/writer/index.js +286 -0
- package/theme/README.md +120 -0
- package/theme/component/settings/README.md +154 -0
- package/theme/layout/README.md +604 -0
- package/theme/page/README.md +505 -0
- package/theme/shell/README.md +344 -0
- package/theme/styles/README.md +251 -0
- package/theme/styles/css/base/components.css +577 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/on-fill.css +153 -0
- package/theme/styles/css/base/package.css +10 -0
- package/theme/styles/css/base/prefers-dark.css +81 -0
- package/theme/styles/css/base/print.css +62 -0
- package/theme/styles/css/base/status.css +38 -0
- package/theme/styles/css/base/tailwind.css +208 -0
- package/theme/styles/css/base/theme.css +306 -0
- package/theme/styles/css/base/tokens.css +388 -0
- package/theme/styles/css/color/amber.css +72 -0
- package/theme/styles/css/color/blue.css +72 -0
- package/theme/styles/css/color/brand.css +38 -0
- package/theme/styles/css/color/cyan.css +72 -0
- package/theme/styles/css/color/emerald.css +72 -0
- package/theme/styles/css/color/fuchsia.css +72 -0
- package/theme/styles/css/color/green.css +72 -0
- package/theme/styles/css/color/index.css +19 -0
- package/theme/styles/css/color/indigo.css +72 -0
- package/theme/styles/css/color/lime.css +72 -0
- package/theme/styles/css/color/orange.css +72 -0
- package/theme/styles/css/color/pink.css +72 -0
- package/theme/styles/css/color/purple.css +72 -0
- package/theme/styles/css/color/red.css +72 -0
- package/theme/styles/css/color/rose.css +72 -0
- package/theme/styles/css/color/sky.css +72 -0
- package/theme/styles/css/color/teal.css +72 -0
- package/theme/styles/css/color/violet.css +72 -0
- package/theme/styles/css/color/yellow.css +72 -0
- package/theme/styles/css/fonts.css +85 -0
- package/theme/styles/css/index.css +18 -0
- package/theme/styles/css/neutral/gray.css +63 -0
- package/theme/styles/css/neutral/index.css +11 -0
- package/theme/styles/css/neutral/mauve.css +63 -0
- package/theme/styles/css/neutral/mist.css +63 -0
- package/theme/styles/css/neutral/neutral.css +63 -0
- package/theme/styles/css/neutral/olive.css +63 -0
- package/theme/styles/css/neutral/slate.css +63 -0
- package/theme/styles/css/neutral/stone.css +63 -0
- package/theme/styles/css/neutral/taupe.css +63 -0
- package/theme/styles/css/neutral/zinc.css +63 -0
- package/theme/styles/css/radius/index.css +30 -0
- package/theme/styles/css/space/index.css +20 -0
- package/types/edsis-angular-chart-area.d.ts +139 -0
- package/types/edsis-angular-chart-bar.d.ts +291 -0
- package/types/edsis-angular-chart-core.d.ts +824 -0
- package/types/edsis-angular-chart-line.d.ts +148 -0
- package/types/edsis-angular-chart-pie.d.ts +207 -0
- package/types/edsis-angular-chart-primitives.d.ts +360 -0
- package/types/edsis-angular-chart-radar.d.ts +198 -0
- package/types/edsis-angular-chart-radial.d.ts +187 -0
- package/types/edsis-angular-chart-scatter.d.ts +181 -0
- package/types/edsis-angular-chart.d.ts +3 -0
- package/types/edsis-angular-component-accordion.d.ts +139 -0
- package/types/edsis-angular-component-alert-dialog.d.ts +288 -0
- package/types/edsis-angular-component-alert.d.ts +72 -0
- package/types/edsis-angular-component-aspect-ratio.d.ts +20 -0
- package/types/edsis-angular-component-avatar.d.ts +111 -0
- package/types/edsis-angular-component-badge.d.ts +36 -0
- package/types/edsis-angular-component-breadcrumb.d.ts +85 -0
- package/types/edsis-angular-component-button-group.d.ts +50 -0
- package/types/edsis-angular-component-button.d.ts +44 -0
- package/types/edsis-angular-component-calendar.d.ts +150 -0
- package/types/edsis-angular-component-card.d.ts +123 -0
- package/types/edsis-angular-component-carousel.d.ts +155 -0
- package/types/edsis-angular-component-checkbox.d.ts +100 -0
- package/types/edsis-angular-component-collapsible.d.ts +68 -0
- package/types/edsis-angular-component-combobox.d.ts +105 -0
- package/types/edsis-angular-component-command.d.ts +215 -0
- package/types/edsis-angular-component-composer.d.ts +190 -0
- package/types/edsis-angular-component-context-menu.d.ts +64 -0
- package/types/edsis-angular-component-date-picker.d.ts +199 -0
- package/types/edsis-angular-component-dialog.d.ts +231 -0
- package/types/edsis-angular-component-drawer.d.ts +2 -0
- package/types/edsis-angular-component-dropdown-menu.d.ts +370 -0
- package/types/edsis-angular-component-editor.d.ts +234 -0
- package/types/edsis-angular-component-empty.d.ts +85 -0
- package/types/edsis-angular-component-form.d.ts +223 -0
- package/types/edsis-angular-component-hover-card.d.ts +133 -0
- package/types/edsis-angular-component-icon.d.ts +90 -0
- package/types/edsis-angular-component-input-group.d.ts +98 -0
- package/types/edsis-angular-component-input-otp.d.ts +249 -0
- package/types/edsis-angular-component-input.d.ts +31 -0
- package/types/edsis-angular-component-item.d.ts +169 -0
- package/types/edsis-angular-component-kanban.d.ts +165 -0
- package/types/edsis-angular-component-kbd.d.ts +25 -0
- package/types/edsis-angular-component-label.d.ts +19 -0
- package/types/edsis-angular-component-menubar.d.ts +123 -0
- package/types/edsis-angular-component-native-select.d.ts +39 -0
- package/types/edsis-angular-component-navigation-menu.d.ts +163 -0
- package/types/edsis-angular-component-pagination.d.ts +83 -0
- package/types/edsis-angular-component-pillbox.d.ts +380 -0
- package/types/edsis-angular-component-popover.d.ts +96 -0
- package/types/edsis-angular-component-progress.d.ts +45 -0
- package/types/edsis-angular-component-radio.d.ts +137 -0
- package/types/edsis-angular-component-resizable.d.ts +166 -0
- package/types/edsis-angular-component-scroll-area.d.ts +37 -0
- package/types/edsis-angular-component-segmented-control.d.ts +102 -0
- package/types/edsis-angular-component-select.d.ts +138 -0
- package/types/edsis-angular-component-separator.d.ts +26 -0
- package/types/edsis-angular-component-sheet.d.ts +240 -0
- package/types/edsis-angular-component-skeleton.d.ts +13 -0
- package/types/edsis-angular-component-slider.d.ts +148 -0
- package/types/edsis-angular-component-spinner.d.ts +31 -0
- package/types/edsis-angular-component-switch.d.ts +101 -0
- package/types/edsis-angular-component-table.d.ts +109 -0
- package/types/edsis-angular-component-tabs.d.ts +183 -0
- package/types/edsis-angular-component-textarea.d.ts +27 -0
- package/types/edsis-angular-component-timeline.d.ts +146 -0
- package/types/edsis-angular-component-toast.d.ts +60 -0
- package/types/edsis-angular-component-toggle-group.d.ts +161 -0
- package/types/edsis-angular-component-toggle.d.ts +47 -0
- package/types/edsis-angular-component-tooltip.d.ts +233 -0
- package/types/edsis-angular-component-utils-core.d.ts +175 -0
- package/types/edsis-angular-component-utils-overlay.d.ts +17 -0
- package/types/edsis-angular-component-utils-scale.d.ts +27 -0
- package/types/edsis-angular-component-utils.d.ts +2 -0
- package/types/edsis-angular-component.d.ts +1 -0
- package/types/edsis-angular-navigation-core.d.ts +55 -0
- package/types/edsis-angular-navigation-icon.d.ts +9 -0
- package/types/edsis-angular-navigation-service.d.ts +121 -0
- package/types/edsis-angular-navigation-types.d.ts +185 -0
- package/types/edsis-angular-navigation.d.ts +862 -0
- package/types/edsis-angular-sdk.d.ts +87 -0
- package/types/edsis-angular-theme-component-settings.d.ts +205 -0
- package/types/edsis-angular-theme-layout-services.d.ts +143 -0
- package/types/edsis-angular-theme-layout-types.d.ts +36 -0
- package/types/edsis-angular-theme-layout-wrapper.d.ts +670 -0
- package/types/edsis-angular-theme-layout.d.ts +218 -0
- package/types/edsis-angular-theme-on-fill.d.ts +45 -0
- package/types/edsis-angular-theme-page-core.d.ts +151 -0
- package/types/edsis-angular-theme-page-filter.d.ts +127 -0
- package/types/edsis-angular-theme-page-overview.d.ts +28 -0
- package/types/edsis-angular-theme-page-root.d.ts +172 -0
- package/types/edsis-angular-theme-page-side.d.ts +90 -0
- package/types/edsis-angular-theme-page-slots.d.ts +61 -0
- package/types/edsis-angular-theme-page.d.ts +7 -0
- package/types/edsis-angular-theme-shell-services.d.ts +188 -0
- package/types/edsis-angular-theme-shell-types.d.ts +102 -0
- package/types/edsis-angular-theme-shell.d.ts +178 -0
- package/types/edsis-angular-theme-styles.d.ts +328 -0
- package/types/edsis-angular-theme.d.ts +1 -0
- package/types/edsis-angular.d.ts +5 -2
- package/fesm2022/edsis-angular-block-shell.mjs +0 -1329
- package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
- package/fesm2022/edsis-angular-block-themes.mjs +0 -1007
- package/fesm2022/edsis-angular-block-themes.mjs.map +0 -1
- package/fesm2022/edsis-angular-module-auth.mjs +0 -2582
- package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-platform-mfe.mjs +0 -329
- package/fesm2022/edsis-angular-platform-mfe.mjs.map +0 -1
- package/fesm2022/edsis-angular-services-runtime.mjs +0 -385
- package/fesm2022/edsis-angular-services-runtime.mjs.map +0 -1
- package/fesm2022/edsis-angular.mjs.map +0 -1
- package/types/edsis-angular-block-shell.d.ts +0 -190
- package/types/edsis-angular-block-themes.d.ts +0 -94
- package/types/edsis-angular-module-auth.d.ts +0 -533
- package/types/edsis-angular-platform-mfe.d.ts +0 -126
- package/types/edsis-angular-services-runtime.d.ts +0 -118
|
@@ -1,1007 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, effect, Service, InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer, Injector, linkedSignal, computed, afterNextRender, input, output, Component, ElementRef, signal, DestroyRef, Directive, provideAppInitializer } from '@angular/core';
|
|
3
|
-
import { NavigationService } from '@edsis/navigation/service';
|
|
4
|
-
import { LayoutService, isUiLayoutType, isUiLayoutWidth, isUiLayoutSurface } from '@edsis/theme/layout';
|
|
5
|
-
import { ThemeAppearanceService, ThemeModeService, ThemeSpaceService, ThemeRadiusService, ThemeColorService, ThemeBrandService, isThemeMode, isThemeSpace, isThemeRadius, isThemeColor, isThemeBrand, themeAppearancePresetEntry, DEFAULT_THEME_MODE, DEFAULT_THEME_COLOR, DEFAULT_THEME_BRAND, THEME_APPEARANCES, THEME_MODES, THEME_COLORS, THEME_BRANDS, THEME_SPACES, THEME_RADII, isThemeAppearance, isThemeAppearanceSettingLocked, ThemeDeviceService } from '@edsis/theme/styles';
|
|
6
|
-
import { LAYOUT_DEFAULT_TYPE, LAYOUT_DEFAULT_WIDTH, LAYOUT_DEFAULT_SURFACE } from '@edsis/theme/layout/types';
|
|
7
|
-
import { DOCUMENT } from '@angular/common';
|
|
8
|
-
import { cn } from '@edsis/component/class';
|
|
9
|
-
import { SheetComponent } from '@edsis/component/sheet';
|
|
10
|
-
import { LayoutService as LayoutService$1 } from '@edsis/theme/layout/services';
|
|
11
|
-
import { ButtonComponent } from '@edsis/component/button';
|
|
12
|
-
import { IconComponent } from '@edsis/component/icon';
|
|
13
|
-
import { PageComponent, PageContentComponent, PageFooterComponent, PageHeaderComponent } from '@edsis/theme/page';
|
|
14
|
-
import { ToggleGroupComponent, ToggleGroupItemDirective } from '@edsis/component/toggle-group';
|
|
15
|
-
import { TooltipDirective } from '@edsis/component/tooltip';
|
|
16
|
-
import { RuntimeContextService } from '@edsis/angular/services/runtime';
|
|
17
|
-
|
|
18
|
-
const PRIMARY_NAVIGATION_ID$2 = 'main';
|
|
19
|
-
const NAVIGATION_TYPES = ['sidebar', 'dockbar', 'navbar', 'flyout'];
|
|
20
|
-
const NAVIGATION_ORIENTATIONS = ['vertical', 'horizontal'];
|
|
21
|
-
const NAVIGATION_POSITIONS = ['left', 'right', 'top', 'bottom'];
|
|
22
|
-
const NAVIGATION_DOCKBAR_MODES = ['default', 'drawer', 'sticky'];
|
|
23
|
-
class ThemeAppearancePresetService {
|
|
24
|
-
config = inject(APP_PREFERENCES_CONFIG, { optional: true });
|
|
25
|
-
themeAppearance = inject(ThemeAppearanceService);
|
|
26
|
-
themeMode = inject(ThemeModeService);
|
|
27
|
-
themeSpace = inject(ThemeSpaceService);
|
|
28
|
-
themeRadius = inject(ThemeRadiusService);
|
|
29
|
-
themeColor = inject(ThemeColorService);
|
|
30
|
-
themeBrand = inject(ThemeBrandService);
|
|
31
|
-
layout = inject(LayoutService);
|
|
32
|
-
navigation = inject(NavigationService);
|
|
33
|
-
constructor() {
|
|
34
|
-
let previousAppearance = this.themeAppearance.appearance();
|
|
35
|
-
if (this.themeAppearance.hasStoredAppearance()) {
|
|
36
|
-
this.enforceLockedValues(previousAppearance);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this.applyPreset(previousAppearance);
|
|
40
|
-
}
|
|
41
|
-
effect(() => {
|
|
42
|
-
const appearance = this.themeAppearance.appearance();
|
|
43
|
-
if (appearance === previousAppearance)
|
|
44
|
-
return;
|
|
45
|
-
previousAppearance = appearance;
|
|
46
|
-
this.applyPreset(appearance);
|
|
47
|
-
});
|
|
48
|
-
effect(() => this.enforceLockedValues(this.themeAppearance.appearance()));
|
|
49
|
-
}
|
|
50
|
-
applyPreset(themeAppearance) {
|
|
51
|
-
this.applyThemeValues(themeAppearance);
|
|
52
|
-
this.applyLayoutValues(themeAppearance);
|
|
53
|
-
this.applyNavigationValues(themeAppearance);
|
|
54
|
-
}
|
|
55
|
-
applyThemeValues(themeAppearance) {
|
|
56
|
-
const mode = this.valueFor(themeAppearance, 'theme-mode', this.defaultMode());
|
|
57
|
-
if (isThemeMode(mode))
|
|
58
|
-
this.themeMode.setMode(mode);
|
|
59
|
-
const space = this.valueFor(themeAppearance, 'theme-space', this.defaultSpace());
|
|
60
|
-
if (isThemeSpace(space))
|
|
61
|
-
this.themeSpace.setSpace(space);
|
|
62
|
-
const radius = this.valueFor(themeAppearance, 'theme-radius', this.defaultRadius());
|
|
63
|
-
if (isThemeRadius(radius))
|
|
64
|
-
this.themeRadius.setRadius(radius);
|
|
65
|
-
const color = this.valueFor(themeAppearance, 'theme-color', this.defaultColor());
|
|
66
|
-
if (isThemeColor(color))
|
|
67
|
-
this.themeColor.setColor(color);
|
|
68
|
-
const brand = this.valueFor(themeAppearance, 'theme-brand', this.defaultBrand());
|
|
69
|
-
if (isThemeBrand(brand))
|
|
70
|
-
this.themeBrand.setBrand(brand);
|
|
71
|
-
}
|
|
72
|
-
applyLayoutValues(themeAppearance) {
|
|
73
|
-
const type = this.valueFor(themeAppearance, 'layout-type', this.defaultLayoutType());
|
|
74
|
-
if (isUiLayoutType(type))
|
|
75
|
-
this.layout.setType(type);
|
|
76
|
-
const width = this.valueFor(themeAppearance, 'layout-width', this.defaultLayoutWidth());
|
|
77
|
-
if (isUiLayoutWidth(width))
|
|
78
|
-
this.layout.setWidth(width);
|
|
79
|
-
const surface = this.valueFor(themeAppearance, 'layout-surface', this.defaultLayoutSurface());
|
|
80
|
-
if (isUiLayoutSurface(surface))
|
|
81
|
-
this.layout.setSurface(surface);
|
|
82
|
-
}
|
|
83
|
-
applyNavigationValues(themeAppearance) {
|
|
84
|
-
const orientation = this.valueFor(themeAppearance, 'nav-orientation', this.defaultNavigationOrientation());
|
|
85
|
-
const type = this.valueFor(themeAppearance, 'nav-type', this.defaultNavigationType());
|
|
86
|
-
const position = this.valueFor(themeAppearance, 'nav-position', this.defaultNavigationPosition());
|
|
87
|
-
const typeMode = this.valueFor(themeAppearance, 'nav-type-mode', 'default');
|
|
88
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$2, {
|
|
89
|
-
orientation: isNavigationOrientation(orientation)
|
|
90
|
-
? orientation
|
|
91
|
-
: this.defaultNavigationOrientation(),
|
|
92
|
-
type: isNavigationType(type) ? type : this.defaultNavigationType(),
|
|
93
|
-
position: isNavigationPosition(position) ? position : this.defaultNavigationPosition(),
|
|
94
|
-
collapsed: typeMode === 'collapsed'
|
|
95
|
-
? true
|
|
96
|
-
: typeMode === 'expanded'
|
|
97
|
-
? false
|
|
98
|
-
: this.defaultNavigationCollapsed(),
|
|
99
|
-
dockbarMode: isNavigationDockbarMode(typeMode)
|
|
100
|
-
? typeMode
|
|
101
|
-
: this.defaultNavigationDockbarMode(),
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
enforceLockedValues(themeAppearance) {
|
|
105
|
-
const mode = this.lockedValueFor(themeAppearance, 'theme-mode');
|
|
106
|
-
if (isThemeMode(mode) && this.themeMode.mode() !== mode)
|
|
107
|
-
this.themeMode.setMode(mode);
|
|
108
|
-
const space = this.lockedValueFor(themeAppearance, 'theme-space');
|
|
109
|
-
if (isThemeSpace(space) && this.themeSpace.space() !== space)
|
|
110
|
-
this.themeSpace.setSpace(space);
|
|
111
|
-
const radius = this.lockedValueFor(themeAppearance, 'theme-radius');
|
|
112
|
-
if (isThemeRadius(radius) && this.themeRadius.radius() !== radius)
|
|
113
|
-
this.themeRadius.setRadius(radius);
|
|
114
|
-
const color = this.lockedValueFor(themeAppearance, 'theme-color');
|
|
115
|
-
if (isThemeColor(color) && this.themeColor.color() !== color)
|
|
116
|
-
this.themeColor.setColor(color);
|
|
117
|
-
const brand = this.lockedValueFor(themeAppearance, 'theme-brand');
|
|
118
|
-
if (isThemeBrand(brand) && this.themeBrand.brand() !== brand)
|
|
119
|
-
this.themeBrand.setBrand(brand);
|
|
120
|
-
const type = this.lockedValueFor(themeAppearance, 'layout-type');
|
|
121
|
-
if (isUiLayoutType(type) && this.layout.type() !== type)
|
|
122
|
-
this.layout.setType(type);
|
|
123
|
-
const width = this.lockedValueFor(themeAppearance, 'layout-width');
|
|
124
|
-
if (isUiLayoutWidth(width) && this.layout.width() !== width)
|
|
125
|
-
this.layout.setWidth(width);
|
|
126
|
-
const surface = this.lockedValueFor(themeAppearance, 'layout-surface');
|
|
127
|
-
if (isUiLayoutSurface(surface) && this.layout.surface() !== surface)
|
|
128
|
-
this.layout.setSurface(surface);
|
|
129
|
-
const orientation = this.lockedValueFor(themeAppearance, 'nav-orientation');
|
|
130
|
-
const navigationType = this.lockedValueFor(themeAppearance, 'nav-type');
|
|
131
|
-
const position = this.lockedValueFor(themeAppearance, 'nav-position');
|
|
132
|
-
const typeMode = this.lockedValueFor(themeAppearance, 'nav-type-mode');
|
|
133
|
-
const currentNavigationState = this.navigation.currentState(PRIMARY_NAVIGATION_ID$2);
|
|
134
|
-
const navigationState = currentNavigationState ?? {
|
|
135
|
-
id: PRIMARY_NAVIGATION_ID$2,
|
|
136
|
-
orientation: 'vertical',
|
|
137
|
-
type: 'sidebar',
|
|
138
|
-
position: 'left',
|
|
139
|
-
collapsed: false,
|
|
140
|
-
dockbarMode: 'default',
|
|
141
|
-
};
|
|
142
|
-
const navigationUpdate = {
|
|
143
|
-
...(isNavigationOrientation(orientation) && navigationState.orientation !== orientation
|
|
144
|
-
? { orientation }
|
|
145
|
-
: {}),
|
|
146
|
-
...(isNavigationType(navigationType) && navigationState.type !== navigationType
|
|
147
|
-
? { type: navigationType }
|
|
148
|
-
: {}),
|
|
149
|
-
...(isNavigationPosition(position) && navigationState.position !== position
|
|
150
|
-
? { position }
|
|
151
|
-
: {}),
|
|
152
|
-
...(typeMode === 'collapsed' && !navigationState.collapsed
|
|
153
|
-
? { collapsed: true }
|
|
154
|
-
: typeMode === 'expanded' && navigationState.collapsed
|
|
155
|
-
? { collapsed: false }
|
|
156
|
-
: typeMode === 'default' &&
|
|
157
|
-
navigationState.collapsed !== this.defaultNavigationCollapsed()
|
|
158
|
-
? { collapsed: this.defaultNavigationCollapsed() }
|
|
159
|
-
: {}),
|
|
160
|
-
...(isNavigationDockbarMode(typeMode) && navigationState.dockbarMode !== typeMode
|
|
161
|
-
? { dockbarMode: typeMode }
|
|
162
|
-
: typeMode === 'default' &&
|
|
163
|
-
navigationState.dockbarMode !== this.defaultNavigationDockbarMode()
|
|
164
|
-
? { dockbarMode: this.defaultNavigationDockbarMode() }
|
|
165
|
-
: {}),
|
|
166
|
-
};
|
|
167
|
-
const hasLockedNavigationValue = [orientation, navigationType, position, typeMode].some((value) => value !== null);
|
|
168
|
-
if (Object.keys(navigationUpdate).length > 0 ||
|
|
169
|
-
(currentNavigationState === null && hasLockedNavigationValue)) {
|
|
170
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$2, navigationUpdate);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
lockedValueFor(themeAppearance, key) {
|
|
174
|
-
const entry = themeAppearancePresetEntry(themeAppearance, key);
|
|
175
|
-
return entry.control === 'fix' ? entry.value : null;
|
|
176
|
-
}
|
|
177
|
-
valueFor(themeAppearance, key, fallback) {
|
|
178
|
-
const value = themeAppearancePresetEntry(themeAppearance, key).value;
|
|
179
|
-
return value === 'default' ? fallback : value;
|
|
180
|
-
}
|
|
181
|
-
defaultMode() {
|
|
182
|
-
return this.config?.defaults?.theme.mode ?? DEFAULT_THEME_MODE;
|
|
183
|
-
}
|
|
184
|
-
defaultSpace() {
|
|
185
|
-
return this.config?.defaults?.theme.space ?? 'normal';
|
|
186
|
-
}
|
|
187
|
-
defaultRadius() {
|
|
188
|
-
return this.config?.defaults?.theme.radius ?? 'medium';
|
|
189
|
-
}
|
|
190
|
-
defaultColor() {
|
|
191
|
-
return this.config?.defaults?.theme.color ?? DEFAULT_THEME_COLOR;
|
|
192
|
-
}
|
|
193
|
-
defaultBrand() {
|
|
194
|
-
return this.config?.defaults?.theme.brand ?? DEFAULT_THEME_BRAND;
|
|
195
|
-
}
|
|
196
|
-
defaultLayoutType() {
|
|
197
|
-
return this.config?.defaults?.layout.type ?? LAYOUT_DEFAULT_TYPE;
|
|
198
|
-
}
|
|
199
|
-
defaultLayoutWidth() {
|
|
200
|
-
return this.config?.defaults?.layout.width ?? LAYOUT_DEFAULT_WIDTH;
|
|
201
|
-
}
|
|
202
|
-
defaultLayoutSurface() {
|
|
203
|
-
return this.config?.defaults?.layout.surface ?? LAYOUT_DEFAULT_SURFACE;
|
|
204
|
-
}
|
|
205
|
-
defaultNavigationOrientation() {
|
|
206
|
-
return this.config?.defaults?.navigation.orientation ?? 'vertical';
|
|
207
|
-
}
|
|
208
|
-
defaultNavigationType() {
|
|
209
|
-
return this.config?.defaults?.navigation.type ?? 'sidebar';
|
|
210
|
-
}
|
|
211
|
-
defaultNavigationPosition() {
|
|
212
|
-
return this.config?.defaults?.navigation.position ?? 'left';
|
|
213
|
-
}
|
|
214
|
-
defaultNavigationCollapsed() {
|
|
215
|
-
return this.config?.defaults?.navigation.collapsed ?? false;
|
|
216
|
-
}
|
|
217
|
-
defaultNavigationDockbarMode() {
|
|
218
|
-
return this.config?.defaults?.navigation.dockbarMode ?? 'default';
|
|
219
|
-
}
|
|
220
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ThemeAppearancePresetService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
221
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.0", ngImport: i0, type: ThemeAppearancePresetService });
|
|
222
|
-
}
|
|
223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ThemeAppearancePresetService, decorators: [{
|
|
224
|
-
type: Service
|
|
225
|
-
}], ctorParameters: () => [] });
|
|
226
|
-
function isNavigationType(value) {
|
|
227
|
-
return value !== null && NAVIGATION_TYPES.includes(value);
|
|
228
|
-
}
|
|
229
|
-
function isNavigationOrientation(value) {
|
|
230
|
-
return value !== null && NAVIGATION_ORIENTATIONS.includes(value);
|
|
231
|
-
}
|
|
232
|
-
function isNavigationPosition(value) {
|
|
233
|
-
return value !== null && NAVIGATION_POSITIONS.includes(value);
|
|
234
|
-
}
|
|
235
|
-
function isNavigationDockbarMode(value) {
|
|
236
|
-
return value !== null && NAVIGATION_DOCKBAR_MODES.includes(value);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const APP_PREFERENCES_CONFIG = new InjectionToken('APP_PREFERENCES_CONFIG');
|
|
240
|
-
function provideAppPreferences(config = {}) {
|
|
241
|
-
return makeEnvironmentProviders([
|
|
242
|
-
{ provide: APP_PREFERENCES_CONFIG, useValue: config },
|
|
243
|
-
provideEnvironmentInitializer(() => {
|
|
244
|
-
inject(ThemeAppearancePresetService);
|
|
245
|
-
}),
|
|
246
|
-
]);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const NAVIGATION_FOCUS_SELECTOR = '[data-navigation-id="main"] a[href]:not([aria-disabled="true"]), [data-navigation-id="main"] button:not(:disabled):not([aria-disabled="true"])';
|
|
250
|
-
const CONTENT_FOCUS_SELECTOR = '[data-block-shell-content][tabindex="-1"]';
|
|
251
|
-
class AppPreferencesPanelService {
|
|
252
|
-
document = inject(DOCUMENT, { optional: true });
|
|
253
|
-
injector = inject(Injector);
|
|
254
|
-
layout = inject(LayoutService$1);
|
|
255
|
-
openedState = linkedSignal({ ...(ngDevMode ? { debugName: "openedState" } : /* istanbul ignore next */ {}), source: this.layout.type,
|
|
256
|
-
computation: () => false });
|
|
257
|
-
origin = null;
|
|
258
|
-
previouslyOpened = false;
|
|
259
|
-
finalizationPending = false;
|
|
260
|
-
supported = computed(() => this.layout.type() === 'vertical' || this.layout.type() === 'horizontal', /* @ts-ignore */
|
|
261
|
-
...(ngDevMode ? [{ debugName: "supported" }] : /* istanbul ignore next */ []));
|
|
262
|
-
opened = this.openedState.asReadonly();
|
|
263
|
-
constructor() {
|
|
264
|
-
effect(() => {
|
|
265
|
-
const opened = this.openedState();
|
|
266
|
-
if (this.previouslyOpened && !opened) {
|
|
267
|
-
this.finalizeClose();
|
|
268
|
-
}
|
|
269
|
-
this.previouslyOpened = opened;
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
open(trigger) {
|
|
273
|
-
if (!this.supported()) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
if (!this.openedState() && !this.origin) {
|
|
277
|
-
this.origin = trigger ?? this.activeElement();
|
|
278
|
-
}
|
|
279
|
-
this.openedState.set(true);
|
|
280
|
-
return true;
|
|
281
|
-
}
|
|
282
|
-
close() {
|
|
283
|
-
this.openedState.set(false);
|
|
284
|
-
}
|
|
285
|
-
toggle(trigger) {
|
|
286
|
-
if (this.openedState()) {
|
|
287
|
-
this.close();
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
return this.open(trigger);
|
|
291
|
-
}
|
|
292
|
-
finalizeClose() {
|
|
293
|
-
if (this.finalizationPending) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
this.finalizationPending = true;
|
|
297
|
-
afterNextRender(() => {
|
|
298
|
-
this.finalizationPending = false;
|
|
299
|
-
this.restoreFocus();
|
|
300
|
-
this.origin = null;
|
|
301
|
-
}, { injector: this.injector });
|
|
302
|
-
}
|
|
303
|
-
restoreFocus() {
|
|
304
|
-
const document = this.document;
|
|
305
|
-
if (!document) {
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
const candidates = [
|
|
309
|
-
this.origin,
|
|
310
|
-
...Array.from(document.querySelectorAll(NAVIGATION_FOCUS_SELECTOR)),
|
|
311
|
-
document.querySelector(CONTENT_FOCUS_SELECTOR),
|
|
312
|
-
];
|
|
313
|
-
for (const candidate of candidates) {
|
|
314
|
-
if (!this.canFocus(candidate)) {
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
candidate.focus({ preventScroll: true });
|
|
318
|
-
if (document.activeElement === candidate) {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
activeElement() {
|
|
324
|
-
const activeElement = this.document?.activeElement;
|
|
325
|
-
return activeElement instanceof HTMLElement ? activeElement : null;
|
|
326
|
-
}
|
|
327
|
-
canFocus(element) {
|
|
328
|
-
if (!element?.isConnected || element.matches(':disabled, [aria-disabled="true"]')) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
if (element.closest('[hidden], [inert], [aria-hidden="true"]')) {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
const view = this.document?.defaultView;
|
|
335
|
-
return !view || element.getClientRects().length > 0;
|
|
336
|
-
}
|
|
337
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesPanelService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
338
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesPanelService });
|
|
339
|
-
}
|
|
340
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesPanelService, decorators: [{
|
|
341
|
-
type: Service
|
|
342
|
-
}], ctorParameters: () => [] });
|
|
343
|
-
|
|
344
|
-
class AppPreferenceSettingGroupComponent {
|
|
345
|
-
title = input.required(/* @ts-ignore */
|
|
346
|
-
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
347
|
-
description = input(null, /* @ts-ignore */
|
|
348
|
-
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
349
|
-
activeLabel = input.required(/* @ts-ignore */
|
|
350
|
-
...(ngDevMode ? [{ debugName: "activeLabel" }] : /* istanbul ignore next */ []));
|
|
351
|
-
options = input.required(/* @ts-ignore */
|
|
352
|
-
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
353
|
-
selected = input.required(/* @ts-ignore */
|
|
354
|
-
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
355
|
-
headingId = input.required(/* @ts-ignore */
|
|
356
|
-
...(ngDevMode ? [{ debugName: "headingId" }] : /* istanbul ignore next */ []));
|
|
357
|
-
locked = input(false, /* @ts-ignore */
|
|
358
|
-
...(ngDevMode ? [{ debugName: "locked" }] : /* istanbul ignore next */ []));
|
|
359
|
-
optionSelected = output();
|
|
360
|
-
onValueChange(value) {
|
|
361
|
-
if (value !== null && !this.locked()) {
|
|
362
|
-
this.optionSelected.emit(value);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferenceSettingGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
366
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AppPreferenceSettingGroupComponent, isStandalone: true, selector: "app-preference-setting-group", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, activeLabel: { classPropertyName: "activeLabel", publicName: "activeLabel", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null }, headingId: { classPropertyName: "headingId", publicName: "headingId", isSignal: true, isRequired: true, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected" }, ngImport: i0, template: `
|
|
367
|
-
<section class="border-b border-border/65 px-3 py-2.5 last:border-b-0">
|
|
368
|
-
<div class="flex items-start justify-between gap-3">
|
|
369
|
-
<div class="min-w-0">
|
|
370
|
-
<h3 [id]="headingId()" class="text-sm font-medium text-foreground">{{ title() }}</h3>
|
|
371
|
-
@if (description()) {
|
|
372
|
-
<p class="mt-1 text-xs leading-4 text-muted-foreground">{{ description() }}</p>
|
|
373
|
-
}
|
|
374
|
-
</div>
|
|
375
|
-
|
|
376
|
-
<span
|
|
377
|
-
class="flex shrink-0 items-center gap-1 font-mono text-xs text-muted-foreground"
|
|
378
|
-
[attr.aria-label]="locked() ? activeLabel() + ', dikunci oleh gaya tema' : null"
|
|
379
|
-
>
|
|
380
|
-
{{ activeLabel() }}
|
|
381
|
-
@if (locked()) {
|
|
382
|
-
<Icon name="lock" [size]="14" aria-hidden="true" />
|
|
383
|
-
}
|
|
384
|
-
</span>
|
|
385
|
-
</div>
|
|
386
|
-
|
|
387
|
-
<ToggleGroup
|
|
388
|
-
type="single"
|
|
389
|
-
variant="segmented"
|
|
390
|
-
[value]="selected()"
|
|
391
|
-
[disabled]="locked()"
|
|
392
|
-
[attr.aria-labelledby]="headingId()"
|
|
393
|
-
class="mt-2 grid w-full grid-flow-col auto-cols-fr gap-0"
|
|
394
|
-
(valueChange)="onValueChange($event)"
|
|
395
|
-
>
|
|
396
|
-
@for (option of options(); track option.value) {
|
|
397
|
-
<button
|
|
398
|
-
ToggleGroupItem
|
|
399
|
-
[value]="option.value"
|
|
400
|
-
[Tooltip]="option.label"
|
|
401
|
-
[attr.aria-label]="option.label"
|
|
402
|
-
[attr.title]="option.label"
|
|
403
|
-
class="min-h-8 min-w-0 px-1.5 py-1"
|
|
404
|
-
>
|
|
405
|
-
<Icon [name]="option.icon" [size]="16" />
|
|
406
|
-
</button>
|
|
407
|
-
}
|
|
408
|
-
</ToggleGroup>
|
|
409
|
-
</section>
|
|
410
|
-
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: ToggleGroupComponent, selector: "ToggleGroup", inputs: ["type", "value", "values", "orientation", "variant", "size", "spacing", "loop", "disabled", "dir", "class"], outputs: ["valueChange", "valuesChange"] }, { kind: "directive", type: ToggleGroupItemDirective, selector: "button[ToggleGroupItem]", inputs: ["value", "disabled", "class"] }, { kind: "directive", type: TooltipDirective, selector: "[Tooltip]", inputs: ["Tooltip", "TooltipPosition", "TooltipDisabled", "TooltipShowDelay", "TooltipHideDelay"], exportAs: ["Tooltip"] }] });
|
|
411
|
-
}
|
|
412
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferenceSettingGroupComponent, decorators: [{
|
|
413
|
-
type: Component,
|
|
414
|
-
args: [{
|
|
415
|
-
selector: 'app-preference-setting-group',
|
|
416
|
-
imports: [IconComponent, ToggleGroupComponent, ToggleGroupItemDirective, TooltipDirective],
|
|
417
|
-
template: `
|
|
418
|
-
<section class="border-b border-border/65 px-3 py-2.5 last:border-b-0">
|
|
419
|
-
<div class="flex items-start justify-between gap-3">
|
|
420
|
-
<div class="min-w-0">
|
|
421
|
-
<h3 [id]="headingId()" class="text-sm font-medium text-foreground">{{ title() }}</h3>
|
|
422
|
-
@if (description()) {
|
|
423
|
-
<p class="mt-1 text-xs leading-4 text-muted-foreground">{{ description() }}</p>
|
|
424
|
-
}
|
|
425
|
-
</div>
|
|
426
|
-
|
|
427
|
-
<span
|
|
428
|
-
class="flex shrink-0 items-center gap-1 font-mono text-xs text-muted-foreground"
|
|
429
|
-
[attr.aria-label]="locked() ? activeLabel() + ', dikunci oleh gaya tema' : null"
|
|
430
|
-
>
|
|
431
|
-
{{ activeLabel() }}
|
|
432
|
-
@if (locked()) {
|
|
433
|
-
<Icon name="lock" [size]="14" aria-hidden="true" />
|
|
434
|
-
}
|
|
435
|
-
</span>
|
|
436
|
-
</div>
|
|
437
|
-
|
|
438
|
-
<ToggleGroup
|
|
439
|
-
type="single"
|
|
440
|
-
variant="segmented"
|
|
441
|
-
[value]="selected()"
|
|
442
|
-
[disabled]="locked()"
|
|
443
|
-
[attr.aria-labelledby]="headingId()"
|
|
444
|
-
class="mt-2 grid w-full grid-flow-col auto-cols-fr gap-0"
|
|
445
|
-
(valueChange)="onValueChange($event)"
|
|
446
|
-
>
|
|
447
|
-
@for (option of options(); track option.value) {
|
|
448
|
-
<button
|
|
449
|
-
ToggleGroupItem
|
|
450
|
-
[value]="option.value"
|
|
451
|
-
[Tooltip]="option.label"
|
|
452
|
-
[attr.aria-label]="option.label"
|
|
453
|
-
[attr.title]="option.label"
|
|
454
|
-
class="min-h-8 min-w-0 px-1.5 py-1"
|
|
455
|
-
>
|
|
456
|
-
<Icon [name]="option.icon" [size]="16" />
|
|
457
|
-
</button>
|
|
458
|
-
}
|
|
459
|
-
</ToggleGroup>
|
|
460
|
-
</section>
|
|
461
|
-
`,
|
|
462
|
-
}]
|
|
463
|
-
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], activeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeLabel", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: true }] }], headingId: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingId", required: true }] }], locked: [{ type: i0.Input, args: [{ isSignal: true, alias: "locked", required: false }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }] } });
|
|
464
|
-
|
|
465
|
-
const PRIMARY_NAVIGATION_ID$1 = 'main';
|
|
466
|
-
const VERTICAL_NAVIGATION_TYPES = ['sidebar', 'dockbar'];
|
|
467
|
-
const HORIZONTAL_NAVIGATION_TYPES = ['navbar', 'flyout'];
|
|
468
|
-
const NAVIGATION_LAYOUT_TYPES = ['vertical', 'horizontal'];
|
|
469
|
-
const DOCKBAR_MODES = ['default', 'sticky', 'drawer'];
|
|
470
|
-
const THEME_APPEARANCE_OPTIONS = {
|
|
471
|
-
browser: { label: 'Browser', icon: 'language' },
|
|
472
|
-
rail: { label: 'Rail', icon: 'view_sidebar' },
|
|
473
|
-
tablet: { label: 'Tablet', icon: 'tablet_android' },
|
|
474
|
-
desktop: { label: 'Desktop', icon: 'desktop_windows' },
|
|
475
|
-
};
|
|
476
|
-
const THEME_MODE_OPTIONS = {
|
|
477
|
-
light: { label: 'Terang', icon: 'light_mode' },
|
|
478
|
-
dark: { label: 'Gelap', icon: 'dark_mode' },
|
|
479
|
-
system: { label: 'Sistem', icon: 'contrast' },
|
|
480
|
-
};
|
|
481
|
-
const THEME_COLOR_OPTIONS = {
|
|
482
|
-
default: { label: 'Default', icon: 'format_color_fill' },
|
|
483
|
-
};
|
|
484
|
-
const THEME_BRAND_OPTIONS = {
|
|
485
|
-
default: { label: 'Default', icon: 'branding_watermark' },
|
|
486
|
-
};
|
|
487
|
-
const THEME_SPACE_OPTIONS = {
|
|
488
|
-
normal: { label: 'Normal', icon: 'density_large' },
|
|
489
|
-
compact: { label: 'Ringkas', icon: 'density_small' },
|
|
490
|
-
};
|
|
491
|
-
const THEME_RADIUS_OPTIONS = {
|
|
492
|
-
none: { label: 'Tanpa radius', icon: 'crop_square' },
|
|
493
|
-
small: { label: 'Kecil', icon: 'rounded_corner' },
|
|
494
|
-
medium: { label: 'Sedang', icon: 'rounded_corner' },
|
|
495
|
-
large: { label: 'Besar', icon: 'rounded_corner' },
|
|
496
|
-
};
|
|
497
|
-
const LAYOUT_SURFACE_OPTIONS = {
|
|
498
|
-
base: { label: 'Dasar', icon: 'crop_square' },
|
|
499
|
-
flat: { label: 'Datar', icon: 'crop_16_9' },
|
|
500
|
-
grid: { label: 'Grid', icon: 'grid_4x4' },
|
|
501
|
-
};
|
|
502
|
-
const LAYOUT_WIDTH_OPTIONS = {
|
|
503
|
-
full: { label: 'Penuh', icon: 'width_full' },
|
|
504
|
-
wide: { label: 'Lebar', icon: 'width_wide' },
|
|
505
|
-
container: { label: 'Container', icon: 'width_normal' },
|
|
506
|
-
fluid: { label: 'Fluid', icon: 'fit_screen' },
|
|
507
|
-
};
|
|
508
|
-
const LAYOUT_TYPE_OPTIONS = {
|
|
509
|
-
vertical: { label: 'Vertikal', icon: 'view_sidebar' },
|
|
510
|
-
horizontal: { label: 'Horizontal', icon: 'view_stream' },
|
|
511
|
-
};
|
|
512
|
-
const NAVIGATION_TYPE_OPTIONS = {
|
|
513
|
-
sidebar: { label: 'Sidebar', icon: 'left_panel_open' },
|
|
514
|
-
dockbar: { label: 'Dockbar', icon: 'dock_to_left' },
|
|
515
|
-
navbar: { label: 'Navbar', icon: 'top_panel_open' },
|
|
516
|
-
flyout: { label: 'Flyout', icon: 'menu_open' },
|
|
517
|
-
};
|
|
518
|
-
const NAVIGATION_POSITION_OPTIONS = {
|
|
519
|
-
left: { label: 'Kiri', icon: 'align_horizontal_left' },
|
|
520
|
-
right: { label: 'Kanan', icon: 'align_horizontal_right' },
|
|
521
|
-
top: { label: 'Atas', icon: 'vertical_align_top' },
|
|
522
|
-
bottom: { label: 'Bawah', icon: 'vertical_align_bottom' },
|
|
523
|
-
};
|
|
524
|
-
const DOCKBAR_MODE_OPTIONS = {
|
|
525
|
-
default: { label: 'Default', icon: 'vertical_align_center' },
|
|
526
|
-
sticky: { label: 'Melekat', icon: 'push_pin' },
|
|
527
|
-
drawer: { label: 'Drawer', icon: 'left_panel_open' },
|
|
528
|
-
};
|
|
529
|
-
function toOptions(values, options) {
|
|
530
|
-
return values.map((value) => ({
|
|
531
|
-
value,
|
|
532
|
-
label: options[value]?.label ?? value,
|
|
533
|
-
icon: options[value]?.icon ?? 'tune',
|
|
534
|
-
}));
|
|
535
|
-
}
|
|
536
|
-
class AppPreferencesSurfaceComponent {
|
|
537
|
-
config = inject(APP_PREFERENCES_CONFIG, { optional: true });
|
|
538
|
-
preferences = inject(AppPreferencesPanelService);
|
|
539
|
-
themeMode = inject(ThemeModeService);
|
|
540
|
-
themeSpace = inject(ThemeSpaceService);
|
|
541
|
-
themeRadius = inject(ThemeRadiusService);
|
|
542
|
-
themeAppearanceService = inject(ThemeAppearanceService);
|
|
543
|
-
themeColor = inject(ThemeColorService);
|
|
544
|
-
themeBrand = inject(ThemeBrandService);
|
|
545
|
-
layout = inject(LayoutService);
|
|
546
|
-
navigation = inject(NavigationService);
|
|
547
|
-
host = inject((ElementRef));
|
|
548
|
-
closeRequested = output();
|
|
549
|
-
announcement = signal('', /* @ts-ignore */
|
|
550
|
-
...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
551
|
-
defaults = this.config?.defaults ?? null;
|
|
552
|
-
hasDefaults = computed(() => this.defaults !== null, /* @ts-ignore */
|
|
553
|
-
...(ngDevMode ? [{ debugName: "hasDefaults" }] : /* istanbul ignore next */ []));
|
|
554
|
-
mode = this.themeMode.mode;
|
|
555
|
-
space = this.themeSpace.space;
|
|
556
|
-
radius = this.themeRadius.radius;
|
|
557
|
-
themeAppearance = this.themeAppearanceService.appearance;
|
|
558
|
-
color = this.themeColor.color;
|
|
559
|
-
brand = this.themeBrand.brand;
|
|
560
|
-
surface = this.layout.surface;
|
|
561
|
-
width = this.layout.width;
|
|
562
|
-
layoutType = this.layout.type;
|
|
563
|
-
navigationState = computed(() => this.navigation.state(PRIMARY_NAVIGATION_ID$1)() ?? {
|
|
564
|
-
id: PRIMARY_NAVIGATION_ID$1,
|
|
565
|
-
orientation: 'vertical',
|
|
566
|
-
type: 'sidebar',
|
|
567
|
-
position: 'left',
|
|
568
|
-
collapsed: false,
|
|
569
|
-
dockbarMode: 'default',
|
|
570
|
-
}, /* @ts-ignore */
|
|
571
|
-
...(ngDevMode ? [{ debugName: "navigationState" }] : /* istanbul ignore next */ []));
|
|
572
|
-
themeAppearanceOptions = toOptions(THEME_APPEARANCES, THEME_APPEARANCE_OPTIONS);
|
|
573
|
-
modeOptions = toOptions(THEME_MODES, THEME_MODE_OPTIONS);
|
|
574
|
-
colorOptions = toOptions(THEME_COLORS, THEME_COLOR_OPTIONS);
|
|
575
|
-
brandOptions = toOptions(THEME_BRANDS, THEME_BRAND_OPTIONS);
|
|
576
|
-
spaceOptions = toOptions(THEME_SPACES, THEME_SPACE_OPTIONS);
|
|
577
|
-
radiusOptions = toOptions(THEME_RADII, THEME_RADIUS_OPTIONS);
|
|
578
|
-
surfaceOptions = toOptions(['base', 'flat', 'grid'], LAYOUT_SURFACE_OPTIONS);
|
|
579
|
-
widthOptions = toOptions(['full', 'wide', 'container', 'fluid'], LAYOUT_WIDTH_OPTIONS);
|
|
580
|
-
layoutTypeOptions = toOptions(NAVIGATION_LAYOUT_TYPES, LAYOUT_TYPE_OPTIONS);
|
|
581
|
-
navigationTypeOptions = computed(() => toOptions(this.navigationState().orientation === 'vertical'
|
|
582
|
-
? VERTICAL_NAVIGATION_TYPES
|
|
583
|
-
: HORIZONTAL_NAVIGATION_TYPES, NAVIGATION_TYPE_OPTIONS), /* @ts-ignore */
|
|
584
|
-
...(ngDevMode ? [{ debugName: "navigationTypeOptions" }] : /* istanbul ignore next */ []));
|
|
585
|
-
navigationPositionOptions = computed(() => toOptions(this.navigationState().orientation === 'vertical' ? ['left', 'right'] : ['top', 'bottom'], NAVIGATION_POSITION_OPTIONS), /* @ts-ignore */
|
|
586
|
-
...(ngDevMode ? [{ debugName: "navigationPositionOptions" }] : /* istanbul ignore next */ []));
|
|
587
|
-
navigationModeOptions = computed(() => this.navigationState().orientation === 'horizontal'
|
|
588
|
-
? []
|
|
589
|
-
: this.navigationState().type === 'sidebar'
|
|
590
|
-
? [
|
|
591
|
-
{ value: 'expanded', label: 'Diperluas', icon: 'unfold_more' },
|
|
592
|
-
{ value: 'collapsed', label: 'Dipadatkan', icon: 'compress' },
|
|
593
|
-
]
|
|
594
|
-
: toOptions(DOCKBAR_MODES, DOCKBAR_MODE_OPTIONS), /* @ts-ignore */
|
|
595
|
-
...(ngDevMode ? [{ debugName: "navigationModeOptions" }] : /* istanbul ignore next */ []));
|
|
596
|
-
navigationMode = computed(() => {
|
|
597
|
-
const state = this.navigationState();
|
|
598
|
-
if (state.orientation === 'horizontal')
|
|
599
|
-
return 'default';
|
|
600
|
-
return state.type === 'sidebar'
|
|
601
|
-
? state.collapsed
|
|
602
|
-
? 'collapsed'
|
|
603
|
-
: 'expanded'
|
|
604
|
-
: state.dockbarMode;
|
|
605
|
-
}, /* @ts-ignore */
|
|
606
|
-
...(ngDevMode ? [{ debugName: "navigationMode" }] : /* istanbul ignore next */ []));
|
|
607
|
-
navigationModeLabel = computed(() => {
|
|
608
|
-
const state = this.navigationState();
|
|
609
|
-
if (state.orientation === 'horizontal')
|
|
610
|
-
return 'Default';
|
|
611
|
-
return state.type === 'sidebar'
|
|
612
|
-
? state.collapsed
|
|
613
|
-
? 'Dipadatkan'
|
|
614
|
-
: 'Diperluas'
|
|
615
|
-
: DOCKBAR_MODE_OPTIONS[state.dockbarMode].label;
|
|
616
|
-
}, /* @ts-ignore */
|
|
617
|
-
...(ngDevMode ? [{ debugName: "navigationModeLabel" }] : /* istanbul ignore next */ []));
|
|
618
|
-
navigationTypeLabel = computed(() => NAVIGATION_TYPE_OPTIONS[this.navigationState().type].label, /* @ts-ignore */
|
|
619
|
-
...(ngDevMode ? [{ debugName: "navigationTypeLabel" }] : /* istanbul ignore next */ []));
|
|
620
|
-
navigationPositionLabel = computed(() => NAVIGATION_POSITION_OPTIONS[this.navigationState().position].label, /* @ts-ignore */
|
|
621
|
-
...(ngDevMode ? [{ debugName: "navigationPositionLabel" }] : /* istanbul ignore next */ []));
|
|
622
|
-
constructor() {
|
|
623
|
-
const host = this.host.nativeElement;
|
|
624
|
-
afterNextRender(() => {
|
|
625
|
-
const closeButton = host.querySelector('[data-app-preferences-close]');
|
|
626
|
-
closeButton?.focus({ preventScroll: true });
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
selectThemeAppearance(value) {
|
|
630
|
-
if (!isThemeAppearance(value))
|
|
631
|
-
return;
|
|
632
|
-
// An appearance may switch the shell between sidebar and dockbar. Close the
|
|
633
|
-
// currently projected panel first so the navigation tree and preferences
|
|
634
|
-
// surface do not transition at the same time.
|
|
635
|
-
this.preferences.close();
|
|
636
|
-
this.themeAppearanceService.setAppearance(value);
|
|
637
|
-
}
|
|
638
|
-
selectMode(value) {
|
|
639
|
-
if (!this.isLocked('theme-mode') && isThemeMode(value))
|
|
640
|
-
this.themeMode.setMode(value);
|
|
641
|
-
}
|
|
642
|
-
selectColor(value) {
|
|
643
|
-
if (!this.isLocked('theme-color') && isThemeColor(value))
|
|
644
|
-
this.themeColor.setColor(value);
|
|
645
|
-
}
|
|
646
|
-
selectBrand(value) {
|
|
647
|
-
if (!this.isLocked('theme-brand') && isThemeBrand(value))
|
|
648
|
-
this.themeBrand.setBrand(value);
|
|
649
|
-
}
|
|
650
|
-
selectSpace(value) {
|
|
651
|
-
if (!this.isLocked('theme-space') && isThemeSpace(value))
|
|
652
|
-
this.themeSpace.setSpace(value);
|
|
653
|
-
}
|
|
654
|
-
selectRadius(value) {
|
|
655
|
-
if (!this.isLocked('theme-radius') && isThemeRadius(value))
|
|
656
|
-
this.themeRadius.setRadius(value);
|
|
657
|
-
}
|
|
658
|
-
selectSurface(value) {
|
|
659
|
-
if (!this.isLocked('layout-surface') && isUiLayoutSurface(value)) {
|
|
660
|
-
this.layout.setSurface(value);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
selectWidth(value) {
|
|
664
|
-
if (!this.isLocked('layout-width') && isUiLayoutWidth(value))
|
|
665
|
-
this.layout.setWidth(value);
|
|
666
|
-
}
|
|
667
|
-
selectLayoutType(value) {
|
|
668
|
-
if (this.isLayoutTypeLocked() ||
|
|
669
|
-
!isUiLayoutType(value) ||
|
|
670
|
-
!NAVIGATION_LAYOUT_TYPES.includes(value)) {
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
const orientation = value;
|
|
674
|
-
const state = this.navigationState();
|
|
675
|
-
const type = isNavigationTypeForOrientation(state.type, orientation)
|
|
676
|
-
? state.type
|
|
677
|
-
: orientation === 'vertical'
|
|
678
|
-
? 'sidebar'
|
|
679
|
-
: 'navbar';
|
|
680
|
-
const position = isNavigationPositionForOrientation(state.position, orientation)
|
|
681
|
-
? state.position
|
|
682
|
-
: orientation === 'vertical'
|
|
683
|
-
? 'left'
|
|
684
|
-
: 'top';
|
|
685
|
-
this.layout.setType(value);
|
|
686
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { orientation, type, position });
|
|
687
|
-
}
|
|
688
|
-
selectNavigationType(value) {
|
|
689
|
-
const state = this.navigationState();
|
|
690
|
-
if (!this.isLocked('nav-type') && isNavigationTypeForOrientation(value, state.orientation)) {
|
|
691
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { type: value });
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
selectNavigationMode(value) {
|
|
695
|
-
const state = this.navigationState();
|
|
696
|
-
if (this.isLocked('nav-type-mode'))
|
|
697
|
-
return;
|
|
698
|
-
if (state.type === 'sidebar' && (value === 'expanded' || value === 'collapsed')) {
|
|
699
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { collapsed: value === 'collapsed' });
|
|
700
|
-
}
|
|
701
|
-
if (state.type === 'dockbar' && DOCKBAR_MODES.includes(value)) {
|
|
702
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$1, {
|
|
703
|
-
dockbarMode: value,
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
selectNavigationPosition(value) {
|
|
708
|
-
const state = this.navigationState();
|
|
709
|
-
if (!this.isLocked('nav-position') &&
|
|
710
|
-
isNavigationPositionForOrientation(value, state.orientation)) {
|
|
711
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { position: value });
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
resetToDefaults() {
|
|
715
|
-
const defaults = this.defaults;
|
|
716
|
-
if (!defaults)
|
|
717
|
-
return;
|
|
718
|
-
let changed = false;
|
|
719
|
-
if (!this.isLocked('theme-mode') && this.mode() !== defaults.theme.mode) {
|
|
720
|
-
this.themeMode.setMode(defaults.theme.mode);
|
|
721
|
-
changed = true;
|
|
722
|
-
}
|
|
723
|
-
if (!this.isLocked('theme-color') && this.color() !== defaults.theme.color) {
|
|
724
|
-
this.themeColor.setColor(defaults.theme.color);
|
|
725
|
-
changed = true;
|
|
726
|
-
}
|
|
727
|
-
if (!this.isLocked('theme-brand') && this.brand() !== defaults.theme.brand) {
|
|
728
|
-
this.themeBrand.setBrand(defaults.theme.brand);
|
|
729
|
-
changed = true;
|
|
730
|
-
}
|
|
731
|
-
if (!this.isLocked('theme-space') && this.space() !== defaults.theme.space) {
|
|
732
|
-
this.themeSpace.setSpace(defaults.theme.space);
|
|
733
|
-
changed = true;
|
|
734
|
-
}
|
|
735
|
-
if (!this.isLocked('theme-radius') && this.radius() !== defaults.theme.radius) {
|
|
736
|
-
this.themeRadius.setRadius(defaults.theme.radius);
|
|
737
|
-
changed = true;
|
|
738
|
-
}
|
|
739
|
-
if (this.themeAppearance() !== defaults.theme.appearance) {
|
|
740
|
-
this.themeAppearanceService.setAppearance(defaults.theme.appearance);
|
|
741
|
-
changed = true;
|
|
742
|
-
}
|
|
743
|
-
if (!this.isLocked('layout-surface') && this.surface() !== defaults.layout.surface) {
|
|
744
|
-
this.layout.setSurface(defaults.layout.surface);
|
|
745
|
-
changed = true;
|
|
746
|
-
}
|
|
747
|
-
if (!this.isLocked('layout-width') && this.width() !== defaults.layout.width) {
|
|
748
|
-
this.layout.setWidth(defaults.layout.width);
|
|
749
|
-
changed = true;
|
|
750
|
-
}
|
|
751
|
-
if (!this.isLayoutTypeLocked() && this.layoutType() !== defaults.layout.type) {
|
|
752
|
-
this.selectLayoutType(defaults.layout.type);
|
|
753
|
-
changed = true;
|
|
754
|
-
}
|
|
755
|
-
const navigation = this.navigationState();
|
|
756
|
-
const nextNavigation = {
|
|
757
|
-
orientation: this.isLocked('nav-orientation')
|
|
758
|
-
? navigation.orientation
|
|
759
|
-
: defaults.navigation.orientation,
|
|
760
|
-
type: this.isLocked('nav-type') ? navigation.type : defaults.navigation.type,
|
|
761
|
-
position: this.isLocked('nav-position') ? navigation.position : defaults.navigation.position,
|
|
762
|
-
collapsed: this.isLocked('nav-type-mode')
|
|
763
|
-
? navigation.collapsed
|
|
764
|
-
: defaults.navigation.collapsed,
|
|
765
|
-
dockbarMode: this.isLocked('nav-type-mode')
|
|
766
|
-
? navigation.dockbarMode
|
|
767
|
-
: defaults.navigation.dockbarMode,
|
|
768
|
-
};
|
|
769
|
-
if (navigation.orientation !== nextNavigation.orientation ||
|
|
770
|
-
navigation.type !== nextNavigation.type ||
|
|
771
|
-
navigation.position !== nextNavigation.position ||
|
|
772
|
-
navigation.collapsed !== nextNavigation.collapsed ||
|
|
773
|
-
navigation.dockbarMode !== nextNavigation.dockbarMode) {
|
|
774
|
-
this.navigation.update(PRIMARY_NAVIGATION_ID$1, nextNavigation);
|
|
775
|
-
changed = true;
|
|
776
|
-
}
|
|
777
|
-
this.announce(changed ? 'Preferensi dikembalikan ke default.' : 'Preferensi sudah menggunakan default.');
|
|
778
|
-
}
|
|
779
|
-
announce(message) {
|
|
780
|
-
this.announcement.set('');
|
|
781
|
-
queueMicrotask(() => this.announcement.set(message));
|
|
782
|
-
}
|
|
783
|
-
isLocked(key) {
|
|
784
|
-
return isThemeAppearanceSettingLocked(this.themeAppearance(), key);
|
|
785
|
-
}
|
|
786
|
-
isLayoutTypeLocked() {
|
|
787
|
-
return this.isLocked('layout-type') || this.isLocked('nav-orientation');
|
|
788
|
-
}
|
|
789
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesSurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
790
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AppPreferencesSurfaceComponent, isStandalone: true, selector: "app-preferences-surface", outputs: { closeRequested: "closeRequested" }, host: { classAttribute: "block h-full min-h-0 w-full" }, ngImport: i0, template: "<Page variant=\"stacked\" height=\"fix\" scroll=\"content\" class=\"bg-background\">\n <PageHeader class=\"h-11 px-3 py-0\">\n <div class=\"flex h-full items-center justify-between gap-3\">\n <h2\n id=\"app-preferences-title\"\n class=\"min-w-0 truncate text-base font-semibold text-foreground\"\n >\n Preferensi aplikasi\n </h2>\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-11 w-11 shrink-0\"\n data-app-preferences-close\n aria-label=\"Tutup preferensi aplikasi\"\n (click)=\"closeRequested.emit()\"\n >\n <Icon name=\"close\" [size]=\"20\" />\n </button>\n </div>\n </PageHeader>\n\n <PageContent class=\"overscroll-contain bg-muted/20\">\n <div class=\"space-y-5 p-3\">\n <p class=\"text-xs leading-4 text-muted-foreground\">\n Sesuaikan tampilan dan navigasi aplikasi.\n </p>\n\n <section aria-labelledby=\"app-preferences-theme\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-theme\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Tema\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-theme-appearance\"\n title=\"Tampilan tema\"\n [activeLabel]=\"\n themeAppearanceOptions.find((option) => option.value === themeAppearance())?.label ??\n themeAppearance()\n \"\n [options]=\"themeAppearanceOptions\"\n [selected]=\"themeAppearance()\"\n (optionSelected)=\"selectThemeAppearance($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-mode\"\n title=\"Mode warna\"\n description=\"Sistem mengikuti preferensi perangkat.\"\n [activeLabel]=\"modeOptions.find((option) => option.value === mode())?.label ?? mode()\"\n [options]=\"modeOptions\"\n [selected]=\"mode()\"\n [locked]=\"isLocked('theme-mode')\"\n (optionSelected)=\"selectMode($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-color\"\n title=\"Warna tema\"\n [activeLabel]=\"colorOptions.find((option) => option.value === color())?.label ?? color()\"\n [options]=\"colorOptions\"\n [selected]=\"color()\"\n [locked]=\"isLocked('theme-color')\"\n (optionSelected)=\"selectColor($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-brand\"\n title=\"Brand\"\n [activeLabel]=\"brandOptions.find((option) => option.value === brand())?.label ?? brand()\"\n [options]=\"brandOptions\"\n [selected]=\"brand()\"\n [locked]=\"isLocked('theme-brand')\"\n (optionSelected)=\"selectBrand($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-space\"\n title=\"Kerapatan\"\n [activeLabel]=\"spaceOptions.find((option) => option.value === space())?.label ?? space()\"\n [options]=\"spaceOptions\"\n [selected]=\"space()\"\n [locked]=\"isLocked('theme-space')\"\n (optionSelected)=\"selectSpace($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-radius\"\n title=\"Sudut\"\n [activeLabel]=\"\n radiusOptions.find((option) => option.value === radius())?.label ?? radius()\n \"\n [options]=\"radiusOptions\"\n [selected]=\"radius()\"\n [locked]=\"isLocked('theme-radius')\"\n (optionSelected)=\"selectRadius($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-layout\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-layout\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Layout\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-surface\"\n title=\"Latar\"\n [activeLabel]=\"\n surfaceOptions.find((option) => option.value === surface())?.label ?? surface()\n \"\n [options]=\"surfaceOptions\"\n [selected]=\"surface()\"\n [locked]=\"isLocked('layout-surface')\"\n (optionSelected)=\"selectSurface($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-layout-type\"\n title=\"Tipe layout\"\n [activeLabel]=\"\n layoutTypeOptions.find((option) => option.value === layoutType())?.label ?? layoutType()\n \"\n [options]=\"layoutTypeOptions\"\n [selected]=\"layoutType()\"\n [locked]=\"isLayoutTypeLocked()\"\n (optionSelected)=\"selectLayoutType($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-width\"\n title=\"Lebar konten\"\n [activeLabel]=\"widthOptions.find((option) => option.value === width())?.label ?? width()\"\n [options]=\"widthOptions\"\n [selected]=\"width()\"\n [locked]=\"isLocked('layout-width')\"\n (optionSelected)=\"selectWidth($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-navigation\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-navigation\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Navigasi\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-type\"\n title=\"Tipe navigation\"\n [activeLabel]=\"navigationTypeLabel()\"\n [options]=\"navigationTypeOptions()\"\n [selected]=\"navigationState().type\"\n [locked]=\"isLocked('nav-type')\"\n (optionSelected)=\"selectNavigationType($event)\"\n />\n @if (navigationState().orientation === 'vertical') {\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-mode\"\n title=\"Mode navigation\"\n [activeLabel]=\"navigationModeLabel()\"\n [options]=\"navigationModeOptions()\"\n [selected]=\"navigationMode()\"\n [locked]=\"isLocked('nav-type-mode')\"\n (optionSelected)=\"selectNavigationMode($event)\"\n />\n }\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-position\"\n title=\"Posisi navigation\"\n [activeLabel]=\"navigationPositionLabel()\"\n [options]=\"navigationPositionOptions()\"\n [selected]=\"navigationState().position\"\n [locked]=\"isLocked('nav-position')\"\n (optionSelected)=\"selectNavigationPosition($event)\"\n />\n </section>\n </div>\n </PageContent>\n\n @if (hasDefaults()) {\n <PageFooter class=\"px-3 py-0\">\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n class=\"h-full w-full justify-start\"\n (click)=\"resetToDefaults()\"\n >\n <Icon name=\"restart_alt\" [size]=\"18\" />\n Kembalikan default\n </button>\n </PageFooter>\n }\n\n <p class=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</p>\n</Page>\n", dependencies: [{ kind: "component", type: AppPreferenceSettingGroupComponent, selector: "app-preference-setting-group", inputs: ["title", "description", "activeLabel", "options", "selected", "headingId", "locked"], outputs: ["optionSelected"] }, { kind: "component", type: ButtonComponent, selector: "button[Button], a[Button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: PageComponent, selector: "Page", inputs: ["variant", "height", "scroll", "position", "sideMode", "sideOpen", "sideWidth", "class"], outputs: ["sideOpenChange"] }, { kind: "component", type: PageContentComponent, selector: "PageContent", inputs: ["class"] }, { kind: "component", type: PageFooterComponent, selector: "PageFooter", inputs: ["class"] }, { kind: "component", type: PageHeaderComponent, selector: "PageHeader", inputs: ["class"] }] });
|
|
791
|
-
}
|
|
792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesSurfaceComponent, decorators: [{
|
|
793
|
-
type: Component,
|
|
794
|
-
args: [{ selector: 'app-preferences-surface', imports: [
|
|
795
|
-
AppPreferenceSettingGroupComponent,
|
|
796
|
-
ButtonComponent,
|
|
797
|
-
IconComponent,
|
|
798
|
-
PageComponent,
|
|
799
|
-
PageContentComponent,
|
|
800
|
-
PageFooterComponent,
|
|
801
|
-
PageHeaderComponent,
|
|
802
|
-
], host: {
|
|
803
|
-
class: 'block h-full min-h-0 w-full',
|
|
804
|
-
}, template: "<Page variant=\"stacked\" height=\"fix\" scroll=\"content\" class=\"bg-background\">\n <PageHeader class=\"h-11 px-3 py-0\">\n <div class=\"flex h-full items-center justify-between gap-3\">\n <h2\n id=\"app-preferences-title\"\n class=\"min-w-0 truncate text-base font-semibold text-foreground\"\n >\n Preferensi aplikasi\n </h2>\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-11 w-11 shrink-0\"\n data-app-preferences-close\n aria-label=\"Tutup preferensi aplikasi\"\n (click)=\"closeRequested.emit()\"\n >\n <Icon name=\"close\" [size]=\"20\" />\n </button>\n </div>\n </PageHeader>\n\n <PageContent class=\"overscroll-contain bg-muted/20\">\n <div class=\"space-y-5 p-3\">\n <p class=\"text-xs leading-4 text-muted-foreground\">\n Sesuaikan tampilan dan navigasi aplikasi.\n </p>\n\n <section aria-labelledby=\"app-preferences-theme\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-theme\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Tema\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-theme-appearance\"\n title=\"Tampilan tema\"\n [activeLabel]=\"\n themeAppearanceOptions.find((option) => option.value === themeAppearance())?.label ??\n themeAppearance()\n \"\n [options]=\"themeAppearanceOptions\"\n [selected]=\"themeAppearance()\"\n (optionSelected)=\"selectThemeAppearance($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-mode\"\n title=\"Mode warna\"\n description=\"Sistem mengikuti preferensi perangkat.\"\n [activeLabel]=\"modeOptions.find((option) => option.value === mode())?.label ?? mode()\"\n [options]=\"modeOptions\"\n [selected]=\"mode()\"\n [locked]=\"isLocked('theme-mode')\"\n (optionSelected)=\"selectMode($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-color\"\n title=\"Warna tema\"\n [activeLabel]=\"colorOptions.find((option) => option.value === color())?.label ?? color()\"\n [options]=\"colorOptions\"\n [selected]=\"color()\"\n [locked]=\"isLocked('theme-color')\"\n (optionSelected)=\"selectColor($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-brand\"\n title=\"Brand\"\n [activeLabel]=\"brandOptions.find((option) => option.value === brand())?.label ?? brand()\"\n [options]=\"brandOptions\"\n [selected]=\"brand()\"\n [locked]=\"isLocked('theme-brand')\"\n (optionSelected)=\"selectBrand($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-space\"\n title=\"Kerapatan\"\n [activeLabel]=\"spaceOptions.find((option) => option.value === space())?.label ?? space()\"\n [options]=\"spaceOptions\"\n [selected]=\"space()\"\n [locked]=\"isLocked('theme-space')\"\n (optionSelected)=\"selectSpace($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-radius\"\n title=\"Sudut\"\n [activeLabel]=\"\n radiusOptions.find((option) => option.value === radius())?.label ?? radius()\n \"\n [options]=\"radiusOptions\"\n [selected]=\"radius()\"\n [locked]=\"isLocked('theme-radius')\"\n (optionSelected)=\"selectRadius($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-layout\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-layout\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Layout\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-surface\"\n title=\"Latar\"\n [activeLabel]=\"\n surfaceOptions.find((option) => option.value === surface())?.label ?? surface()\n \"\n [options]=\"surfaceOptions\"\n [selected]=\"surface()\"\n [locked]=\"isLocked('layout-surface')\"\n (optionSelected)=\"selectSurface($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-layout-type\"\n title=\"Tipe layout\"\n [activeLabel]=\"\n layoutTypeOptions.find((option) => option.value === layoutType())?.label ?? layoutType()\n \"\n [options]=\"layoutTypeOptions\"\n [selected]=\"layoutType()\"\n [locked]=\"isLayoutTypeLocked()\"\n (optionSelected)=\"selectLayoutType($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-width\"\n title=\"Lebar konten\"\n [activeLabel]=\"widthOptions.find((option) => option.value === width())?.label ?? width()\"\n [options]=\"widthOptions\"\n [selected]=\"width()\"\n [locked]=\"isLocked('layout-width')\"\n (optionSelected)=\"selectWidth($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-navigation\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-navigation\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Navigasi\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-type\"\n title=\"Tipe navigation\"\n [activeLabel]=\"navigationTypeLabel()\"\n [options]=\"navigationTypeOptions()\"\n [selected]=\"navigationState().type\"\n [locked]=\"isLocked('nav-type')\"\n (optionSelected)=\"selectNavigationType($event)\"\n />\n @if (navigationState().orientation === 'vertical') {\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-mode\"\n title=\"Mode navigation\"\n [activeLabel]=\"navigationModeLabel()\"\n [options]=\"navigationModeOptions()\"\n [selected]=\"navigationMode()\"\n [locked]=\"isLocked('nav-type-mode')\"\n (optionSelected)=\"selectNavigationMode($event)\"\n />\n }\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-position\"\n title=\"Posisi navigation\"\n [activeLabel]=\"navigationPositionLabel()\"\n [options]=\"navigationPositionOptions()\"\n [selected]=\"navigationState().position\"\n [locked]=\"isLocked('nav-position')\"\n (optionSelected)=\"selectNavigationPosition($event)\"\n />\n </section>\n </div>\n </PageContent>\n\n @if (hasDefaults()) {\n <PageFooter class=\"px-3 py-0\">\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n class=\"h-full w-full justify-start\"\n (click)=\"resetToDefaults()\"\n >\n <Icon name=\"restart_alt\" [size]=\"18\" />\n Kembalikan default\n </button>\n </PageFooter>\n }\n\n <p class=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</p>\n</Page>\n" }]
|
|
805
|
-
}], ctorParameters: () => [], propDecorators: { closeRequested: [{ type: i0.Output, args: ["closeRequested"] }] } });
|
|
806
|
-
function isNavigationTypeForOrientation(value, orientation) {
|
|
807
|
-
return orientation === 'vertical'
|
|
808
|
-
? VERTICAL_NAVIGATION_TYPES.includes(value)
|
|
809
|
-
: HORIZONTAL_NAVIGATION_TYPES.includes(value);
|
|
810
|
-
}
|
|
811
|
-
function isNavigationPositionForOrientation(value, orientation) {
|
|
812
|
-
return orientation === 'vertical'
|
|
813
|
-
? value === 'left' || value === 'right'
|
|
814
|
-
: value === 'top' || value === 'bottom';
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
const PRIMARY_NAVIGATION_ID = 'main';
|
|
818
|
-
const NARROW_VIEWPORT_QUERY = '(max-width: 767.98px)';
|
|
819
|
-
class AppPreferencesComponent {
|
|
820
|
-
document = inject(DOCUMENT, { optional: true });
|
|
821
|
-
destroyRef = inject(DestroyRef);
|
|
822
|
-
layout = inject(LayoutService);
|
|
823
|
-
navigation = inject(NavigationService);
|
|
824
|
-
preferences = inject(AppPreferencesPanelService);
|
|
825
|
-
narrowState = signal(this.mediaQuery()?.matches ?? false, /* @ts-ignore */
|
|
826
|
-
...(ngDevMode ? [{ debugName: "narrowState" }] : /* istanbul ignore next */ []));
|
|
827
|
-
navigationState = computed(() => this.navigation.state(PRIMARY_NAVIGATION_ID)() ?? {
|
|
828
|
-
id: PRIMARY_NAVIGATION_ID,
|
|
829
|
-
orientation: 'vertical',
|
|
830
|
-
type: 'sidebar',
|
|
831
|
-
position: 'left',
|
|
832
|
-
collapsed: false,
|
|
833
|
-
dockbarMode: 'default',
|
|
834
|
-
}, /* @ts-ignore */
|
|
835
|
-
...(ngDevMode ? [{ debugName: "navigationState" }] : /* istanbul ignore next */ []));
|
|
836
|
-
inline = computed(() => this.layout.appearance() !== 'desktop' &&
|
|
837
|
-
!this.narrowState() &&
|
|
838
|
-
this.navigationState().type === 'sidebar' &&
|
|
839
|
-
!this.navigationState().collapsed, /* @ts-ignore */
|
|
840
|
-
...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
|
|
841
|
-
sheetSide = computed(() => this.navigationState().orientation === 'vertical' ? 'left' : 'right', /* @ts-ignore */
|
|
842
|
-
...(ngDevMode ? [{ debugName: "sheetSide" }] : /* istanbul ignore next */ []));
|
|
843
|
-
hostClass = computed(() => this.inline()
|
|
844
|
-
? 'block h-full w-76 border-r border-border'
|
|
845
|
-
: 'relative block h-full w-16', /* @ts-ignore */
|
|
846
|
-
...(ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []));
|
|
847
|
-
sheetClass = computed(() => cn('w-[min(19rem,calc(100dvw-2rem))]! max-w-none! gap-0! p-0!', this.sheetSide() === 'left' ? 'border-r-2 border-border' : 'border-l-2 border-border'), /* @ts-ignore */
|
|
848
|
-
...(ngDevMode ? [{ debugName: "sheetClass" }] : /* istanbul ignore next */ []));
|
|
849
|
-
constructor() {
|
|
850
|
-
const mediaQuery = this.mediaQuery();
|
|
851
|
-
const onChange = (event) => this.narrowState.set(event.matches);
|
|
852
|
-
mediaQuery?.addEventListener('change', onChange);
|
|
853
|
-
effect((onCleanup) => {
|
|
854
|
-
if (!this.inline() || !this.preferences.opened()) {
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
const onKeydown = (event) => {
|
|
858
|
-
if (event.key === 'Escape' && !event.defaultPrevented) {
|
|
859
|
-
this.preferences.close();
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
this.document?.addEventListener('keydown', onKeydown);
|
|
863
|
-
onCleanup(() => this.document?.removeEventListener('keydown', onKeydown));
|
|
864
|
-
});
|
|
865
|
-
this.destroyRef.onDestroy(() => {
|
|
866
|
-
mediaQuery?.removeEventListener('change', onChange);
|
|
867
|
-
if (this.preferences.opened())
|
|
868
|
-
this.preferences.close();
|
|
869
|
-
});
|
|
870
|
-
}
|
|
871
|
-
onSheetOpenChange(open) {
|
|
872
|
-
if (!open)
|
|
873
|
-
this.preferences.close();
|
|
874
|
-
}
|
|
875
|
-
mediaQuery() {
|
|
876
|
-
return this.document?.defaultView?.matchMedia?.(NARROW_VIEWPORT_QUERY) ?? null;
|
|
877
|
-
}
|
|
878
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
879
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AppPreferencesComponent, isStandalone: true, selector: "app-preferences", host: { properties: { "class": "hostClass()", "attr.role": "inline() ? \"region\" : null", "attr.aria-labelledby": "inline() ? \"app-preferences-title\" : null" } }, ngImport: i0, template: `
|
|
880
|
-
@if (inline()) {
|
|
881
|
-
<section
|
|
882
|
-
id="app-preferences-panel"
|
|
883
|
-
class="h-full min-h-0 w-full"
|
|
884
|
-
aria-labelledby="app-preferences-title"
|
|
885
|
-
>
|
|
886
|
-
<app-preferences-surface (closeRequested)="preferences.close()" />
|
|
887
|
-
</section>
|
|
888
|
-
} @else {
|
|
889
|
-
<Sheet
|
|
890
|
-
[open]="preferences.opened()"
|
|
891
|
-
[side]="sheetSide()"
|
|
892
|
-
[showCloseButton]="false"
|
|
893
|
-
[restoreFocus]="false"
|
|
894
|
-
aria-labelledby="app-preferences-title"
|
|
895
|
-
[class]="sheetClass()"
|
|
896
|
-
(openedChange)="onSheetOpenChange($event)"
|
|
897
|
-
>
|
|
898
|
-
<app-preferences-surface
|
|
899
|
-
id="app-preferences-panel"
|
|
900
|
-
(closeRequested)="preferences.close()"
|
|
901
|
-
/>
|
|
902
|
-
</Sheet>
|
|
903
|
-
}
|
|
904
|
-
`, isInline: true, dependencies: [{ kind: "component", type: AppPreferencesSurfaceComponent, selector: "app-preferences-surface", outputs: ["closeRequested"] }, { kind: "component", type: SheetComponent, selector: "Sheet, Drawer", inputs: ["open", "side", "variant", "closeOnEscape", "closeOnBackdropClick", "showCloseButton", "restoreFocus", "closeButtonLabel", "aria-labelledby", "aria-describedby", "class"], outputs: ["openChange", "openedChange"] }] });
|
|
905
|
-
}
|
|
906
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesComponent, decorators: [{
|
|
907
|
-
type: Component,
|
|
908
|
-
args: [{
|
|
909
|
-
selector: 'app-preferences',
|
|
910
|
-
imports: [AppPreferencesSurfaceComponent, SheetComponent],
|
|
911
|
-
host: {
|
|
912
|
-
'[class]': 'hostClass()',
|
|
913
|
-
'[attr.role]': 'inline() ? "region" : null',
|
|
914
|
-
'[attr.aria-labelledby]': 'inline() ? "app-preferences-title" : null',
|
|
915
|
-
},
|
|
916
|
-
template: `
|
|
917
|
-
@if (inline()) {
|
|
918
|
-
<section
|
|
919
|
-
id="app-preferences-panel"
|
|
920
|
-
class="h-full min-h-0 w-full"
|
|
921
|
-
aria-labelledby="app-preferences-title"
|
|
922
|
-
>
|
|
923
|
-
<app-preferences-surface (closeRequested)="preferences.close()" />
|
|
924
|
-
</section>
|
|
925
|
-
} @else {
|
|
926
|
-
<Sheet
|
|
927
|
-
[open]="preferences.opened()"
|
|
928
|
-
[side]="sheetSide()"
|
|
929
|
-
[showCloseButton]="false"
|
|
930
|
-
[restoreFocus]="false"
|
|
931
|
-
aria-labelledby="app-preferences-title"
|
|
932
|
-
[class]="sheetClass()"
|
|
933
|
-
(openedChange)="onSheetOpenChange($event)"
|
|
934
|
-
>
|
|
935
|
-
<app-preferences-surface
|
|
936
|
-
id="app-preferences-panel"
|
|
937
|
-
(closeRequested)="preferences.close()"
|
|
938
|
-
/>
|
|
939
|
-
</Sheet>
|
|
940
|
-
}
|
|
941
|
-
`,
|
|
942
|
-
}]
|
|
943
|
-
}], ctorParameters: () => [] });
|
|
944
|
-
|
|
945
|
-
class AppPreferencesTriggerDirective {
|
|
946
|
-
elementRef = inject((ElementRef));
|
|
947
|
-
preferences = inject(AppPreferencesPanelService);
|
|
948
|
-
isButton = computed(() => this.elementRef.nativeElement.localName === 'button', /* @ts-ignore */
|
|
949
|
-
...(ngDevMode ? [{ debugName: "isButton" }] : /* istanbul ignore next */ []));
|
|
950
|
-
onClick(event) {
|
|
951
|
-
if (this.preferences.open(this.elementRef.nativeElement)) {
|
|
952
|
-
event.preventDefault();
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
956
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: AppPreferencesTriggerDirective, isStandalone: true, selector: "[appPreferencesTrigger]", host: { listeners: { "click": "onClick($event)" }, properties: { "attr.aria-expanded": "preferences.opened()", "attr.aria-controls": "preferences.opened() ? \"app-preferences-panel\" : null", "attr.aria-disabled": "isButton() && !preferences.supported() ? \"true\" : null", "attr.disabled": "isButton() && !preferences.supported() ? \"\" : null" } }, ngImport: i0 });
|
|
957
|
-
}
|
|
958
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AppPreferencesTriggerDirective, decorators: [{
|
|
959
|
-
type: Directive,
|
|
960
|
-
args: [{
|
|
961
|
-
selector: '[appPreferencesTrigger]',
|
|
962
|
-
host: {
|
|
963
|
-
'[attr.aria-expanded]': 'preferences.opened()',
|
|
964
|
-
'[attr.aria-controls]': 'preferences.opened() ? "app-preferences-panel" : null',
|
|
965
|
-
'[attr.aria-disabled]': 'isButton() && !preferences.supported() ? "true" : null',
|
|
966
|
-
'[attr.disabled]': 'isButton() && !preferences.supported() ? "" : null',
|
|
967
|
-
'(click)': 'onClick($event)',
|
|
968
|
-
},
|
|
969
|
-
}]
|
|
970
|
-
}] });
|
|
971
|
-
|
|
972
|
-
/** Registers immutable runtime fallbacks without replacing stored theme preferences. */
|
|
973
|
-
function provideRuntimeThemeDevice(options = {}) {
|
|
974
|
-
return makeEnvironmentProviders([
|
|
975
|
-
provideAppInitializer(() => {
|
|
976
|
-
const runtime = inject(RuntimeContextService);
|
|
977
|
-
const themeDevice = inject(ThemeDeviceService);
|
|
978
|
-
const themeAppearance = inject(ThemeAppearanceService);
|
|
979
|
-
return runtime.initialize().then(() => {
|
|
980
|
-
const deviceType = runtime.deviceType();
|
|
981
|
-
themeDevice.registerType(deviceType);
|
|
982
|
-
if (options.appearanceFallback !== false) {
|
|
983
|
-
themeAppearance.registerAppearance(appearanceForDeviceType(deviceType));
|
|
984
|
-
}
|
|
985
|
-
});
|
|
986
|
-
}),
|
|
987
|
-
]);
|
|
988
|
-
}
|
|
989
|
-
function appearanceForDeviceType(deviceType) {
|
|
990
|
-
switch (deviceType) {
|
|
991
|
-
case 'windows':
|
|
992
|
-
case 'macos':
|
|
993
|
-
return 'desktop';
|
|
994
|
-
case 'android':
|
|
995
|
-
case 'ipados':
|
|
996
|
-
return 'tablet';
|
|
997
|
-
case 'browser':
|
|
998
|
-
return 'browser';
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
/**
|
|
1003
|
-
* Generated bundle index. Do not edit.
|
|
1004
|
-
*/
|
|
1005
|
-
|
|
1006
|
-
export { APP_PREFERENCES_CONFIG, AppPreferencesComponent, AppPreferencesPanelService, AppPreferencesTriggerDirective, provideAppPreferences, provideRuntimeThemeDevice };
|
|
1007
|
-
//# sourceMappingURL=edsis-angular-block-themes.mjs.map
|