@ojiepermana/angular 21.3.4 → 22.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -298
- package/fesm2022/ojiepermana-angular-chart.mjs +11 -0
- package/fesm2022/ojiepermana-angular-chart.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component.mjs +11 -0
- package/fesm2022/ojiepermana-angular-component.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs +11 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-sdk.mjs +11 -0
- package/fesm2022/ojiepermana-angular-sdk.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-theme.mjs +3 -374
- package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular.mjs +14 -14
- package/fesm2022/ojiepermana-angular.mjs.map +1 -1
- package/package.json +25 -361
- package/types/ojiepermana-angular-chart.d.ts +1 -0
- package/types/ojiepermana-angular-component.d.ts +1 -0
- package/types/ojiepermana-angular-navigation.d.ts +1 -0
- package/types/ojiepermana-angular-sdk.d.ts +1 -0
- package/types/ojiepermana-angular-theme.d.ts +1 -116
- package/types/ojiepermana-angular.d.ts +5 -3
- package/.npmignore +0 -2
- package/collection.json +0 -30
- package/component/accordion/package.json +0 -4
- package/component/alert/package.json +0 -4
- package/component/alert-dialog/package.json +0 -4
- package/component/aspect-ratio/package.json +0 -4
- package/component/avatar/package.json +0 -4
- package/component/badge/package.json +0 -4
- package/component/breadcrumb/package.json +0 -4
- package/component/button/package.json +0 -4
- package/component/button-group/package.json +0 -4
- package/component/calendar/package.json +0 -4
- package/component/card/package.json +0 -4
- package/component/carousel/package.json +0 -4
- package/component/chart/README.md +0 -249
- package/component/chart/area/package.json +0 -4
- package/component/chart/bar/package.json +0 -4
- package/component/chart/line/package.json +0 -4
- package/component/chart/package.json +0 -4
- package/component/chart/pie/package.json +0 -4
- package/component/chart/radar/package.json +0 -4
- package/component/chart/radial/package.json +0 -4
- package/component/chart/scatter/package.json +0 -4
- package/component/checkbox/package.json +0 -4
- package/component/collapsible/package.json +0 -4
- package/component/combobox/package.json +0 -4
- package/component/command/package.json +0 -4
- package/component/context-menu/package.json +0 -4
- package/component/date-picker/package.json +0 -4
- package/component/dialog/package.json +0 -4
- package/component/drawer/package.json +0 -4
- package/component/dropdown-menu/package.json +0 -4
- package/component/form/package.json +0 -4
- package/component/input/package.json +0 -4
- package/component/input-group/package.json +0 -4
- package/component/item/package.json +0 -4
- package/component/label/package.json +0 -4
- package/component/pagination/package.json +0 -4
- package/component/popover/package.json +0 -4
- package/component/progress/package.json +0 -4
- package/component/radio/package.json +0 -4
- package/component/scroll-area/package.json +0 -4
- package/component/select/package.json +0 -4
- package/component/separator/package.json +0 -4
- package/component/sheet/package.json +0 -4
- package/component/skeleton/package.json +0 -4
- package/component/slider/package.json +0 -4
- package/component/switch/package.json +0 -4
- package/component/table/package.json +0 -4
- package/component/tabs/package.json +0 -4
- package/component/textarea/package.json +0 -4
- package/component/toast/package.json +0 -4
- package/component/tooltip/package.json +0 -4
- package/component/utils/package.json +0 -4
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +0 -174
- package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +0 -242
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-alert.mjs +0 -90
- package/fesm2022/ojiepermana-angular-component-alert.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +0 -33
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +0 -123
- package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-badge.mjs +0 -47
- package/fesm2022/ojiepermana-angular-component-badge.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +0 -186
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +0 -95
- package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-button.mjs +0 -64
- package/fesm2022/ojiepermana-angular-component-button.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +0 -78
- package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-card.mjs +0 -137
- package/fesm2022/ojiepermana-angular-component-card.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +0 -310
- package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-area.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-area.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-bar.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-bar.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-line.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-line.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-pie.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-pie.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-radar.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-radar.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-radial.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-radial.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-chart.mjs +0 -3714
- package/fesm2022/ojiepermana-angular-component-chart.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +0 -104
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +0 -116
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +0 -263
- package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-command.mjs +0 -268
- package/fesm2022/ojiepermana-angular-component-command.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +0 -100
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +0 -155
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +0 -262
- package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +0 -6
- package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +0 -458
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-form.mjs +0 -208
- package/fesm2022/ojiepermana-angular-component-form.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +0 -164
- package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-input.mjs +0 -43
- package/fesm2022/ojiepermana-angular-component-input.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-item.mjs +0 -241
- package/fesm2022/ojiepermana-angular-component-item.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-label.mjs +0 -30
- package/fesm2022/ojiepermana-angular-component-label.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +0 -192
- package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-popover.mjs +0 -163
- package/fesm2022/ojiepermana-angular-component-popover.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-progress.mjs +0 -53
- package/fesm2022/ojiepermana-angular-component-progress.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-radio.mjs +0 -92
- package/fesm2022/ojiepermana-angular-component-radio.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +0 -48
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-select.mjs +0 -131
- package/fesm2022/ojiepermana-angular-component-select.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-separator.mjs +0 -33
- package/fesm2022/ojiepermana-angular-component-separator.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +0 -235
- package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +0 -29
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-slider.mjs +0 -29
- package/fesm2022/ojiepermana-angular-component-slider.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-switch.mjs +0 -84
- package/fesm2022/ojiepermana-angular-component-switch.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-table.mjs +0 -139
- package/fesm2022/ojiepermana-angular-component-table.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +0 -252
- package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +0 -37
- package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-toast.mjs +0 -47
- package/fesm2022/ojiepermana-angular-component-toast.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +0 -56
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component-utils.mjs +0 -13
- package/fesm2022/ojiepermana-angular-component-utils.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-generator-api.mjs +0 -68
- package/fesm2022/ojiepermana-angular-generator-api.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-component.mjs +0 -581
- package/fesm2022/ojiepermana-angular-layout-component.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-empty.mjs +0 -49
- package/fesm2022/ojiepermana-angular-layout-empty.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-horizontal.mjs +0 -119
- package/fesm2022/ojiepermana-angular-layout-horizontal.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-provider.mjs +0 -21
- package/fesm2022/ojiepermana-angular-layout-provider.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-services.mjs +0 -114
- package/fesm2022/ojiepermana-angular-layout-services.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-shell.mjs +0 -48
- package/fesm2022/ojiepermana-angular-layout-shell.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-token-directive.mjs +0 -27
- package/fesm2022/ojiepermana-angular-layout-token-directive.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-token.mjs +0 -33
- package/fesm2022/ojiepermana-angular-layout-token.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-vertical.mjs +0 -113
- package/fesm2022/ojiepermana-angular-layout-vertical.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout.mjs +0 -461
- package/fesm2022/ojiepermana-angular-layout.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs +0 -334
- package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +0 -59
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-item.mjs +0 -548
- package/fesm2022/ojiepermana-angular-navigation-item.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +0 -204
- package/fesm2022/ojiepermana-angular-navigation-service.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs +0 -373
- package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-topbar.mjs +0 -433
- package/fesm2022/ojiepermana-angular-navigation-topbar.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-navigation-types.mjs +0 -4
- package/fesm2022/ojiepermana-angular-navigation-types.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-theme-provider.mjs +0 -35
- package/fesm2022/ojiepermana-angular-theme-provider.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-theme-services.mjs +0 -286
- package/fesm2022/ojiepermana-angular-theme-services.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-theme-token.mjs +0 -56
- package/fesm2022/ojiepermana-angular-theme-token.mjs.map +0 -1
- package/generator/api/README.md +0 -252
- package/generator/api/bin/package.json +0 -3
- package/generator/api/bin/schematics/init/index.js +0 -90
- package/generator/api/bin/schematics/ng-add/index.js +0 -131
- package/generator/api/bin/schematics/sdk/index.js +0 -76
- package/generator/api/bin/src/config/loader.js +0 -41
- package/generator/api/bin/src/config/schema.js +0 -57
- package/generator/api/bin/src/emit/client.js +0 -246
- package/generator/api/bin/src/emit/metadata.js +0 -295
- package/generator/api/bin/src/emit/models.js +0 -106
- package/generator/api/bin/src/emit/navigation.js +0 -56
- package/generator/api/bin/src/emit/operations.js +0 -122
- package/generator/api/bin/src/emit/public-api.js +0 -54
- package/generator/api/bin/src/emit/services.js +0 -87
- package/generator/api/bin/src/engine.js +0 -65
- package/generator/api/bin/src/layout/per-domain.js +0 -359
- package/generator/api/bin/src/parser/bundle.js +0 -25
- package/generator/api/bin/src/parser/ir.js +0 -320
- package/generator/api/bin/src/parser/types.js +0 -7
- package/generator/api/bin/src/render/template.js +0 -58
- package/generator/api/bin/src/writer/index.js +0 -278
- package/generator/api/package.json +0 -4
- package/generator/api/schematics/init/schema.json +0 -19
- package/generator/api/schematics/ng-add/schema.json +0 -14
- package/generator/api/schematics/sdk/schema.json +0 -19
- package/generator/api/sdk.config.example.json +0 -24
- package/generator/guide/README.md +0 -84
- package/generator/guide/bin/package.json +0 -3
- package/generator/guide/bin/schematics/build/index.js +0 -35
- package/generator/guide/bin/schematics/init/index.js +0 -70
- package/generator/guide/bin/src/config/loader.js +0 -50
- package/generator/guide/bin/src/config/schema.js +0 -12
- package/generator/guide/bin/src/engine/component.js +0 -74
- package/generator/guide/bin/src/engine/frontmatter.js +0 -42
- package/generator/guide/bin/src/engine/index.js +0 -42
- package/generator/guide/bin/src/engine/naming.js +0 -39
- package/generator/guide/bin/src/engine/render.js +0 -31
- package/generator/guide/bin/src/engine/routes.js +0 -106
- package/generator/guide/bin/src/engine/walk.js +0 -35
- package/generator/guide/guide.config.example.json +0 -9
- package/generator/guide/schematics/build/schema.json +0 -14
- package/generator/guide/schematics/init/schema.json +0 -19
- package/layout/component/package.json +0 -4
- package/layout/empty/package.json +0 -4
- package/layout/horizontal/package.json +0 -4
- package/layout/package.json +0 -4
- package/layout/provider/package.json +0 -4
- package/layout/services/package.json +0 -4
- package/layout/shell/package.json +0 -4
- package/layout/token/directive/package.json +0 -4
- package/layout/token/package.json +0 -4
- package/layout/vertical/package.json +0 -4
- package/navigation/demo-data/package.json +0 -4
- package/navigation/icon/package.json +0 -4
- package/navigation/item/package.json +0 -4
- package/navigation/service/package.json +0 -4
- package/navigation/sidebar/package.json +0 -4
- package/navigation/topbar/package.json +0 -4
- package/navigation/types/package.json +0 -4
- package/theme/README.md +0 -67
- package/theme/package.json +0 -4
- package/theme/provider/package.json +0 -4
- package/theme/services/package.json +0 -4
- package/theme/styles/foundation/components.css +0 -81
- package/theme/styles/foundation/layers.css +0 -15
- package/theme/styles/foundation/tokens.css +0 -55
- package/theme/styles/index.css +0 -37
- package/theme/styles/integrations/material.css +0 -254
- package/theme/styles/integrations/tailwind.css +0 -114
- package/theme/styles/variants/color/amber.css +0 -31
- package/theme/styles/variants/color/base.css +0 -36
- package/theme/styles/variants/color/blue.css +0 -31
- package/theme/styles/variants/color/cyan.css +0 -31
- package/theme/styles/variants/color/emerald.css +0 -31
- package/theme/styles/variants/color/fuchsia.css +0 -31
- package/theme/styles/variants/color/green.css +0 -31
- package/theme/styles/variants/color/index.css +0 -22
- package/theme/styles/variants/color/indigo.css +0 -31
- package/theme/styles/variants/color/lime.css +0 -31
- package/theme/styles/variants/color/orange.css +0 -31
- package/theme/styles/variants/color/pink.css +0 -31
- package/theme/styles/variants/color/purple.css +0 -31
- package/theme/styles/variants/color/red.css +0 -31
- package/theme/styles/variants/color/rose.css +0 -31
- package/theme/styles/variants/color/sky.css +0 -31
- package/theme/styles/variants/color/teal.css +0 -31
- package/theme/styles/variants/color/violet.css +0 -31
- package/theme/styles/variants/color/yellow.css +0 -31
- package/theme/styles/variants/mode/dark.css +0 -20
- package/theme/styles/variants/mode/index.css +0 -6
- package/theme/styles/variants/mode/light.css +0 -24
- package/theme/styles/variants/style/brutal.css +0 -50
- package/theme/styles/variants/style/default.css +0 -54
- package/theme/styles/variants/style/index.css +0 -8
- package/theme/styles/variants/style/sharp.css +0 -50
- package/theme/styles/variants/style/soft.css +0 -50
- package/theme/token/package.json +0 -4
- package/types/ojiepermana-angular-component-accordion.d.ts +0 -51
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +0 -93
- package/types/ojiepermana-angular-component-alert.d.ts +0 -37
- package/types/ojiepermana-angular-component-aspect-ratio.d.ts +0 -12
- package/types/ojiepermana-angular-component-avatar.d.ts +0 -51
- package/types/ojiepermana-angular-component-badge.d.ts +0 -19
- package/types/ojiepermana-angular-component-breadcrumb.d.ts +0 -46
- package/types/ojiepermana-angular-component-button-group.d.ts +0 -26
- package/types/ojiepermana-angular-component-button.d.ts +0 -22
- package/types/ojiepermana-angular-component-calendar.d.ts +0 -33
- package/types/ojiepermana-angular-component-card.d.ts +0 -60
- package/types/ojiepermana-angular-component-carousel.d.ts +0 -86
- package/types/ojiepermana-angular-component-chart-area.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart-bar.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart-line.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart-pie.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart-radar.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart-radial.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart-scatter.d.ts +0 -1
- package/types/ojiepermana-angular-component-chart.d.ts +0 -1094
- package/types/ojiepermana-angular-component-checkbox.d.ts +0 -35
- package/types/ojiepermana-angular-component-collapsible.d.ts +0 -42
- package/types/ojiepermana-angular-component-combobox.d.ts +0 -51
- package/types/ojiepermana-angular-component-command.d.ts +0 -99
- package/types/ojiepermana-angular-component-context-menu.d.ts +0 -35
- package/types/ojiepermana-angular-component-date-picker.d.ts +0 -41
- package/types/ojiepermana-angular-component-dialog.d.ts +0 -87
- package/types/ojiepermana-angular-component-drawer.d.ts +0 -1
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +0 -135
- package/types/ojiepermana-angular-component-form.d.ts +0 -92
- package/types/ojiepermana-angular-component-input-group.d.ts +0 -51
- package/types/ojiepermana-angular-component-input.d.ts +0 -16
- package/types/ojiepermana-angular-component-item.d.ts +0 -88
- package/types/ojiepermana-angular-component-label.d.ts +0 -11
- package/types/ojiepermana-angular-component-pagination.d.ts +0 -27
- package/types/ojiepermana-angular-component-popover.d.ts +0 -43
- package/types/ojiepermana-angular-component-progress.d.ts +0 -17
- package/types/ojiepermana-angular-component-radio.d.ts +0 -34
- package/types/ojiepermana-angular-component-scroll-area.d.ts +0 -19
- package/types/ojiepermana-angular-component-select.d.ts +0 -45
- package/types/ojiepermana-angular-component-separator.d.ts +0 -14
- package/types/ojiepermana-angular-component-sheet.d.ts +0 -74
- package/types/ojiepermana-angular-component-skeleton.d.ts +0 -10
- package/types/ojiepermana-angular-component-slider.d.ts +0 -16
- package/types/ojiepermana-angular-component-switch.d.ts +0 -30
- package/types/ojiepermana-angular-component-table.d.ts +0 -52
- package/types/ojiepermana-angular-component-tabs.d.ts +0 -92
- package/types/ojiepermana-angular-component-textarea.d.ts +0 -12
- package/types/ojiepermana-angular-component-toast.d.ts +0 -29
- package/types/ojiepermana-angular-component-tooltip.d.ts +0 -22
- package/types/ojiepermana-angular-component-utils.d.ts +0 -5
- package/types/ojiepermana-angular-generator-api.d.ts +0 -86
- package/types/ojiepermana-angular-layout-component.d.ts +0 -205
- package/types/ojiepermana-angular-layout-empty.d.ts +0 -22
- package/types/ojiepermana-angular-layout-horizontal.d.ts +0 -36
- package/types/ojiepermana-angular-layout-provider.d.ts +0 -6
- package/types/ojiepermana-angular-layout-services.d.ts +0 -25
- package/types/ojiepermana-angular-layout-shell.d.ts +0 -8
- package/types/ojiepermana-angular-layout-token-directive.d.ts +0 -13
- package/types/ojiepermana-angular-layout-token.d.ts +0 -36
- package/types/ojiepermana-angular-layout-vertical.d.ts +0 -38
- package/types/ojiepermana-angular-layout.d.ts +0 -164
- package/types/ojiepermana-angular-navigation-demo-data.d.ts +0 -5
- package/types/ojiepermana-angular-navigation-icon.d.ts +0 -17
- package/types/ojiepermana-angular-navigation-item.d.ts +0 -54
- package/types/ojiepermana-angular-navigation-service.d.ts +0 -77
- package/types/ojiepermana-angular-navigation-sidebar.d.ts +0 -75
- package/types/ojiepermana-angular-navigation-topbar.d.ts +0 -54
- package/types/ojiepermana-angular-navigation-types.d.ts +0 -129
- package/types/ojiepermana-angular-theme-provider.d.ts +0 -11
- package/types/ojiepermana-angular-theme-services.d.ts +0 -55
- package/types/ojiepermana-angular-theme-token.d.ts +0 -57
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { DOCUMENT } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, DestroyRef, signal, computed, effect, Injectable } from '@angular/core';
|
|
4
|
-
import { isThemeColor, MATERIAL_THEME_CONFIG, isColorScheme, DEFAULT_MATERIAL_THEME_CONFIG, isThemeBrand, isThemeStyle } from '@ojiepermana/angular/theme/token';
|
|
5
|
-
|
|
6
|
-
class ThemeService {
|
|
7
|
-
document = inject(DOCUMENT);
|
|
8
|
-
destroyRef = inject(DestroyRef);
|
|
9
|
-
config = this.resolveConfig();
|
|
10
|
-
initialBrand = this.readPersistedBrand() ?? this.config.defaultBrand;
|
|
11
|
-
_modePreference = signal(this.readPersistedMode() ?? this.config.defaultMode, ...(ngDevMode ? [{ debugName: "_modePreference" }] : /* istanbul ignore next */ []));
|
|
12
|
-
_brand = signal(this.initialBrand, ...(ngDevMode ? [{ debugName: "_brand" }] : /* istanbul ignore next */ []));
|
|
13
|
-
_color = signal(this.initialBrand ? this.config.defaultColor : (this.readPersistedColor() ?? this.config.defaultColor), ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
|
|
14
|
-
_style = signal(this.initialBrand ? this.config.defaultStyle : (this.readPersistedStyle() ?? this.config.defaultStyle), ...(ngDevMode ? [{ debugName: "_style" }] : /* istanbul ignore next */ []));
|
|
15
|
-
_systemPrefersDark = signal(this.prefersDark(), ...(ngDevMode ? [{ debugName: "_systemPrefersDark" }] : /* istanbul ignore next */ []));
|
|
16
|
-
scheme = this._modePreference.asReadonly();
|
|
17
|
-
brand = this._brand.asReadonly();
|
|
18
|
-
color = this._color.asReadonly();
|
|
19
|
-
theme = this._color.asReadonly();
|
|
20
|
-
style = this._style.asReadonly();
|
|
21
|
-
mode = computed(() => this.resolveMode(this._modePreference()), ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
22
|
-
snapshot = computed(() => ({
|
|
23
|
-
mode: this.mode(),
|
|
24
|
-
brand: this._brand(),
|
|
25
|
-
color: this._color(),
|
|
26
|
-
style: this._style(),
|
|
27
|
-
}), ...(ngDevMode ? [{ debugName: "snapshot" }] : /* istanbul ignore next */ []));
|
|
28
|
-
isDark = computed(() => this.mode() === 'dark', ...(ngDevMode ? [{ debugName: "isDark" }] : /* istanbul ignore next */ []));
|
|
29
|
-
constructor() {
|
|
30
|
-
this.watchSystemScheme();
|
|
31
|
-
effect(() => {
|
|
32
|
-
const root = this.document.documentElement;
|
|
33
|
-
const mode = this.mode();
|
|
34
|
-
const brand = this._brand();
|
|
35
|
-
const color = this._color();
|
|
36
|
-
const style = this._style();
|
|
37
|
-
root.dataset['mode'] = mode;
|
|
38
|
-
root.dataset['theme'] = brand ?? color;
|
|
39
|
-
root.classList.toggle('dark', mode === 'dark');
|
|
40
|
-
this.persistMode(this._modePreference());
|
|
41
|
-
if (brand) {
|
|
42
|
-
root.setAttribute('theme-brand', brand);
|
|
43
|
-
root.removeAttribute('theme-color');
|
|
44
|
-
root.removeAttribute('theme-style');
|
|
45
|
-
delete root.dataset['color'];
|
|
46
|
-
delete root.dataset['style'];
|
|
47
|
-
this.persistBrand(brand);
|
|
48
|
-
this.clearPersistedColor();
|
|
49
|
-
this.clearPersistedStyle();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
root.removeAttribute('theme-brand');
|
|
53
|
-
root.setAttribute('theme-color', color);
|
|
54
|
-
root.setAttribute('theme-style', style);
|
|
55
|
-
root.dataset['color'] = color;
|
|
56
|
-
root.dataset['style'] = style;
|
|
57
|
-
this.clearPersistedBrand();
|
|
58
|
-
this.persistColor(color);
|
|
59
|
-
this.persistStyle(style);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
setMode(mode) {
|
|
63
|
-
this._modePreference.set(mode);
|
|
64
|
-
}
|
|
65
|
-
setScheme(scheme) {
|
|
66
|
-
this._modePreference.set(scheme);
|
|
67
|
-
}
|
|
68
|
-
setBrand(brand) {
|
|
69
|
-
this._brand.set(brand);
|
|
70
|
-
this._color.set(this.config.defaultColor);
|
|
71
|
-
this._style.set(this.config.defaultStyle);
|
|
72
|
-
}
|
|
73
|
-
setColor(color) {
|
|
74
|
-
if (this._brand()) {
|
|
75
|
-
this._brand.set(null);
|
|
76
|
-
}
|
|
77
|
-
this._color.set(color);
|
|
78
|
-
}
|
|
79
|
-
setTheme(theme) {
|
|
80
|
-
if (isThemeColor(theme)) {
|
|
81
|
-
this.setColor(theme);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
setStyle(style) {
|
|
85
|
-
if (this._brand()) {
|
|
86
|
-
this._brand.set(null);
|
|
87
|
-
}
|
|
88
|
-
this._style.set(style);
|
|
89
|
-
}
|
|
90
|
-
setAll(config) {
|
|
91
|
-
if (config.scheme) {
|
|
92
|
-
this.setScheme(config.scheme);
|
|
93
|
-
}
|
|
94
|
-
if (config.mode) {
|
|
95
|
-
this.setMode(config.mode);
|
|
96
|
-
}
|
|
97
|
-
if (config.brand !== undefined) {
|
|
98
|
-
this.setBrand(config.brand);
|
|
99
|
-
}
|
|
100
|
-
if (config.brand === undefined || config.brand === null) {
|
|
101
|
-
if (config.color) {
|
|
102
|
-
this.setColor(config.color);
|
|
103
|
-
}
|
|
104
|
-
if (config.style) {
|
|
105
|
-
this.setStyle(config.style);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
toggleScheme() {
|
|
110
|
-
this.toggleMode();
|
|
111
|
-
}
|
|
112
|
-
toggleMode() {
|
|
113
|
-
this.setMode(this.mode() === 'dark' ? 'light' : 'dark');
|
|
114
|
-
}
|
|
115
|
-
reset() {
|
|
116
|
-
this._modePreference.set(this.config.defaultMode);
|
|
117
|
-
this._brand.set(this.config.defaultBrand);
|
|
118
|
-
this._color.set(this.config.defaultColor);
|
|
119
|
-
this._style.set(this.config.defaultStyle);
|
|
120
|
-
}
|
|
121
|
-
resolveConfig() {
|
|
122
|
-
const config = inject(MATERIAL_THEME_CONFIG, { optional: true }) ?? {};
|
|
123
|
-
const configuredMode = config.mode ?? config.defaultMode ?? config.defaultScheme;
|
|
124
|
-
const configuredBrand = config.brand ?? config['theme-brand'] ?? config.defaultBrand;
|
|
125
|
-
const configuredColor = config.color ?? config.defaultColor ?? config.defaultTheme;
|
|
126
|
-
const configuredStyle = config.style ?? config.defaultStyle;
|
|
127
|
-
const defaultMode = isColorScheme(configuredMode) ? configuredMode : DEFAULT_MATERIAL_THEME_CONFIG.defaultMode;
|
|
128
|
-
const defaultBrand = isThemeBrand(configuredBrand) ? configuredBrand : DEFAULT_MATERIAL_THEME_CONFIG.defaultBrand;
|
|
129
|
-
const defaultColor = isThemeColor(configuredColor) ? configuredColor : DEFAULT_MATERIAL_THEME_CONFIG.defaultColor;
|
|
130
|
-
const defaultStyle = isThemeStyle(configuredStyle) ? configuredStyle : DEFAULT_MATERIAL_THEME_CONFIG.defaultStyle;
|
|
131
|
-
return {
|
|
132
|
-
defaultMode,
|
|
133
|
-
defaultBrand,
|
|
134
|
-
defaultColor,
|
|
135
|
-
defaultStyle,
|
|
136
|
-
modeStorageKey: config.modeStorageKey ??
|
|
137
|
-
config.schemeStorageKey ??
|
|
138
|
-
config.storageKey ??
|
|
139
|
-
DEFAULT_MATERIAL_THEME_CONFIG.modeStorageKey,
|
|
140
|
-
brandStorageKey: config.brandStorageKey ?? DEFAULT_MATERIAL_THEME_CONFIG.brandStorageKey,
|
|
141
|
-
colorStorageKey: config.colorStorageKey ?? config.themeStorageKey ?? DEFAULT_MATERIAL_THEME_CONFIG.colorStorageKey,
|
|
142
|
-
styleStorageKey: config.styleStorageKey ?? DEFAULT_MATERIAL_THEME_CONFIG.styleStorageKey,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
resolveMode(mode) {
|
|
146
|
-
return mode === 'system' ? (this._systemPrefersDark() ? 'dark' : 'light') : mode;
|
|
147
|
-
}
|
|
148
|
-
prefersDark() {
|
|
149
|
-
const mql = this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)');
|
|
150
|
-
return !!mql?.matches;
|
|
151
|
-
}
|
|
152
|
-
watchSystemScheme() {
|
|
153
|
-
const mql = this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)');
|
|
154
|
-
if (!mql)
|
|
155
|
-
return;
|
|
156
|
-
const listener = (event) => {
|
|
157
|
-
this._systemPrefersDark.set(event.matches);
|
|
158
|
-
};
|
|
159
|
-
mql.addEventListener('change', listener);
|
|
160
|
-
this.destroyRef.onDestroy(() => mql.removeEventListener('change', listener));
|
|
161
|
-
}
|
|
162
|
-
readPersistedMode() {
|
|
163
|
-
const key = this.config.modeStorageKey;
|
|
164
|
-
if (!key)
|
|
165
|
-
return null;
|
|
166
|
-
try {
|
|
167
|
-
const value = this.document.defaultView?.localStorage?.getItem(key);
|
|
168
|
-
return isColorScheme(value) ? value : null;
|
|
169
|
-
}
|
|
170
|
-
catch {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
readPersistedBrand() {
|
|
175
|
-
const key = this.config.brandStorageKey;
|
|
176
|
-
if (!key)
|
|
177
|
-
return null;
|
|
178
|
-
try {
|
|
179
|
-
const value = this.document.defaultView?.localStorage?.getItem(key);
|
|
180
|
-
return isThemeBrand(value) ? value : null;
|
|
181
|
-
}
|
|
182
|
-
catch {
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
readPersistedColor() {
|
|
187
|
-
const key = this.config.colorStorageKey;
|
|
188
|
-
if (!key)
|
|
189
|
-
return null;
|
|
190
|
-
try {
|
|
191
|
-
const value = this.document.defaultView?.localStorage?.getItem(key);
|
|
192
|
-
return isThemeColor(value) ? value : null;
|
|
193
|
-
}
|
|
194
|
-
catch {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
readPersistedStyle() {
|
|
199
|
-
const key = this.config.styleStorageKey;
|
|
200
|
-
if (!key)
|
|
201
|
-
return null;
|
|
202
|
-
try {
|
|
203
|
-
const value = this.document.defaultView?.localStorage?.getItem(key);
|
|
204
|
-
return isThemeStyle(value) ? value : null;
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
return null;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
persistMode(mode) {
|
|
211
|
-
const key = this.config.modeStorageKey;
|
|
212
|
-
if (!key)
|
|
213
|
-
return;
|
|
214
|
-
try {
|
|
215
|
-
this.document.defaultView?.localStorage?.setItem(key, mode);
|
|
216
|
-
}
|
|
217
|
-
catch {
|
|
218
|
-
/* ignore */
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
persistBrand(brand) {
|
|
222
|
-
const key = this.config.brandStorageKey;
|
|
223
|
-
if (!key)
|
|
224
|
-
return;
|
|
225
|
-
try {
|
|
226
|
-
this.document.defaultView?.localStorage?.setItem(key, brand);
|
|
227
|
-
}
|
|
228
|
-
catch {
|
|
229
|
-
/* ignore */
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
persistColor(color) {
|
|
233
|
-
const key = this.config.colorStorageKey;
|
|
234
|
-
if (!key)
|
|
235
|
-
return;
|
|
236
|
-
try {
|
|
237
|
-
this.document.defaultView?.localStorage?.setItem(key, color);
|
|
238
|
-
}
|
|
239
|
-
catch {
|
|
240
|
-
/* ignore */
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
persistStyle(style) {
|
|
244
|
-
const key = this.config.styleStorageKey;
|
|
245
|
-
if (!key)
|
|
246
|
-
return;
|
|
247
|
-
try {
|
|
248
|
-
this.document.defaultView?.localStorage?.setItem(key, style);
|
|
249
|
-
}
|
|
250
|
-
catch {
|
|
251
|
-
/* ignore */
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
clearPersistedBrand() {
|
|
255
|
-
this.clearPersistedItem(this.config.brandStorageKey);
|
|
256
|
-
}
|
|
257
|
-
clearPersistedColor() {
|
|
258
|
-
this.clearPersistedItem(this.config.colorStorageKey);
|
|
259
|
-
}
|
|
260
|
-
clearPersistedStyle() {
|
|
261
|
-
this.clearPersistedItem(this.config.styleStorageKey);
|
|
262
|
-
}
|
|
263
|
-
clearPersistedItem(key) {
|
|
264
|
-
if (!key)
|
|
265
|
-
return;
|
|
266
|
-
try {
|
|
267
|
-
this.document.defaultView?.localStorage?.removeItem(key);
|
|
268
|
-
}
|
|
269
|
-
catch {
|
|
270
|
-
/* ignore */
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
274
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
275
|
-
}
|
|
276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ThemeService, decorators: [{
|
|
277
|
-
type: Injectable,
|
|
278
|
-
args: [{ providedIn: 'root' }]
|
|
279
|
-
}], ctorParameters: () => [] });
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Generated bundle index. Do not edit.
|
|
283
|
-
*/
|
|
284
|
-
|
|
285
|
-
export { ThemeService };
|
|
286
|
-
//# sourceMappingURL=ojiepermana-angular-theme-services.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ojiepermana-angular-theme-services.mjs","sources":["../../../projects/angular/theme/services/src/lib/theme.service.ts","../../../projects/angular/theme/services/ojiepermana-angular-theme-services.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Injectable, computed, effect, inject, signal } from '@angular/core';\nimport {\n DEFAULT_MATERIAL_THEME_CONFIG,\n MATERIAL_THEME_CONFIG,\n type ColorScheme,\n type ResolvedMaterialThemeConfig,\n type ThemeBrand,\n type ThemeColor,\n type ThemeConfig,\n type ThemeMode,\n type ThemeStyle,\n isColorScheme,\n isThemeBrand,\n isThemeColor,\n isThemeStyle,\n} from '@ojiepermana/angular/theme/token';\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly config = this.resolveConfig();\n private readonly initialBrand = this.readPersistedBrand() ?? this.config.defaultBrand;\n\n private readonly _modePreference = signal<ColorScheme>(this.readPersistedMode() ?? this.config.defaultMode);\n private readonly _brand = signal<ThemeBrand | null>(this.initialBrand);\n private readonly _color = signal<ThemeColor>(\n this.initialBrand ? this.config.defaultColor : (this.readPersistedColor() ?? this.config.defaultColor),\n );\n private readonly _style = signal<ThemeStyle>(\n this.initialBrand ? this.config.defaultStyle : (this.readPersistedStyle() ?? this.config.defaultStyle),\n );\n private readonly _systemPrefersDark = signal<boolean>(this.prefersDark());\n\n readonly scheme = this._modePreference.asReadonly();\n readonly brand = this._brand.asReadonly();\n readonly color = this._color.asReadonly();\n readonly theme = this._color.asReadonly();\n readonly style = this._style.asReadonly();\n readonly mode = computed<ThemeMode>(() => this.resolveMode(this._modePreference()));\n readonly snapshot = computed<ThemeConfig>(() => ({\n mode: this.mode(),\n brand: this._brand(),\n color: this._color(),\n style: this._style(),\n }));\n\n readonly isDark = computed(() => this.mode() === 'dark');\n\n constructor() {\n this.watchSystemScheme();\n\n effect(() => {\n const root = this.document.documentElement;\n const mode = this.mode();\n const brand = this._brand();\n const color = this._color();\n const style = this._style();\n\n root.dataset['mode'] = mode;\n root.dataset['theme'] = brand ?? color;\n root.classList.toggle('dark', mode === 'dark');\n\n this.persistMode(this._modePreference());\n\n if (brand) {\n root.setAttribute('theme-brand', brand);\n root.removeAttribute('theme-color');\n root.removeAttribute('theme-style');\n delete root.dataset['color'];\n delete root.dataset['style'];\n\n this.persistBrand(brand);\n this.clearPersistedColor();\n this.clearPersistedStyle();\n return;\n }\n\n root.removeAttribute('theme-brand');\n root.setAttribute('theme-color', color);\n root.setAttribute('theme-style', style);\n root.dataset['color'] = color;\n root.dataset['style'] = style;\n\n this.clearPersistedBrand();\n this.persistColor(color);\n this.persistStyle(style);\n });\n }\n\n setMode(mode: ThemeMode): void {\n this._modePreference.set(mode);\n }\n\n setScheme(scheme: ColorScheme): void {\n this._modePreference.set(scheme);\n }\n\n setBrand(brand: ThemeBrand | null): void {\n this._brand.set(brand);\n this._color.set(this.config.defaultColor);\n this._style.set(this.config.defaultStyle);\n }\n\n setColor(color: ThemeColor): void {\n if (this._brand()) {\n this._brand.set(null);\n }\n this._color.set(color);\n }\n\n setTheme(theme: ThemeColor | string): void {\n if (isThemeColor(theme)) {\n this.setColor(theme);\n }\n }\n\n setStyle(style: ThemeStyle): void {\n if (this._brand()) {\n this._brand.set(null);\n }\n this._style.set(style);\n }\n\n setAll(config: Partial<ThemeConfig> & { readonly scheme?: ColorScheme }): void {\n if (config.scheme) {\n this.setScheme(config.scheme);\n }\n if (config.mode) {\n this.setMode(config.mode);\n }\n if (config.brand !== undefined) {\n this.setBrand(config.brand);\n }\n if (config.brand === undefined || config.brand === null) {\n if (config.color) {\n this.setColor(config.color);\n }\n if (config.style) {\n this.setStyle(config.style);\n }\n }\n }\n\n toggleScheme(): void {\n this.toggleMode();\n }\n\n toggleMode(): void {\n this.setMode(this.mode() === 'dark' ? 'light' : 'dark');\n }\n\n reset(): void {\n this._modePreference.set(this.config.defaultMode);\n this._brand.set(this.config.defaultBrand);\n this._color.set(this.config.defaultColor);\n this._style.set(this.config.defaultStyle);\n }\n\n private resolveConfig(): ResolvedMaterialThemeConfig {\n const config = inject(MATERIAL_THEME_CONFIG, { optional: true }) ?? {};\n const configuredMode = config.mode ?? config.defaultMode ?? config.defaultScheme;\n const configuredBrand = config.brand ?? config['theme-brand'] ?? config.defaultBrand;\n const configuredColor = config.color ?? config.defaultColor ?? config.defaultTheme;\n const configuredStyle = config.style ?? config.defaultStyle;\n\n const defaultMode = isColorScheme(configuredMode) ? configuredMode : DEFAULT_MATERIAL_THEME_CONFIG.defaultMode;\n const defaultBrand = isThemeBrand(configuredBrand) ? configuredBrand : DEFAULT_MATERIAL_THEME_CONFIG.defaultBrand;\n const defaultColor = isThemeColor(configuredColor) ? configuredColor : DEFAULT_MATERIAL_THEME_CONFIG.defaultColor;\n const defaultStyle = isThemeStyle(configuredStyle) ? configuredStyle : DEFAULT_MATERIAL_THEME_CONFIG.defaultStyle;\n\n return {\n defaultMode,\n defaultBrand,\n defaultColor,\n defaultStyle,\n modeStorageKey:\n config.modeStorageKey ??\n config.schemeStorageKey ??\n config.storageKey ??\n DEFAULT_MATERIAL_THEME_CONFIG.modeStorageKey,\n brandStorageKey: config.brandStorageKey ?? DEFAULT_MATERIAL_THEME_CONFIG.brandStorageKey,\n colorStorageKey:\n config.colorStorageKey ?? config.themeStorageKey ?? DEFAULT_MATERIAL_THEME_CONFIG.colorStorageKey,\n styleStorageKey: config.styleStorageKey ?? DEFAULT_MATERIAL_THEME_CONFIG.styleStorageKey,\n };\n }\n\n private resolveMode(mode: ColorScheme): ThemeMode {\n return mode === 'system' ? (this._systemPrefersDark() ? 'dark' : 'light') : mode;\n }\n\n private prefersDark(): boolean {\n const mql = this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)');\n return !!mql?.matches;\n }\n\n private watchSystemScheme(): void {\n const mql = this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)');\n if (!mql) return;\n\n const listener = (event: MediaQueryListEvent): void => {\n this._systemPrefersDark.set(event.matches);\n };\n mql.addEventListener('change', listener);\n this.destroyRef.onDestroy(() => mql.removeEventListener('change', listener));\n }\n\n private readPersistedMode(): ColorScheme | null {\n const key = this.config.modeStorageKey;\n if (!key) return null;\n try {\n const value = this.document.defaultView?.localStorage?.getItem(key);\n return isColorScheme(value) ? value : null;\n } catch {\n return null;\n }\n }\n\n private readPersistedBrand(): ThemeBrand | null {\n const key = this.config.brandStorageKey;\n if (!key) return null;\n try {\n const value = this.document.defaultView?.localStorage?.getItem(key);\n return isThemeBrand(value) ? value : null;\n } catch {\n return null;\n }\n }\n\n private readPersistedColor(): ThemeColor | null {\n const key = this.config.colorStorageKey;\n if (!key) return null;\n try {\n const value = this.document.defaultView?.localStorage?.getItem(key);\n return isThemeColor(value) ? value : null;\n } catch {\n return null;\n }\n }\n\n private readPersistedStyle(): ThemeStyle | null {\n const key = this.config.styleStorageKey;\n if (!key) return null;\n try {\n const value = this.document.defaultView?.localStorage?.getItem(key);\n return isThemeStyle(value) ? value : null;\n } catch {\n return null;\n }\n }\n\n private persistMode(mode: ColorScheme): void {\n const key = this.config.modeStorageKey;\n if (!key) return;\n try {\n this.document.defaultView?.localStorage?.setItem(key, mode);\n } catch {\n /* ignore */\n }\n }\n\n private persistBrand(brand: ThemeBrand): void {\n const key = this.config.brandStorageKey;\n if (!key) return;\n try {\n this.document.defaultView?.localStorage?.setItem(key, brand);\n } catch {\n /* ignore */\n }\n }\n\n private persistColor(color: ThemeColor): void {\n const key = this.config.colorStorageKey;\n if (!key) return;\n try {\n this.document.defaultView?.localStorage?.setItem(key, color);\n } catch {\n /* ignore */\n }\n }\n\n private persistStyle(style: ThemeStyle): void {\n const key = this.config.styleStorageKey;\n if (!key) return;\n try {\n this.document.defaultView?.localStorage?.setItem(key, style);\n } catch {\n /* ignore */\n }\n }\n\n private clearPersistedBrand(): void {\n this.clearPersistedItem(this.config.brandStorageKey);\n }\n\n private clearPersistedColor(): void {\n this.clearPersistedItem(this.config.colorStorageKey);\n }\n\n private clearPersistedStyle(): void {\n this.clearPersistedItem(this.config.styleStorageKey);\n }\n\n private clearPersistedItem(key: string | null): void {\n if (!key) return;\n try {\n this.document.defaultView?.localStorage?.removeItem(key);\n } catch {\n /* ignore */\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAmBa,YAAY,CAAA;AACN,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE;IAC7B,YAAY,GAAG,IAAI,CAAC,kBAA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9D;AAAE,QAAA,MAAM;;QAER;IACF;IAEQ,mBAAmB,GAAA;QACzB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACtD;IAEQ,mBAAmB,GAAA;QACzB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACtD;IAEQ,mBAAmB,GAAA;QACzB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACtD;AAEQ,IAAA,kBAAkB,CAAC,GAAkB,EAAA;AAC3C,QAAA,IAAI,CAAC,GAAG;YAAE;AACV,QAAA,IAAI;YACF,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC;QAC1D;AAAE,QAAA,MAAM;;QAER;IACF;wGArSW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cADC,MAAM,EAAA,CAAA;;4FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;AClBlC;;AAEG;;;;"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
const MODES = ['light', 'dark'];
|
|
4
|
-
const COLOR_SCHEMES = ['light', 'dark', 'system'];
|
|
5
|
-
const COLORS = [
|
|
6
|
-
'base',
|
|
7
|
-
'red',
|
|
8
|
-
'orange',
|
|
9
|
-
'amber',
|
|
10
|
-
'yellow',
|
|
11
|
-
'lime',
|
|
12
|
-
'green',
|
|
13
|
-
'emerald',
|
|
14
|
-
'teal',
|
|
15
|
-
'cyan',
|
|
16
|
-
'sky',
|
|
17
|
-
'blue',
|
|
18
|
-
'indigo',
|
|
19
|
-
'violet',
|
|
20
|
-
'purple',
|
|
21
|
-
'fuchsia',
|
|
22
|
-
'pink',
|
|
23
|
-
'rose',
|
|
24
|
-
];
|
|
25
|
-
const STYLES = ['default', 'sharp', 'brutal', 'soft'];
|
|
26
|
-
const BRANDS = ['etos'];
|
|
27
|
-
const MATERIAL_THEME_CONFIG = new InjectionToken('MATERIAL_THEME_CONFIG');
|
|
28
|
-
const DEFAULT_MATERIAL_THEME_CONFIG = {
|
|
29
|
-
defaultMode: 'light',
|
|
30
|
-
defaultBrand: null,
|
|
31
|
-
defaultColor: 'base',
|
|
32
|
-
defaultStyle: 'default',
|
|
33
|
-
modeStorageKey: 'theme-mode',
|
|
34
|
-
brandStorageKey: 'theme-brand',
|
|
35
|
-
colorStorageKey: 'theme-color',
|
|
36
|
-
styleStorageKey: 'theme-style',
|
|
37
|
-
};
|
|
38
|
-
function isColorScheme(value) {
|
|
39
|
-
return COLOR_SCHEMES.some((scheme) => scheme === value);
|
|
40
|
-
}
|
|
41
|
-
function isThemeColor(value) {
|
|
42
|
-
return COLORS.some((color) => color === value);
|
|
43
|
-
}
|
|
44
|
-
function isThemeStyle(value) {
|
|
45
|
-
return STYLES.some((style) => style === value);
|
|
46
|
-
}
|
|
47
|
-
function isThemeBrand(value) {
|
|
48
|
-
return BRANDS.some((brand) => brand === value);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Generated bundle index. Do not edit.
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
export { BRANDS, COLORS, COLOR_SCHEMES, DEFAULT_MATERIAL_THEME_CONFIG, MATERIAL_THEME_CONFIG, MODES, STYLES, isColorScheme, isThemeBrand, isThemeColor, isThemeStyle };
|
|
56
|
-
//# sourceMappingURL=ojiepermana-angular-theme-token.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ojiepermana-angular-theme-token.mjs","sources":["../../../projects/angular/theme/token/src/lib/theme.tokens.ts","../../../projects/angular/theme/token/ojiepermana-angular-theme-token.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const MODES = ['light', 'dark'] as const;\n\nexport type ThemeMode = (typeof MODES)[number];\n\nexport const COLOR_SCHEMES = ['light', 'dark', 'system'] as const;\n\nexport type ColorScheme = (typeof COLOR_SCHEMES)[number];\n\nexport const COLORS = [\n 'base',\n 'red',\n 'orange',\n 'amber',\n 'yellow',\n 'lime',\n 'green',\n 'emerald',\n 'teal',\n 'cyan',\n 'sky',\n 'blue',\n 'indigo',\n 'violet',\n 'purple',\n 'fuchsia',\n 'pink',\n 'rose',\n] as const;\n\nexport type ThemeColor = (typeof COLORS)[number];\n\nexport const STYLES = ['default', 'sharp', 'brutal', 'soft'] as const;\n\nexport type ThemeStyle = (typeof STYLES)[number];\n\nexport const BRANDS = ['etos'] as const;\n\nexport type ThemeBrand = (typeof BRANDS)[number];\n\nexport interface ThemeConfig {\n readonly mode: ThemeMode;\n readonly brand: ThemeBrand | null;\n readonly color: ThemeColor;\n readonly style: ThemeStyle;\n}\n\nexport interface MaterialThemeConfig {\n readonly mode?: ColorScheme;\n readonly brand?: ThemeBrand | null;\n readonly 'theme-brand'?: ThemeBrand | null;\n readonly color?: ThemeColor;\n readonly style?: ThemeStyle;\n readonly defaultMode?: ColorScheme;\n readonly defaultBrand?: ThemeBrand | null;\n readonly defaultColor?: ThemeColor;\n readonly defaultStyle?: ThemeStyle;\n readonly defaultScheme?: ColorScheme;\n readonly defaultTheme?: ThemeColor | string;\n readonly storageKey?: string | null;\n readonly schemeStorageKey?: string | null;\n readonly themeStorageKey?: string | null;\n readonly modeStorageKey?: string | null;\n readonly brandStorageKey?: string | null;\n readonly colorStorageKey?: string | null;\n readonly styleStorageKey?: string | null;\n}\n\nexport interface ResolvedMaterialThemeConfig {\n readonly defaultMode: ColorScheme;\n readonly defaultBrand: ThemeBrand | null;\n readonly defaultColor: ThemeColor;\n readonly defaultStyle: ThemeStyle;\n readonly modeStorageKey: string | null;\n readonly brandStorageKey: string | null;\n readonly colorStorageKey: string | null;\n readonly styleStorageKey: string | null;\n}\n\nexport const MATERIAL_THEME_CONFIG = new InjectionToken<MaterialThemeConfig>('MATERIAL_THEME_CONFIG');\n\nexport const DEFAULT_MATERIAL_THEME_CONFIG: ResolvedMaterialThemeConfig = {\n defaultMode: 'light',\n defaultBrand: null,\n defaultColor: 'base',\n defaultStyle: 'default',\n modeStorageKey: 'theme-mode',\n brandStorageKey: 'theme-brand',\n colorStorageKey: 'theme-color',\n styleStorageKey: 'theme-style',\n};\n\nexport function isColorScheme(value: string | null | undefined): value is ColorScheme {\n return COLOR_SCHEMES.some((scheme) => scheme === value);\n}\n\nexport function isThemeColor(value: string | null | undefined): value is ThemeColor {\n return COLORS.some((color) => color === value);\n}\n\nexport function isThemeStyle(value: string | null | undefined): value is ThemeStyle {\n return STYLES.some((style) => style === value);\n}\n\nexport function isThemeBrand(value: string | null | undefined): value is ThemeBrand {\n return BRANDS.some((brand) => brand === value);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAEa,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM;AAI9B,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ;AAIhD,MAAM,MAAM,GAAG;IACpB,MAAM;IACN,KAAK;IACL,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,MAAM;;AAKD,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;AAIpD,MAAM,MAAM,GAAG,CAAC,MAAM;MA2ChB,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB;AAE7F,MAAM,6BAA6B,GAAgC;AACxE,IAAA,WAAW,EAAE,OAAO;AACpB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,YAAY,EAAE,MAAM;AACpB,IAAA,YAAY,EAAE,SAAS;AACvB,IAAA,cAAc,EAAE,YAAY;AAC5B,IAAA,eAAe,EAAE,aAAa;AAC9B,IAAA,eAAe,EAAE,aAAa;AAC9B,IAAA,eAAe,EAAE,aAAa;;AAG1B,SAAU,aAAa,CAAC,KAAgC,EAAA;AAC5D,IAAA,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,KAAK,KAAK,CAAC;AACzD;AAEM,SAAU,YAAY,CAAC,KAAgC,EAAA;AAC3D,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,CAAC;AAChD;AAEM,SAAU,YAAY,CAAC,KAAgC,EAAA;AAC3D,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,CAAC;AAChD;AAEM,SAAU,YAAY,CAAC,KAAgC,EAAA;AAC3D,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,CAAC;AAChD;;AC3GA;;AAEG;;;;"}
|
package/generator/api/README.md
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
# SDK Generator
|
|
2
|
-
|
|
3
|
-
OpenAPI → Angular SDK generator shipped as the secondary entrypoint
|
|
4
|
-
`@ojiepermana/angular/generator/api`.
|
|
5
|
-
|
|
6
|
-
It generates a **lightweight Angular SDK** from any OpenAPI 3.x spec (including
|
|
7
|
-
3.2.0): typed `HttpClient` services, tree-shakeable fn modules, optional
|
|
8
|
-
metadata (permissions / validators), and a navigation tree.
|
|
9
|
-
|
|
10
|
-
## Local development in this repo
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
# 1. Build the schematic runtime
|
|
14
|
-
bun run gen:sdk:build
|
|
15
|
-
|
|
16
|
-
# 2. Scaffold a workspace config
|
|
17
|
-
bun run gen:sdk:init
|
|
18
|
-
|
|
19
|
-
# 3. Edit sdk.config.json, then generate
|
|
20
|
-
bun run gen:sdk
|
|
21
|
-
|
|
22
|
-
# 4. Run the split-by-domain regression checks
|
|
23
|
-
bun run test:gen:sdk
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Consumer usage after publish
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# inside an Angular workspace that installed @ojiepermana/angular
|
|
30
|
-
ng generate @ojiepermana/angular:sdk-init
|
|
31
|
-
# edit config/sdk.config.json
|
|
32
|
-
ng generate @ojiepermana/angular:sdk
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
The main consumer feature is generating an SDK from
|
|
36
|
-
`config/sdk.config.json`. The consumer flow is: initialize the config once,
|
|
37
|
-
edit it, then run `sdk` whenever the OpenAPI source changes.
|
|
38
|
-
|
|
39
|
-
If a consumer wants short script aliases in `package.json`, they can add this
|
|
40
|
-
script block to their workspace:
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"scripts": {
|
|
45
|
-
"gen:sdk:init": "ng generate @ojiepermana/angular:sdk-init",
|
|
46
|
-
"gen:sdk": "ng generate @ojiepermana/angular:sdk"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Consumers do not need a `gen:sdk:build` step. That build command only exists
|
|
52
|
-
for developing this repository, where the schematic source under
|
|
53
|
-
`projects/angular/generator/api` must be compiled before local execution.
|
|
54
|
-
|
|
55
|
-
## Schematics
|
|
56
|
-
|
|
57
|
-
The entrypoint exposes two schematics, registered in the parent collection at [`projects/angular/collection.json`](../../collection.json):
|
|
58
|
-
|
|
59
|
-
| Schematic | Script | Purpose |
|
|
60
|
-
| ---------- | ---------------------- | ------------------------------------------------ |
|
|
61
|
-
| `sdk-init` | `bun run gen:sdk:init` | Create `config/sdk.config.json` from the example |
|
|
62
|
-
| `sdk` | `bun run gen:sdk` | Run the generator using `config/sdk.config.json` |
|
|
63
|
-
|
|
64
|
-
Both can be invoked directly with `ng generate` too:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
bunx ng generate ./projects/angular/collection.json:sdk-init [--force] [--path=custom/sdk.config.json]
|
|
68
|
-
bunx ng generate ./projects/angular/collection.json:sdk [--dry-run] [--config=sdk.config.json] [--target=1]
|
|
69
|
-
|
|
70
|
-
# after publish / inside a consuming workspace:
|
|
71
|
-
ng generate @ojiepermana/angular:sdk-init [--force] [--path=custom/sdk.config.json]
|
|
72
|
-
ng generate @ojiepermana/angular:sdk [--dry-run] [--config=sdk.config.json] [--target=1]
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### `init` options
|
|
76
|
-
|
|
77
|
-
| Option | Type | Default | Description |
|
|
78
|
-
| --------- | ------- | ------------------------ | --------------------------------------------- |
|
|
79
|
-
| `--path` | string | `config/sdk.config.json` | Destination path, relative to workspace root. |
|
|
80
|
-
| `--force` | boolean | `false` | Overwrite the file if it already exists. |
|
|
81
|
-
|
|
82
|
-
### `sdk` options
|
|
83
|
-
|
|
84
|
-
| Option | Type | Default | Description |
|
|
85
|
-
| ----------- | ------ | ------------------------ | ------------------------------------------------------------------ |
|
|
86
|
-
| `--config` | string | `config/sdk.config.json` | Path to the config file, relative to workspace root. |
|
|
87
|
-
| `--target` | string | _(all)_ | Only generate one target. Accepts a 1-based index or `clientName`. |
|
|
88
|
-
| `--dry-run` | flag | — | Preview file operations without writing anything. |
|
|
89
|
-
|
|
90
|
-
## Config shape
|
|
91
|
-
|
|
92
|
-
```jsonc
|
|
93
|
-
{
|
|
94
|
-
"$schema": "./node_modules/@ojiepermana/angular/generator/api/schematics/sdk/schema.json",
|
|
95
|
-
"targets": [
|
|
96
|
-
{
|
|
97
|
-
"input": "./openapi.yaml",
|
|
98
|
-
"output": "./sdk",
|
|
99
|
-
"mode": "library", // "standalone" | "library" | "secondary-entrypoint"
|
|
100
|
-
"clientName": "Api",
|
|
101
|
-
"packageName": "@my-scope/sdk", // used in "library" mode
|
|
102
|
-
"packageVersion": "0.0.1", // used in "library" mode
|
|
103
|
-
"rootUrl": "", // optional; empty string means same-origin requests
|
|
104
|
-
"splitByDomain": true, // optional; defaults true for "library", false otherwise
|
|
105
|
-
"splitDepth": "service", // "service" (default) | "tag"
|
|
106
|
-
"features": {
|
|
107
|
-
"models": true,
|
|
108
|
-
"operations": true,
|
|
109
|
-
"services": true,
|
|
110
|
-
"client": true,
|
|
111
|
-
"metadata": true,
|
|
112
|
-
"navigation": true,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Multiple targets are supported — one config run can emit several SDKs.
|
|
120
|
-
|
|
121
|
-
If `rootUrl` is omitted or left empty, the generated SDK uses same-origin
|
|
122
|
-
requests by default. Consumer apps can override it at runtime with
|
|
123
|
-
`provideApiConfiguration(...)`.
|
|
124
|
-
|
|
125
|
-
### Runtime base URL
|
|
126
|
-
|
|
127
|
-
The generated SDK does not read `sdk.config.json` at runtime. The value of
|
|
128
|
-
`targets[].rootUrl` is only used during code generation to seed the default
|
|
129
|
-
`ApiConfiguration.rootUrl` value.
|
|
130
|
-
|
|
131
|
-
- `rootUrl: ""` or omitted: requests use the current origin, for example
|
|
132
|
-
`/api/users` on the same host as the Angular app.
|
|
133
|
-
- `rootUrl: "https://api.example.com"`: the generated SDK defaults to that
|
|
134
|
-
absolute backend URL.
|
|
135
|
-
- Runtime override: consumer apps can replace the default by providing a new
|
|
136
|
-
value during bootstrap.
|
|
137
|
-
|
|
138
|
-
Example runtime override in a consumer app:
|
|
139
|
-
|
|
140
|
-
```ts
|
|
141
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
|
142
|
-
import { provideHttpClient } from '@angular/common/http';
|
|
143
|
-
|
|
144
|
-
import { AppComponent } from './app/app.component';
|
|
145
|
-
import { provideApiConfiguration } from '@my-scope/sdk';
|
|
146
|
-
|
|
147
|
-
bootstrapApplication(AppComponent, {
|
|
148
|
-
providers: [provideHttpClient(), provideApiConfiguration('https://api.example.com')],
|
|
149
|
-
});
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
For standalone generated output inside the same workspace, import
|
|
153
|
-
`provideApiConfiguration` from the generated SDK barrel instead of an npm
|
|
154
|
-
package path.
|
|
155
|
-
|
|
156
|
-
## Per-domain layout
|
|
157
|
-
|
|
158
|
-
By default, standalone and secondary-entrypoint targets emit a flat layout
|
|
159
|
-
(`models/`, `fn/`, `services/`, … all at the output root). `mode: "library"`
|
|
160
|
-
defaults to `splitByDomain: true` so the generated package is split into
|
|
161
|
-
secondary entrypoints immediately. You can still set `splitByDomain: false` if
|
|
162
|
-
you need the older flat library shape. Cross-domain models and client primitives
|
|
163
|
-
land in `shared/`.
|
|
164
|
-
|
|
165
|
-
```jsonc
|
|
166
|
-
{
|
|
167
|
-
"splitByDomain": true,
|
|
168
|
-
"splitDepth": "service", // or "tag"
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
`splitDepth` controls granularity. It is only read when `splitByDomain` is
|
|
173
|
-
`true`.
|
|
174
|
-
|
|
175
|
-
| `splitDepth` | Folder strategy | Example (spec with tags `Access/Role`, `Access/Permission`, `Storage/GCS`, `Storage/S3`, `Auth`) |
|
|
176
|
-
| ------------ | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
177
|
-
| `service` | One folder per **root** tag (each tag's `parent` chain collapses to its root). One folder per backend service. | `access/` (holds Role + Permission + Role-Permission + …), `storage/` (holds GCS + S3), `auth/`, `shared/`, root `public-api.ts` |
|
|
178
|
-
| `tag` | One folder per **leaf** tag, nested under the parent chain. Keeps fine-grained separation while staying grouped. | `access/role/`, `access/permission/`, `access/role-permission/`, `storage/gcs/`, `storage/s3/`, `auth/`, `shared/`, root `public-api.ts` |
|
|
179
|
-
|
|
180
|
-
Every domain folder contains `services/`, `fn/`, `models/`, `permissions/`,
|
|
181
|
-
and its own `public-api.ts`. The root still owns the aggregate metadata barrel:
|
|
182
|
-
`metadata.ts`, `openapi-helpers.ts`, and `permissions/index.ts` stay at the SDK
|
|
183
|
-
root so `shared/` never depends on sibling domains. In standalone and
|
|
184
|
-
secondary-entrypoint modes, the root `public-api.ts` aggregates `shared`, root
|
|
185
|
-
metadata helpers, and every domain for convenience. In library mode, domain
|
|
186
|
-
exports stay in their secondary entrypoints so consumers deep import the domain
|
|
187
|
-
they need.
|
|
188
|
-
|
|
189
|
-
Model ownership rule (per-domain mode):
|
|
190
|
-
|
|
191
|
-
- A model used by exactly one domain → emitted inside that domain's `models/`.
|
|
192
|
-
- A model shared across two or more domains → emitted inside `shared/models/`.
|
|
193
|
-
- Client primitives (`ApiConfiguration`, `BaseService`, `RequestBuilder`,
|
|
194
|
-
`StrictHttpResponse`, `Api`), shared metadata types, validators, and
|
|
195
|
-
navigation always live under `shared/`.
|
|
196
|
-
- Aggregate metadata helpers (`metadata.ts`, `openapi-helpers.ts`) and the
|
|
197
|
-
top-level `permissions/index.ts` stay at the SDK root.
|
|
198
|
-
|
|
199
|
-
Example consumption when using `mode: 'library'`:
|
|
200
|
-
|
|
201
|
-
```ts
|
|
202
|
-
import { RoleService } from '@my-scope/sdk/access';
|
|
203
|
-
import { ApprovalInstanceService, SubmitRequest } from '@my-scope/sdk/approval';
|
|
204
|
-
import { GCSService } from '@my-scope/sdk/storage'; // splitDepth: 'service'
|
|
205
|
-
import { GCSService } from '@my-scope/sdk/storage/gcs'; // splitDepth: 'tag'
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## Output modes
|
|
209
|
-
|
|
210
|
-
| Mode | What it emits | Use when… |
|
|
211
|
-
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
|
|
212
|
-
| `standalone` | A plain folder (no `ng-package.json`). | You consume the SDK via path alias / `tsconfig.paths` inside the same app. |
|
|
213
|
-
| `library` | Split-by-domain output plus package metadata and nested `ng-package.json` manifests for secondary entrypoints. | You want a buildable/publishable Angular package with efficient deep imports. |
|
|
214
|
-
| `secondary-entrypoint` | Standalone output **plus** a minimal `ng-package.json` pointing at `public-api.ts`, plus nested `ng-package.json` files for split-by-domain secondary entrypoints. | You drop the folder inside an existing library so ng-packagr picks it up as a subpath. |
|
|
215
|
-
|
|
216
|
-
In `library` mode, output also includes `tsconfig.lib.json` and `tsconfig.lib.prod.json`.
|
|
217
|
-
`ng-package.dest` defaults to `dist/<output-folder-name>`.
|
|
218
|
-
|
|
219
|
-
## Feature flags
|
|
220
|
-
|
|
221
|
-
All default to `true`. Turn off anything you don't need to shrink the output.
|
|
222
|
-
|
|
223
|
-
| Flag | Emits |
|
|
224
|
-
| ------------ | ------------------------------------------------------------------------------------------ |
|
|
225
|
-
| `models` | `models/*.ts` — flat interfaces, enum aliases, array aliases. |
|
|
226
|
-
| `operations` | `fn/<tag>/<operation-id>.ts` — tree-shakeable request functions with `.PATH`. |
|
|
227
|
-
| `services` | `services/<tag>.service.ts` — `@Injectable({providedIn:'root'})` wrappers. |
|
|
228
|
-
| `client` | `api-configuration.ts`, `base-service.ts`, `request-builder.ts`, `api.ts`. |
|
|
229
|
-
| `metadata` | `permissions/*`, `validators/*`, `metadata.ts`, `openapi-helpers.ts`. |
|
|
230
|
-
| `navigation` | `api.navigation.ts` — `NavigationItem[]` ready for `NavigationService.registerItems(...)`. |
|
|
231
|
-
|
|
232
|
-
## Pipeline
|
|
233
|
-
|
|
234
|
-
```text
|
|
235
|
-
sdk.config.json → loader → spec (YAML/JSON) → IR → emitters → writer → Angular CLI Tree
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
- `src/config/` — config schema + loader (supports JSONC and `.js`/`.cjs`).
|
|
239
|
-
- `src/parser/` — OpenAPI → intermediate representation.
|
|
240
|
-
- `src/emit/` — one module per output concern (models, operations, services, client, metadata, navigation, public-api).
|
|
241
|
-
- `src/layout/` — post-emit layout transforms (e.g. `splitByDomain` reorganisation).
|
|
242
|
-
- `src/writer/` — mode wrappers (standalone / library / secondary entrypoint).
|
|
243
|
-
- `public-api.ts` — published TypeScript entrypoint for `@ojiepermana/angular/generator/api`.
|
|
244
|
-
- `schematics/init/` — creates `sdk.config.json` from the example template.
|
|
245
|
-
- `schematics/sdk/` — orchestrates engine and writes virtual files into the CLI `Tree`.
|
|
246
|
-
|
|
247
|
-
## Generated runtime conventions
|
|
248
|
-
|
|
249
|
-
- Tree-shakeable: `import { listUsers } from './sdk/fn/user/list-users'` pulls only one HTTP call.
|
|
250
|
-
- Services: every operation gets `op()` (body `Observable<T>`) and `op$Response()` (full `StrictHttpResponse<T>`).
|
|
251
|
-
- `RequestBuilder` is intentionally minimal — no `style`/`explode` logic — to keep the output lightweight.
|
|
252
|
-
- All files carry a `DO NOT EDIT` banner and `/* eslint-disable */`.
|