@depup/angular__material 21.2.2-depup.19
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 +31 -0
- package/_index.scss +145 -0
- package/autocomplete/_autocomplete-theme.scss +76 -0
- package/autocomplete/_m2-autocomplete.scss +19 -0
- package/autocomplete/_m3-autocomplete.scss +26 -0
- package/badge/_badge-theme.scss +106 -0
- package/badge/_m2-badge.scss +73 -0
- package/badge/_m3-badge.scss +52 -0
- package/bottom-sheet/_bottom-sheet-theme.scss +76 -0
- package/bottom-sheet/_m2-bottom-sheet.scss +24 -0
- package/bottom-sheet/_m3-bottom-sheet.scss +25 -0
- package/button/_button-theme.scss +113 -0
- package/button/_fab-theme.scss +111 -0
- package/button/_icon-button-theme.scss +136 -0
- package/button/_m2-button.scss +194 -0
- package/button/_m2-fab.scss +101 -0
- package/button/_m2-icon-button.scss +59 -0
- package/button/_m3-button.scss +170 -0
- package/button/_m3-fab.scss +92 -0
- package/button/_m3-icon-button.scss +54 -0
- package/button-toggle/_button-toggle-theme.scss +93 -0
- package/button-toggle/_m2-button-toggle.scss +68 -0
- package/button-toggle/_m3-button-toggle.scss +72 -0
- package/card/_card-theme.scss +76 -0
- package/card/_m2-card.scss +39 -0
- package/card/_m3-card.scss +44 -0
- package/changes.json +10 -0
- package/checkbox/_checkbox-theme.scss +105 -0
- package/checkbox/_m2-checkbox.scss +78 -0
- package/checkbox/_m3-checkbox.scss +68 -0
- package/chips/_chips-theme.scss +115 -0
- package/chips/_m2-chip.scss +85 -0
- package/chips/_m3-chip.scss +81 -0
- package/core/_core-theme.scss +125 -0
- package/core/_core.scss +50 -0
- package/core/_m2-app.scss +24 -0
- package/core/_m3-app.scss +44 -0
- package/core/color/_all-color.scss +17 -0
- package/core/density/private/_all-density.scss +78 -0
- package/core/focus-indicators/_private.scss +126 -0
- package/core/m2/_index.scss +52 -0
- package/core/m2/_palette.scss +748 -0
- package/core/m2/_theming.scss +340 -0
- package/core/m2/_typography-utils.scss +81 -0
- package/core/m2/_typography.scss +388 -0
- package/core/option/_m2-optgroup.scss +21 -0
- package/core/option/_m2-option.scss +38 -0
- package/core/option/_m3-optgroup.scss +25 -0
- package/core/option/_m3-option.scss +37 -0
- package/core/option/_optgroup-theme.scss +76 -0
- package/core/option/_option-theme.scss +103 -0
- package/core/ripple/_m2-ripple.scss +17 -0
- package/core/ripple/_m3-ripple.scss +17 -0
- package/core/ripple/_ripple-theme.scss +75 -0
- package/core/ripple/_ripple.scss +56 -0
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +32 -0
- package/core/selection/pseudo-checkbox/_m3-pseudo-checkbox.scss +34 -0
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-common.scss +86 -0
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +110 -0
- package/core/style/_checkbox-common.scss +11 -0
- package/core/style/_elevation.scss +208 -0
- package/core/style/_layout-common.scss +8 -0
- package/core/style/_private.scss +27 -0
- package/core/style/_sass-utils.scss +57 -0
- package/core/style/_validation.scss +52 -0
- package/core/style/_variables.scss +44 -0
- package/core/style/_vendor-prefixes.scss +56 -0
- package/core/theming/_all-theme.scss +168 -0
- package/core/theming/_color-api-backwards-compatibility.scss +159 -0
- package/core/theming/_config-validation.scss +174 -0
- package/core/theming/_definition.scss +141 -0
- package/core/theming/_inspection.scss +289 -0
- package/core/theming/_m2-inspection.scss +243 -0
- package/core/theming/_palettes.scss +1036 -0
- package/core/theming/_theming.scss +193 -0
- package/core/theming/_validation.scss +5 -0
- package/core/tokens/_classes.scss +398 -0
- package/core/tokens/_m2-utils.scss +25 -0
- package/core/tokens/_m3-tokens.scss +126 -0
- package/core/tokens/_m3-utils.scss +36 -0
- package/core/tokens/_system.scss +398 -0
- package/core/tokens/_token-utils.scss +119 -0
- package/core/tokens/m2/_index.scss +6 -0
- package/core/tokens/m2/_md-sys-color-internal.scss +11 -0
- package/core/tokens/m2/_md-sys-color.scss +123 -0
- package/core/tokens/m2/_md-sys-elevation.scss +10 -0
- package/core/tokens/m2/_md-sys-motion.scss +30 -0
- package/core/tokens/m2/_md-sys-shape.scss +16 -0
- package/core/tokens/m2/_md-sys-state.scss +8 -0
- package/core/tokens/m2/_md-sys-typescale.scss +68 -0
- package/core/tokens/m3/_index.scss +7 -0
- package/core/tokens/m3/_md-sys-color-internal.scss +11 -0
- package/core/tokens/m3/_md-sys-color.scss +118 -0
- package/core/tokens/m3/_md-sys-elevation.scss +15 -0
- package/core/tokens/m3/_md-sys-motion.scss +35 -0
- package/core/tokens/m3/_md-sys-shape.scss +21 -0
- package/core/tokens/m3/_md-sys-state.scss +13 -0
- package/core/tokens/m3/_md-sys-typescale-internal.scss +5 -0
- package/core/tokens/m3/_md-sys-typescale.scss +114 -0
- package/core/tokens/m3/_theme.scss +35 -0
- package/core/typography/_all-typography.scss +104 -0
- package/core/typography/_typography-utils.scss +31 -0
- package/core/typography/_typography.scss +269 -0
- package/core/typography/_versioning.scss +90 -0
- package/datepicker/_datepicker-theme.scss +132 -0
- package/datepicker/_m2-datepicker.scss +81 -0
- package/datepicker/_m3-datepicker.scss +74 -0
- package/dialog/_dialog-legacy-padding.scss +31 -0
- package/dialog/_dialog-theme.scss +76 -0
- package/dialog/_m2-dialog.scss +43 -0
- package/dialog/_m3-dialog.scss +47 -0
- package/divider/_divider-theme.scss +75 -0
- package/divider/_m2-divider.scss +17 -0
- package/divider/_m3-divider.scss +19 -0
- package/expansion/_expansion-theme.scss +76 -0
- package/expansion/_m2-expansion.scss +64 -0
- package/expansion/_m3-expansion.scss +61 -0
- package/fesm2022/_animation-chunk.mjs +22 -0
- package/fesm2022/_animation-chunk.mjs.map +1 -0
- package/fesm2022/_date-formats-chunk.mjs +86 -0
- package/fesm2022/_date-formats-chunk.mjs.map +1 -0
- package/fesm2022/_date-range-input-harness-chunk.mjs +322 -0
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -0
- package/fesm2022/_error-options-chunk.mjs +66 -0
- package/fesm2022/_error-options-chunk.mjs.map +1 -0
- package/fesm2022/_error-state-chunk.mjs +30 -0
- package/fesm2022/_error-state-chunk.mjs.map +1 -0
- package/fesm2022/_form-field-chunk.mjs +1351 -0
- package/fesm2022/_form-field-chunk.mjs.map +1 -0
- package/fesm2022/_icon-button-chunk.mjs +268 -0
- package/fesm2022/_icon-button-chunk.mjs.map +1 -0
- package/fesm2022/_icon-registry-chunk.mjs +368 -0
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -0
- package/fesm2022/_input-harness-chunk.mjs +67 -0
- package/fesm2022/_input-harness-chunk.mjs.map +1 -0
- package/fesm2022/_input-value-accessor-chunk.mjs +6 -0
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -0
- package/fesm2022/_internal-form-field-chunk.mjs +67 -0
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -0
- package/fesm2022/_line-chunk.mjs +99 -0
- package/fesm2022/_line-chunk.mjs.map +1 -0
- package/fesm2022/_option-chunk.mjs +385 -0
- package/fesm2022/_option-chunk.mjs.map +1 -0
- package/fesm2022/_option-harness-chunk.mjs +30 -0
- package/fesm2022/_option-harness-chunk.mjs.map +1 -0
- package/fesm2022/_option-module-chunk.mjs +48 -0
- package/fesm2022/_option-module-chunk.mjs.map +1 -0
- package/fesm2022/_pseudo-checkbox-chunk.mjs +88 -0
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -0
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +46 -0
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -0
- package/fesm2022/_public-api-chunk.mjs +84 -0
- package/fesm2022/_public-api-chunk.mjs.map +1 -0
- package/fesm2022/_ripple-chunk.mjs +544 -0
- package/fesm2022/_ripple-chunk.mjs.map +1 -0
- package/fesm2022/_ripple-loader-chunk.mjs +144 -0
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -0
- package/fesm2022/_ripple-module-chunk.mjs +46 -0
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -0
- package/fesm2022/_structural-styles-chunk.mjs +45 -0
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -0
- package/fesm2022/_tooltip-chunk.mjs +848 -0
- package/fesm2022/_tooltip-chunk.mjs.map +1 -0
- package/fesm2022/autocomplete-testing.mjs +75 -0
- package/fesm2022/autocomplete-testing.mjs.map +1 -0
- package/fesm2022/autocomplete.mjs +1068 -0
- package/fesm2022/autocomplete.mjs.map +1 -0
- package/fesm2022/badge-testing.mjs +48 -0
- package/fesm2022/badge-testing.mjs.map +1 -0
- package/fesm2022/badge.mjs +357 -0
- package/fesm2022/badge.mjs.map +1 -0
- package/fesm2022/bottom-sheet-testing.mjs +17 -0
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -0
- package/fesm2022/bottom-sheet.mjs +390 -0
- package/fesm2022/bottom-sheet.mjs.map +1 -0
- package/fesm2022/button-testing.mjs +81 -0
- package/fesm2022/button-testing.mjs.map +1 -0
- package/fesm2022/button-toggle-testing.mjs +87 -0
- package/fesm2022/button-toggle-testing.mjs.map +1 -0
- package/fesm2022/button-toggle.mjs +789 -0
- package/fesm2022/button-toggle.mjs.map +1 -0
- package/fesm2022/button.mjs +308 -0
- package/fesm2022/button.mjs.map +1 -0
- package/fesm2022/card-testing.mjs +29 -0
- package/fesm2022/card-testing.mjs.map +1 -0
- package/fesm2022/card.mjs +615 -0
- package/fesm2022/card.mjs.map +1 -0
- package/fesm2022/checkbox-testing.mjs +79 -0
- package/fesm2022/checkbox-testing.mjs.map +1 -0
- package/fesm2022/checkbox.mjs +551 -0
- package/fesm2022/checkbox.mjs.map +1 -0
- package/fesm2022/chips-testing.mjs +239 -0
- package/fesm2022/chips-testing.mjs.map +1 -0
- package/fesm2022/chips.mjs +2663 -0
- package/fesm2022/chips.mjs.map +1 -0
- package/fesm2022/core-testing.mjs +22 -0
- package/fesm2022/core-testing.mjs.map +1 -0
- package/fesm2022/core.mjs +408 -0
- package/fesm2022/core.mjs.map +1 -0
- package/fesm2022/datepicker-testing.mjs +26 -0
- package/fesm2022/datepicker-testing.mjs.map +1 -0
- package/fesm2022/datepicker.mjs +5015 -0
- package/fesm2022/datepicker.mjs.map +1 -0
- package/fesm2022/dialog-testing.mjs +123 -0
- package/fesm2022/dialog-testing.mjs.map +1 -0
- package/fesm2022/dialog.mjs +873 -0
- package/fesm2022/dialog.mjs.map +1 -0
- package/fesm2022/divider-testing.mjs +17 -0
- package/fesm2022/divider-testing.mjs.map +1 -0
- package/fesm2022/divider.mjs +132 -0
- package/fesm2022/divider.mjs.map +1 -0
- package/fesm2022/expansion-testing.mjs +87 -0
- package/fesm2022/expansion-testing.mjs.map +1 -0
- package/fesm2022/expansion.mjs +749 -0
- package/fesm2022/expansion.mjs.map +1 -0
- package/fesm2022/form-field-testing-control.mjs +24 -0
- package/fesm2022/form-field-testing-control.mjs.map +1 -0
- package/fesm2022/form-field-testing.mjs +135 -0
- package/fesm2022/form-field-testing.mjs.map +1 -0
- package/fesm2022/form-field.mjs +57 -0
- package/fesm2022/form-field.mjs.map +1 -0
- package/fesm2022/grid-list-testing.mjs +80 -0
- package/fesm2022/grid-list-testing.mjs.map +1 -0
- package/fesm2022/grid-list.mjs +604 -0
- package/fesm2022/grid-list.mjs.map +1 -0
- package/fesm2022/icon-testing.mjs +172 -0
- package/fesm2022/icon-testing.mjs.map +1 -0
- package/fesm2022/icon.mjs +366 -0
- package/fesm2022/icon.mjs.map +1 -0
- package/fesm2022/input-testing.mjs +73 -0
- package/fesm2022/input-testing.mjs.map +1 -0
- package/fesm2022/input.mjs +495 -0
- package/fesm2022/input.mjs.map +1 -0
- package/fesm2022/list-testing.mjs +295 -0
- package/fesm2022/list-testing.mjs.map +1 -0
- package/fesm2022/list.mjs +1604 -0
- package/fesm2022/list.mjs.map +1 -0
- package/fesm2022/material.mjs +4 -0
- package/fesm2022/material.mjs.map +1 -0
- package/fesm2022/menu-testing.mjs +174 -0
- package/fesm2022/menu-testing.mjs.map +1 -0
- package/fesm2022/menu.mjs +1421 -0
- package/fesm2022/menu.mjs.map +1 -0
- package/fesm2022/paginator-testing.mjs +69 -0
- package/fesm2022/paginator-testing.mjs.map +1 -0
- package/fesm2022/paginator.mjs +445 -0
- package/fesm2022/paginator.mjs.map +1 -0
- package/fesm2022/progress-bar-testing.mjs +20 -0
- package/fesm2022/progress-bar-testing.mjs.map +1 -0
- package/fesm2022/progress-bar.mjs +247 -0
- package/fesm2022/progress-bar.mjs.map +1 -0
- package/fesm2022/progress-spinner-testing.mjs +21 -0
- package/fesm2022/progress-spinner-testing.mjs.map +1 -0
- package/fesm2022/progress-spinner.mjs +258 -0
- package/fesm2022/progress-spinner.mjs.map +1 -0
- package/fesm2022/radio-testing.mjs +143 -0
- package/fesm2022/radio-testing.mjs.map +1 -0
- package/fesm2022/radio.mjs +751 -0
- package/fesm2022/radio.mjs.map +1 -0
- package/fesm2022/select-testing.mjs +92 -0
- package/fesm2022/select-testing.mjs.map +1 -0
- package/fesm2022/select.mjs +1181 -0
- package/fesm2022/select.mjs.map +1 -0
- package/fesm2022/sidenav-testing.mjs +80 -0
- package/fesm2022/sidenav-testing.mjs.map +1 -0
- package/fesm2022/sidenav.mjs +1151 -0
- package/fesm2022/sidenav.mjs.map +1 -0
- package/fesm2022/slide-toggle-testing.mjs +68 -0
- package/fesm2022/slide-toggle-testing.mjs.map +1 -0
- package/fesm2022/slide-toggle.mjs +403 -0
- package/fesm2022/slide-toggle.mjs.map +1 -0
- package/fesm2022/slider-testing.mjs +105 -0
- package/fesm2022/slider-testing.mjs.map +1 -0
- package/fesm2022/slider.mjs +1720 -0
- package/fesm2022/slider.mjs.map +1 -0
- package/fesm2022/snack-bar-testing.mjs +47 -0
- package/fesm2022/snack-bar-testing.mjs.map +1 -0
- package/fesm2022/snack-bar.mjs +820 -0
- package/fesm2022/snack-bar.mjs.map +1 -0
- package/fesm2022/sort-testing.mjs +55 -0
- package/fesm2022/sort-testing.mjs.map +1 -0
- package/fesm2022/sort.mjs +470 -0
- package/fesm2022/sort.mjs.map +1 -0
- package/fesm2022/stepper-testing.mjs +99 -0
- package/fesm2022/stepper-testing.mjs.map +1 -0
- package/fesm2022/stepper.mjs +900 -0
- package/fesm2022/stepper.mjs.map +1 -0
- package/fesm2022/table-testing.mjs +152 -0
- package/fesm2022/table-testing.mjs.map +1 -0
- package/fesm2022/table.mjs +1151 -0
- package/fesm2022/table.mjs.map +1 -0
- package/fesm2022/tabs-testing.mjs +144 -0
- package/fesm2022/tabs-testing.mjs.map +1 -0
- package/fesm2022/tabs.mjs +2435 -0
- package/fesm2022/tabs.mjs.map +1 -0
- package/fesm2022/timepicker-testing.mjs +128 -0
- package/fesm2022/timepicker-testing.mjs.map +1 -0
- package/fesm2022/timepicker.mjs +1284 -0
- package/fesm2022/timepicker.mjs.map +1 -0
- package/fesm2022/toolbar-testing.mjs +26 -0
- package/fesm2022/toolbar-testing.mjs.map +1 -0
- package/fesm2022/toolbar.mjs +182 -0
- package/fesm2022/toolbar.mjs.map +1 -0
- package/fesm2022/tooltip-testing.mjs +48 -0
- package/fesm2022/tooltip-testing.mjs.map +1 -0
- package/fesm2022/tooltip.mjs +58 -0
- package/fesm2022/tooltip.mjs.map +1 -0
- package/fesm2022/tree-testing.mjs +104 -0
- package/fesm2022/tree-testing.mjs.map +1 -0
- package/fesm2022/tree.mjs +681 -0
- package/fesm2022/tree.mjs.map +1 -0
- package/form-field/_form-field-theme.scss +96 -0
- package/form-field/_m2-form-field.scss +226 -0
- package/form-field/_m3-form-field.scss +137 -0
- package/grid-list/_grid-list-theme.scss +76 -0
- package/grid-list/_m2-grid-list.scss +21 -0
- package/grid-list/_m3-grid-list.scss +20 -0
- package/icon/_icon-theme.scss +109 -0
- package/icon/_m2-icon.scss +15 -0
- package/icon/_m3-icon.scss +21 -0
- package/input/_input-theme.scss +36 -0
- package/list/_list-theme.scss +201 -0
- package/list/_m2-list.scss +92 -0
- package/list/_m3-list.scss +93 -0
- package/menu/_m2-menu.scss +44 -0
- package/menu/_m3-menu.scss +42 -0
- package/menu/_menu-theme.scss +76 -0
- package/package.json +404 -0
- package/paginator/_m2-paginator.scss +69 -0
- package/paginator/_m3-paginator.scss +46 -0
- package/paginator/_paginator-theme.scss +76 -0
- package/prebuilt-themes/azure-blue.css +1 -0
- package/prebuilt-themes/cyan-orange.css +1 -0
- package/prebuilt-themes/deeppurple-amber.css +1 -0
- package/prebuilt-themes/indigo-pink.css +1 -0
- package/prebuilt-themes/magenta-violet.css +1 -0
- package/prebuilt-themes/pink-bluegrey.css +1 -0
- package/prebuilt-themes/purple-green.css +1 -0
- package/prebuilt-themes/rose-red.css +1 -0
- package/progress-bar/_m2-progress-bar.scss +36 -0
- package/progress-bar/_m3-progress-bar.scss +29 -0
- package/progress-bar/_progress-bar-theme.scss +93 -0
- package/progress-spinner/_m2-progress-spinner.scss +25 -0
- package/progress-spinner/_m3-progress-spinner.scss +27 -0
- package/progress-spinner/_progress-spinner-theme.scss +95 -0
- package/radio/_m2-radio.scss +67 -0
- package/radio/_m3-radio.scss +65 -0
- package/radio/_radio-theme.scss +102 -0
- package/schematics/collection.json +55 -0
- package/schematics/migration.json +15 -0
- package/schematics/ng-add/fonts/material-fonts.d.ts +11 -0
- package/schematics/ng-add/fonts/material-fonts.js +41 -0
- package/schematics/ng-add/fonts/material-fonts.js.map +1 -0
- package/schematics/ng-add/index.d.ts +17 -0
- package/schematics/ng-add/index.js +54 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/package-config.d.ts +12 -0
- package/schematics/ng-add/package-config.js +51 -0
- package/schematics/ng-add/package-config.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +15 -0
- package/schematics/ng-add/schema.js +10 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +43 -0
- package/schematics/ng-add/setup-project.d.ts +15 -0
- package/schematics/ng-add/setup-project.js +36 -0
- package/schematics/ng-add/setup-project.js.map +1 -0
- package/schematics/ng-add/theming/create-theme.d.ts +9 -0
- package/schematics/ng-add/theming/create-theme.js +58 -0
- package/schematics/ng-add/theming/create-theme.js.map +1 -0
- package/schematics/ng-add/theming/theming.d.ts +11 -0
- package/schematics/ng-add/theming/theming.js +133 -0
- package/schematics/ng-add/theming/theming.js.map +1 -0
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +27 -0
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +99 -0
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +38 -0
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +118 -0
- package/schematics/ng-generate/address-form/index.d.ts +14 -0
- package/schematics/ng-generate/address-form/index.js +43 -0
- package/schematics/ng-generate/address-form/index.js.map +1 -0
- package/schematics/ng-generate/address-form/schema.d.ts +10 -0
- package/schematics/ng-generate/address-form/schema.js +10 -0
- package/schematics/ng-generate/address-form/schema.js.map +1 -0
- package/schematics/ng-generate/address-form/schema.json +100 -0
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +21 -0
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +26 -0
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +36 -0
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +56 -0
- package/schematics/ng-generate/dashboard/index.d.ts +14 -0
- package/schematics/ng-generate/dashboard/index.js +42 -0
- package/schematics/ng-generate/dashboard/index.js.map +1 -0
- package/schematics/ng-generate/dashboard/schema.d.ts +10 -0
- package/schematics/ng-generate/dashboard/schema.js +10 -0
- package/schematics/ng-generate/dashboard/schema.js.map +1 -0
- package/schematics/ng-generate/dashboard/schema.json +100 -0
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +17 -0
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +28 -0
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +36 -0
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +42 -0
- package/schematics/ng-generate/navigation/index.d.ts +14 -0
- package/schematics/ng-generate/navigation/index.js +42 -0
- package/schematics/ng-generate/navigation/index.js.map +1 -0
- package/schematics/ng-generate/navigation/schema.d.ts +10 -0
- package/schematics/ng-generate/navigation/schema.js +10 -0
- package/schematics/ng-generate/navigation/schema.js.map +1 -0
- package/schematics/ng-generate/navigation/schema.json +105 -0
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__-datasource.ts.template +111 -0
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +3 -0
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +26 -0
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +32 -0
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +36 -0
- package/schematics/ng-generate/table/index.d.ts +14 -0
- package/schematics/ng-generate/table/index.js +40 -0
- package/schematics/ng-generate/table/index.js.map +1 -0
- package/schematics/ng-generate/table/schema.d.ts +10 -0
- package/schematics/ng-generate/table/schema.js +10 -0
- package/schematics/ng-generate/table/schema.js.map +1 -0
- package/schematics/ng-generate/table/schema.json +100 -0
- package/schematics/ng-generate/theme-color/index_bundled.js +6561 -0
- package/schematics/ng-generate/theme-color/index_bundled.js.map +6 -0
- package/schematics/ng-generate/theme-color/schema.json +55 -0
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +4 -0
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +22 -0
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +32 -0
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +93 -0
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/example-data.ts.template +47 -0
- package/schematics/ng-generate/tree/index.d.ts +14 -0
- package/schematics/ng-generate/tree/index.js +40 -0
- package/schematics/ng-generate/tree/index.js.map +1 -0
- package/schematics/ng-generate/tree/schema.d.ts +10 -0
- package/schematics/ng-generate/tree/schema.js +10 -0
- package/schematics/ng-generate/tree/schema.js.map +1 -0
- package/schematics/ng-generate/tree/schema.json +100 -0
- package/schematics/ng-update/index_bundled.js +204 -0
- package/schematics/ng-update/index_bundled.js.map +6 -0
- package/schematics/package.json +3 -0
- package/select/_m2-select.scss +49 -0
- package/select/_m3-select.scss +54 -0
- package/select/_select-theme.scss +99 -0
- package/sidenav/_m2-sidenav.scss +48 -0
- package/sidenav/_m3-sidenav.scss +26 -0
- package/sidenav/_sidenav-theme.scss +75 -0
- package/slide-toggle/_m2-slide-toggle.scss +134 -0
- package/slide-toggle/_m3-slide-toggle.scss +133 -0
- package/slide-toggle/_slide-toggle-theme.scss +119 -0
- package/slider/_m2-slider.scss +73 -0
- package/slider/_m3-slider.scss +69 -0
- package/slider/_slider-theme.scss +103 -0
- package/snack-bar/_m2-snack-bar.scss +24 -0
- package/snack-bar/_m3-snack-bar.scss +26 -0
- package/snack-bar/_snack-bar-theme.scss +77 -0
- package/sort/_m2-sort.scss +16 -0
- package/sort/_m3-sort.scss +20 -0
- package/sort/_sort-theme.scss +76 -0
- package/stepper/_m2-stepper.scss +65 -0
- package/stepper/_m3-stepper.scss +66 -0
- package/stepper/_stepper-theme.scss +102 -0
- package/table/_m2-table.scss +63 -0
- package/table/_m3-table.scss +52 -0
- package/table/_table-theme.scss +76 -0
- package/tabs/_m2-tabs.scss +68 -0
- package/tabs/_m3-tabs.scss +58 -0
- package/tabs/_tabs-theme.scss +131 -0
- package/timepicker/_m2-timepicker.scss +19 -0
- package/timepicker/_m3-timepicker.scss +21 -0
- package/timepicker/_timepicker-theme.scss +81 -0
- package/toolbar/_m2-toolbar.scss +43 -0
- package/toolbar/_m3-toolbar.scss +41 -0
- package/toolbar/_toolbar-theme.scss +114 -0
- package/tooltip/_m2-tooltip.scss +24 -0
- package/tooltip/_m3-tooltip.scss +25 -0
- package/tooltip/_tooltip-theme.scss +76 -0
- package/tree/_m2-tree.scss +30 -0
- package/tree/_m3-tree.scss +37 -0
- package/tree/_tree-theme.scss +76 -0
- package/types/_badge-chunk.d.ts +100 -0
- package/types/_button-toggle-chunk.d.ts +252 -0
- package/types/_date-adapter-chunk.d.ts +261 -0
- package/types/_date-range-input-harness-chunk.d.ts +284 -0
- package/types/_dialog-chunk.d.ts +336 -0
- package/types/_error-options-chunk.d.ts +17 -0
- package/types/_form-field-chunk.d.ts +375 -0
- package/types/_form-field-control-chunk.d.ts +64 -0
- package/types/_form-field-control-harness-chunk.d.ts +20 -0
- package/types/_form-field-module-chunk.d.ts +18 -0
- package/types/_icon-module-chunk.d.ts +162 -0
- package/types/_icon-registry-chunk.d.ts +271 -0
- package/types/_input-harness-chunk.d.ts +61 -0
- package/types/_line-chunk.d.ts +25 -0
- package/types/_list-option-types-chunk.d.ts +15 -0
- package/types/_option-chunk.d.ts +146 -0
- package/types/_option-harness-chunk.d.ts +35 -0
- package/types/_option-module-chunk.d.ts +13 -0
- package/types/_option-parent-chunk.d.ts +20 -0
- package/types/_paginator-chunk.d.ts +184 -0
- package/types/_palette-chunk.d.ts +4 -0
- package/types/_progress-spinner-chunk.d.ts +91 -0
- package/types/_pseudo-checkbox-module-chunk.d.ts +45 -0
- package/types/_ripple-chunk.d.ts +256 -0
- package/types/_ripple-loader-chunk.d.ts +48 -0
- package/types/_ripple-module-chunk.d.ts +11 -0
- package/types/_sort-chunk.d.ts +88 -0
- package/types/_sort-direction-chunk.d.ts +3 -0
- package/types/_tooltip-chunk.d.ts +315 -0
- package/types/autocomplete-testing.d.ts +53 -0
- package/types/autocomplete.d.ts +420 -0
- package/types/badge-testing.d.ts +36 -0
- package/types/badge.d.ts +14 -0
- package/types/bottom-sheet-testing.d.ts +26 -0
- package/types/bottom-sheet.d.ts +192 -0
- package/types/button-testing.d.ts +70 -0
- package/types/button-toggle-testing.d.ts +97 -0
- package/types/button-toggle.d.ts +16 -0
- package/types/button.d.ts +210 -0
- package/types/card-testing.d.ts +41 -0
- package/types/card.d.ts +156 -0
- package/types/checkbox-testing.d.ts +86 -0
- package/types/checkbox.d.ts +216 -0
- package/types/chips-testing.d.ts +270 -0
- package/types/chips.d.ts +993 -0
- package/types/core-testing.d.ts +32 -0
- package/types/core.d.ts +185 -0
- package/types/datepicker-testing.d.ts +25 -0
- package/types/datepicker.d.ts +1746 -0
- package/types/dialog-testing.d.ts +83 -0
- package/types/dialog.d.ts +84 -0
- package/types/divider-testing.d.ts +15 -0
- package/types/divider.d.ts +24 -0
- package/types/expansion-testing.d.ts +101 -0
- package/types/expansion.d.ts +258 -0
- package/types/form-field-testing-control.d.ts +13 -0
- package/types/form-field-testing.d.ts +127 -0
- package/types/form-field.d.ts +19 -0
- package/types/grid-list-testing.d.ts +82 -0
- package/types/grid-list.d.ts +207 -0
- package/types/icon-testing.d.ts +81 -0
- package/types/icon.d.ts +8 -0
- package/types/input-testing.d.ts +73 -0
- package/types/input.d.ts +208 -0
- package/types/list-testing.d.ts +354 -0
- package/types/list.d.ts +516 -0
- package/types/material.d.ts +3 -0
- package/types/menu-testing.d.ts +141 -0
- package/types/menu.d.ts +547 -0
- package/types/paginator-testing.d.ts +51 -0
- package/types/paginator.d.ts +36 -0
- package/types/progress-bar-testing.d.ts +24 -0
- package/types/progress-bar.d.ts +106 -0
- package/types/progress-spinner-testing.d.ts +28 -0
- package/types/progress-spinner.d.ts +13 -0
- package/types/radio-testing.d.ts +109 -0
- package/types/radio.d.ts +295 -0
- package/types/select-testing.d.ts +63 -0
- package/types/select.d.ts +448 -0
- package/types/sidenav-testing.d.ts +122 -0
- package/types/sidenav.d.ts +335 -0
- package/types/slide-toggle-testing.d.ts +66 -0
- package/types/slide-toggle.d.ts +151 -0
- package/types/slider-testing.d.ts +90 -0
- package/types/slider.d.ts +662 -0
- package/types/snack-bar-testing.d.ts +64 -0
- package/types/snack-bar.d.ts +328 -0
- package/types/sort-testing.d.ts +48 -0
- package/types/sort.d.ts +126 -0
- package/types/stepper-testing.d.ts +136 -0
- package/types/stepper.d.ts +225 -0
- package/types/table-testing.d.ts +174 -0
- package/types/table.d.ts +302 -0
- package/types/tabs-testing.d.ts +145 -0
- package/types/tabs.d.ts +890 -0
- package/types/timepicker-testing.d.ts +108 -0
- package/types/timepicker.d.ts +318 -0
- package/types/toolbar-testing.d.ts +33 -0
- package/types/toolbar.d.ts +44 -0
- package/types/tooltip-testing.d.ts +35 -0
- package/types/tooltip.d.ts +17 -0
- package/types/tree-testing.d.ts +119 -0
- package/types/tree.d.ts +233 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = default_1;
|
|
11
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
12
|
+
const package_config_1 = require("./package-config");
|
|
13
|
+
/**
|
|
14
|
+
* Version range that will be used for the Angular CDK and Angular Material if this
|
|
15
|
+
* schematic has been run outside of the CLI `ng add` command. In those cases, there
|
|
16
|
+
* can be no dependency on `@angular/material` in the `package.json` file, and we need
|
|
17
|
+
* to manually insert the dependency based on the build version placeholder.
|
|
18
|
+
*
|
|
19
|
+
* Note that the fallback version range does not use caret, but tilde because that is
|
|
20
|
+
* the default for Angular framework dependencies in CLI projects.
|
|
21
|
+
*/
|
|
22
|
+
const fallbackMaterialVersionRange = `~21.2.2`;
|
|
23
|
+
/**
|
|
24
|
+
* Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
|
|
25
|
+
* automatically executed if developers run `ng add @angular/material`.
|
|
26
|
+
*
|
|
27
|
+
* Since the Angular Material schematics depend on the schematic utility functions from the CDK,
|
|
28
|
+
* we need to install the CDK before loading the schematic files that import from the CDK.
|
|
29
|
+
*/
|
|
30
|
+
function default_1(options) {
|
|
31
|
+
return (host, context) => {
|
|
32
|
+
// Version tag of the `@angular/core` dependency that has been loaded from the `package.json`
|
|
33
|
+
// of the CLI project. This tag should be preferred because all Angular dependencies should
|
|
34
|
+
// have the same version tag if possible.
|
|
35
|
+
const ngCoreVersionTag = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/core');
|
|
36
|
+
const materialVersionRange = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/material');
|
|
37
|
+
const angularDependencyVersion = ngCoreVersionTag || `^21.0.0 || ^22.0.0`;
|
|
38
|
+
// The CLI inserts `@angular/material` into the `package.json` before this schematic runs.
|
|
39
|
+
// This means that we do not need to insert Angular Material into `package.json` files again.
|
|
40
|
+
// In some cases though, it could happen that this schematic runs outside of the CLI `ng add`
|
|
41
|
+
// command, or Material is only listed a dev dependency. If that is the case, we insert a
|
|
42
|
+
// version based on the current build version (substituted version placeholder).
|
|
43
|
+
if (materialVersionRange === null) {
|
|
44
|
+
(0, package_config_1.addPackageToPackageJson)(host, '@angular/material', fallbackMaterialVersionRange);
|
|
45
|
+
}
|
|
46
|
+
(0, package_config_1.addPackageToPackageJson)(host, '@angular/cdk', materialVersionRange || fallbackMaterialVersionRange);
|
|
47
|
+
(0, package_config_1.addPackageToPackageJson)(host, '@angular/forms', angularDependencyVersion);
|
|
48
|
+
// Since the Angular Material schematics depend on the schematic utility functions from the
|
|
49
|
+
// CDK, we need to install the CDK before loading the schematic files that import from the CDK.
|
|
50
|
+
const installTaskId = context.addTask(new tasks_1.NodePackageInstallTask());
|
|
51
|
+
context.addTask(new tasks_1.RunSchematicTask('ng-add-setup-project', options), [installTaskId]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAyBH,4BA+BC;AArDD,4DAA0F;AAC1F,qDAA2F;AAG3F;;;;;;;;GAQG;AACH,MAAM,4BAA4B,GAAG,oBAAoB,CAAC;AAE1D;;;;;;GAMG;AACH,mBAAyB,OAAe;IACtC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,6FAA6F;QAC7F,2FAA2F;QAC3F,yCAAyC;QACzC,MAAM,gBAAgB,GAAG,IAAA,iDAAgC,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACjF,MAAM,oBAAoB,GAAG,IAAA,iDAAgC,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QACzF,MAAM,wBAAwB,GAAG,gBAAgB,IAAI,UAAU,CAAC;QAEhE,0FAA0F;QAC1F,6FAA6F;QAC7F,6FAA6F;QAC7F,yFAAyF;QACzF,gFAAgF;QAChF,IAAI,oBAAoB,KAAK,IAAI,EAAE,CAAC;YAClC,IAAA,wCAAuB,EAAC,IAAI,EAAE,mBAAmB,EAAE,4BAA4B,CAAC,CAAC;QACnF,CAAC;QAED,IAAA,wCAAuB,EACrB,IAAI,EACJ,cAAc,EACd,oBAAoB,IAAI,4BAA4B,CACrD,CAAC;QACF,IAAA,wCAAuB,EAAC,IAAI,EAAE,gBAAgB,EAAE,wBAAwB,CAAC,CAAC;QAE1E,2FAA2F;QAC3F,+FAA+F;QAC/F,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAEpE,OAAO,CAAC,OAAO,CAAC,IAAI,wBAAgB,CAAC,sBAAsB,EAAE,OAAO,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
9
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
10
|
+
export declare function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree;
|
|
11
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
12
|
+
export declare function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.addPackageToPackageJson = addPackageToPackageJson;
|
|
11
|
+
exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
|
|
12
|
+
/**
|
|
13
|
+
* Sorts the keys of the given object.
|
|
14
|
+
* @returns A new object instance with sorted keys
|
|
15
|
+
*/
|
|
16
|
+
function sortObjectByKeys(obj) {
|
|
17
|
+
return Object.keys(obj)
|
|
18
|
+
.sort()
|
|
19
|
+
.reduce((result, key) => {
|
|
20
|
+
result[key] = obj[key];
|
|
21
|
+
return result;
|
|
22
|
+
}, {});
|
|
23
|
+
}
|
|
24
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
25
|
+
function addPackageToPackageJson(host, pkg, version) {
|
|
26
|
+
if (host.exists('package.json')) {
|
|
27
|
+
const sourceText = host.read('package.json').toString('utf-8');
|
|
28
|
+
const json = JSON.parse(sourceText);
|
|
29
|
+
if (!json.dependencies) {
|
|
30
|
+
json.dependencies = {};
|
|
31
|
+
}
|
|
32
|
+
if (!json.dependencies[pkg]) {
|
|
33
|
+
json.dependencies[pkg] = version;
|
|
34
|
+
json.dependencies = sortObjectByKeys(json.dependencies);
|
|
35
|
+
}
|
|
36
|
+
host.overwrite('package.json', JSON.stringify(json, null, 2));
|
|
37
|
+
}
|
|
38
|
+
return host;
|
|
39
|
+
}
|
|
40
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
41
|
+
function getPackageVersionFromPackageJson(tree, name) {
|
|
42
|
+
if (!tree.exists('package.json')) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const packageJson = JSON.parse(tree.read('package.json').toString('utf8'));
|
|
46
|
+
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
|
47
|
+
return packageJson.dependencies[name];
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=package-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["package-config.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAyBH,0DAkBC;AAGD,4EAYC;AAlDD;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAA2B;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,MAAM,CACL,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;I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AAI,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
export interface Schema {
|
|
9
|
+
/** Name of the project. */
|
|
10
|
+
project: string;
|
|
11
|
+
/** Name of pre-built theme to install. */
|
|
12
|
+
theme: 'azure-blue' | 'rose-red' | 'magenta-violet' | 'cyan-orange' | 'custom';
|
|
13
|
+
/** Whether to set up global typography styles. */
|
|
14
|
+
typography: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "angular-material-ng-add",
|
|
4
|
+
"title": "Angular Material ng-add schematic",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Name of the project.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"theme": {
|
|
15
|
+
"description": "The theme to apply",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"default": "azure-blue",
|
|
18
|
+
"x-prompt": {
|
|
19
|
+
"message": "Select a pair of starter prebuilt color palettes for your Angular Material theme",
|
|
20
|
+
"type": "list",
|
|
21
|
+
"items": [
|
|
22
|
+
{
|
|
23
|
+
"value": "azure-blue",
|
|
24
|
+
"label": "Azure/Blue [Preview: https://material.angular.dev?theme=azure-blue]"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"value": "rose-red",
|
|
28
|
+
"label": "Rose/Red [Preview: https://material.angular.dev?theme=rose-red]"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"value": "magenta-violet",
|
|
32
|
+
"label": "Magenta/Violet [Preview: https://material.angular.dev?theme=magenta-violet]"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"value": "cyan-orange",
|
|
36
|
+
"label": "Cyan/Orange [Preview: https://material.angular.dev?theme=cyan-orange]"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": []
|
|
43
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
+
import { Schema } from './schema';
|
|
10
|
+
/**
|
|
11
|
+
* Scaffolds the basics of a Angular Material application, this includes:
|
|
12
|
+
* - Add Packages to package.json
|
|
13
|
+
* - Adds pre-built themes to styles.ext
|
|
14
|
+
*/
|
|
15
|
+
export default function (options: Schema): Rule;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = default_1;
|
|
11
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
|
+
const schematics_2 = require("@angular/cdk/schematics");
|
|
13
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
14
|
+
const workspace_models_1 = require("@schematics/angular/utility/workspace-models");
|
|
15
|
+
const material_fonts_1 = require("./fonts/material-fonts");
|
|
16
|
+
const theming_1 = require("./theming/theming");
|
|
17
|
+
/**
|
|
18
|
+
* Scaffolds the basics of a Angular Material application, this includes:
|
|
19
|
+
* - Add Packages to package.json
|
|
20
|
+
* - Adds pre-built themes to styles.ext
|
|
21
|
+
*/
|
|
22
|
+
function default_1(options) {
|
|
23
|
+
return async (host, context) => {
|
|
24
|
+
const workspace = await (0, utility_1.readWorkspace)(host);
|
|
25
|
+
const project = (0, schematics_2.getProjectFromWorkspace)(workspace, options.project);
|
|
26
|
+
if (project.extensions['projectType'] === workspace_models_1.ProjectType.Application) {
|
|
27
|
+
return (0, schematics_1.chain)([(0, theming_1.addThemeToAppStyles)(options), (0, material_fonts_1.addFontsToIndex)(options)]);
|
|
28
|
+
}
|
|
29
|
+
context.logger.warn('Angular Material has been set up in your workspace. There is no additional setup ' +
|
|
30
|
+
'required for consuming Angular Material in your library project.\n\n' +
|
|
31
|
+
'If you intended to run the schematic on a different project, pass the `--project` ' +
|
|
32
|
+
'option.');
|
|
33
|
+
return;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=setup-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-project.js","sourceRoot":"","sources":["setup-project.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAeH,4BAgBC;AA7BD,2DAA+E;AAC/E,wDAAgE;AAChE,yDAA0D;AAC1D,mFAAyE;AACzE,2DAAuD;AAEvD,+CAAsD;AAEtD;;;;GAIG;AACH,mBAAyB,OAAe;IACtC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,MAAM,SAAS,GAAG,MAAM,IAAA,uBAAa,EAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEpE,IAAI,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,8BAAW,CAAC,WAAW,EAAE,CAAC;YAClE,OAAO,IAAA,kBAAK,EAAC,CAAC,IAAA,6BAAmB,EAAC,OAAO,CAAC,EAAE,IAAA,gCAAe,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,mFAAmF;YACjF,sEAAsE;YACtE,oFAAoF;YACpF,SAAS,CACZ,CAAC;QACF,OAAO;IACT,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
/** Create theme for the given application configuration. */
|
|
9
|
+
export declare function createTheme(userPaletteChoice: string): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createTheme = createTheme;
|
|
11
|
+
/** Create theme for the given application configuration. */
|
|
12
|
+
function createTheme(userPaletteChoice) {
|
|
13
|
+
const colorPalettes = new Map([
|
|
14
|
+
['azure-blue', { primary: 'azure', tertiary: 'blue' }],
|
|
15
|
+
['rose-red', { primary: 'rose', tertiary: 'red' }],
|
|
16
|
+
['magenta-violet', { primary: 'magenta', tertiary: 'violet' }],
|
|
17
|
+
['cyan-orange', { primary: 'cyan', tertiary: 'orange' }],
|
|
18
|
+
]);
|
|
19
|
+
return `
|
|
20
|
+
// Include theming for Angular Material with \`mat.theme()\`.
|
|
21
|
+
// This Sass mixin will define CSS variables that are used for styling Angular Material
|
|
22
|
+
// components according to the Material 3 design spec.
|
|
23
|
+
// Learn more about theming and how to use it for your application's
|
|
24
|
+
// custom components at https://material.angular.dev/guide/theming
|
|
25
|
+
@use '@angular/material' as mat;
|
|
26
|
+
|
|
27
|
+
html {
|
|
28
|
+
height: 100%;
|
|
29
|
+
@include mat.theme((
|
|
30
|
+
color: (
|
|
31
|
+
primary: mat.$${colorPalettes.get(userPaletteChoice).primary}-palette,
|
|
32
|
+
tertiary: mat.$${colorPalettes.get(userPaletteChoice).tertiary}-palette,
|
|
33
|
+
),
|
|
34
|
+
typography: Roboto,
|
|
35
|
+
density: 0,
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
body {
|
|
40
|
+
// Default the application to a light color theme. This can be changed to
|
|
41
|
+
// \`dark\` to enable the dark color theme, or to \`light dark\` to defer to the
|
|
42
|
+
// user's system settings.
|
|
43
|
+
color-scheme: light;
|
|
44
|
+
|
|
45
|
+
// Set a default background, font and text colors for the application using
|
|
46
|
+
// Angular Material's system-level CSS variables. Learn more about these
|
|
47
|
+
// variables at https://material.angular.dev/guide/system-variables
|
|
48
|
+
background-color: var(--mat-sys-surface);
|
|
49
|
+
color: var(--mat-sys-on-surface);
|
|
50
|
+
font: var(--mat-sys-body-medium);
|
|
51
|
+
|
|
52
|
+
// Reset the user agent margin.
|
|
53
|
+
margin: 0;
|
|
54
|
+
height: 100%;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=create-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-theme.js","sourceRoot":"","sources":["create-theme.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAGH,kCA6CC;AA9CD,4DAA4D;AAC5D,SAAgB,WAAW,CAAC,iBAAyB;IACnD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;QAC5B,CAAC,YAAY,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAC,CAAC;QACpD,CAAC,UAAU,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC;QAChD,CAAC,gBAAgB,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;QAC5D,CAAC,aAAa,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;KACvD,CAAC,CAAC;IACH,OAAO;;;;;;;;;;;;sBAYa,aAAa,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,OAAO;uBAC5C,aAAa,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;CAwBpE,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
+
import { Schema } from '../schema';
|
|
10
|
+
/** Add pre-built styles to the main project style file. */
|
|
11
|
+
export declare function addThemeToAppStyles(options: Schema): Rule;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.addThemeToAppStyles = addThemeToAppStyles;
|
|
11
|
+
const core_1 = require("@angular-devkit/core");
|
|
12
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
+
const schematics_2 = require("@angular/cdk/schematics");
|
|
14
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
15
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
16
|
+
const path_1 = require("path");
|
|
17
|
+
const create_theme_1 = require("./create-theme");
|
|
18
|
+
/** Path segment that can be found in paths that refer to a prebuilt theme. */
|
|
19
|
+
const prebuiltThemePathSegment = '@angular/material/prebuilt-themes';
|
|
20
|
+
/** Default file name of the custom theme that can be generated. */
|
|
21
|
+
const defaultThemeFilename = 'material-theme.scss';
|
|
22
|
+
/** Add pre-built styles to the main project style file. */
|
|
23
|
+
function addThemeToAppStyles(options) {
|
|
24
|
+
return (host, context) => {
|
|
25
|
+
let palettes = options.theme || 'azure-blue';
|
|
26
|
+
// For a long time, theme param could be "custom" which meant to add a custom theme. This option
|
|
27
|
+
// was removed since we always add a custom theme, and we expect this option to be the
|
|
28
|
+
// user's preferred palettes. However it's possible that users will have hardcoded CLI commands
|
|
29
|
+
// that pass "--theme custom" and we can gracefully handle this by assuming azure-blue.
|
|
30
|
+
if (palettes === 'custom') {
|
|
31
|
+
palettes = 'azure-blue';
|
|
32
|
+
}
|
|
33
|
+
return insertTheme(palettes, options.project, host, context.logger);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Insert an Angular Material theme to project style file. If no valid style file could be found,
|
|
38
|
+
* a new Sass file for the theme will be created.
|
|
39
|
+
*/
|
|
40
|
+
async function insertTheme(palettes, projectName, host, logger) {
|
|
41
|
+
const workspace = await (0, utility_1.readWorkspace)(host);
|
|
42
|
+
const project = (0, schematics_2.getProjectFromWorkspace)(workspace, projectName);
|
|
43
|
+
const stylesPath = (0, schematics_2.getProjectStyleFile)(project, 'scss');
|
|
44
|
+
const themeContent = (0, create_theme_1.createTheme)(palettes);
|
|
45
|
+
if (!stylesPath) {
|
|
46
|
+
if (!project.sourceRoot) {
|
|
47
|
+
throw new schematics_1.SchematicsException(`Could not find source root for project: "${projectName}". ` +
|
|
48
|
+
`Please make sure that the "sourceRoot" property is set in the workspace config.`);
|
|
49
|
+
}
|
|
50
|
+
// Normalize the path through the devkit utilities because we want to avoid having
|
|
51
|
+
// unnecessary path segments and windows backslash delimiters.
|
|
52
|
+
const themePath = (0, core_1.normalize)((0, path_1.join)(project.sourceRoot, defaultThemeFilename));
|
|
53
|
+
if (host.exists(themePath)) {
|
|
54
|
+
logger.warn(`Cannot create an Angular Material theme because
|
|
55
|
+
${themePath} already exists. Skipping theme generation.`);
|
|
56
|
+
return (0, schematics_1.noop)();
|
|
57
|
+
}
|
|
58
|
+
host.create(themePath, themeContent);
|
|
59
|
+
return addThemeStyleToTarget(projectName, 'build', themePath, logger);
|
|
60
|
+
}
|
|
61
|
+
const insertion = new change_1.InsertChange(stylesPath, 0, themeContent);
|
|
62
|
+
const recorder = host.beginUpdate(stylesPath);
|
|
63
|
+
recorder.insertLeft(insertion.pos, insertion.toAdd);
|
|
64
|
+
host.commitUpdate(recorder);
|
|
65
|
+
return (0, schematics_1.noop)();
|
|
66
|
+
}
|
|
67
|
+
/** Adds a theming style entry to the given project target options. */
|
|
68
|
+
function addThemeStyleToTarget(projectName, targetName, assetPath, logger) {
|
|
69
|
+
return (0, utility_1.updateWorkspace)(workspace => {
|
|
70
|
+
const project = (0, schematics_2.getProjectFromWorkspace)(workspace, projectName);
|
|
71
|
+
// Do not update the builder options in case the target does not use the default CLI builder.
|
|
72
|
+
if (!validateDefaultTargetBuilder(project, targetName, logger)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const targetOptions = (0, schematics_2.getProjectTargetOptions)(project, targetName);
|
|
76
|
+
const styles = targetOptions['styles'];
|
|
77
|
+
if (!styles) {
|
|
78
|
+
targetOptions['styles'] = [assetPath];
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const existingStyles = styles.map(s => (typeof s === 'string' ? s : s.input));
|
|
82
|
+
for (let [index, stylePath] of existingStyles.entries()) {
|
|
83
|
+
// If the given asset is already specified in the styles, we don't need to do anything.
|
|
84
|
+
if (stylePath === assetPath) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
// In case a prebuilt theme is already set up, we can safely replace the theme with the new
|
|
88
|
+
// theme file. If a custom theme is set up, we are not able to safely replace the custom
|
|
89
|
+
// theme because these files can contain custom styles, while prebuilt themes are
|
|
90
|
+
// always packaged and considered replaceable.
|
|
91
|
+
if (stylePath.includes(defaultThemeFilename)) {
|
|
92
|
+
logger.error(`Could not add the selected theme to the CLI project ` +
|
|
93
|
+
`configuration because there is already a theme file referenced.`);
|
|
94
|
+
logger.info(`Please manually add the following style file to your configuration:`);
|
|
95
|
+
logger.info(` ${assetPath}`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
else if (stylePath.includes(prebuiltThemePathSegment)) {
|
|
99
|
+
styles.splice(index, 1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
styles.unshift(assetPath);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Validates that the specified project target is configured with the default builders which are
|
|
108
|
+
* provided by the Angular CLI. If the configured builder does not match the default builder,
|
|
109
|
+
* this function can either throw or just show a warning.
|
|
110
|
+
*/
|
|
111
|
+
function validateDefaultTargetBuilder(project, targetName, logger) {
|
|
112
|
+
const targets = targetName === 'test' ? (0, schematics_2.getProjectTestTargets)(project) : (0, schematics_2.getProjectBuildTargets)(project);
|
|
113
|
+
const isDefaultBuilder = targets.length > 0;
|
|
114
|
+
// Because the build setup for the Angular CLI can be customized by developers, we can't know
|
|
115
|
+
// where to put the theme file in the workspace configuration if custom builders are being
|
|
116
|
+
// used. In case the builder has been changed for the "build" target, we throw an error and
|
|
117
|
+
// exit because setting up a theme is a primary goal of `ng-add`. Otherwise if just the "test"
|
|
118
|
+
// builder has been changed, we warn because a theme is not mandatory for running tests
|
|
119
|
+
// with Material. See: https://github.com/angular/components/issues/14176
|
|
120
|
+
if (!isDefaultBuilder && targetName === 'build') {
|
|
121
|
+
throw new schematics_1.SchematicsException(`Your project is not using the default builders for ` +
|
|
122
|
+
`"${targetName}". The Angular Material schematics cannot add a theme to the workspace ` +
|
|
123
|
+
`configuration if the builder has been changed.`);
|
|
124
|
+
}
|
|
125
|
+
else if (!isDefaultBuilder) {
|
|
126
|
+
// for non-build targets we gracefully report the error without actually aborting the
|
|
127
|
+
// setup schematic. This is because a theme is not mandatory for running tests.
|
|
128
|
+
logger.warn(`Your project is not using the default builders for "${targetName}". This ` +
|
|
129
|
+
`means that we cannot add the configured theme to the "${targetName}" target.`);
|
|
130
|
+
}
|
|
131
|
+
return isDefaultBuilder;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=theming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theming.js","sourceRoot":"","sources":["theming.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAwBH,kDAcC;AApCD,+CAAwD;AACxD,2DAAmG;AACnG,wDAMiC;AACjC,+DAAgE;AAChE,yDAA8F;AAC9F,+BAA0B;AAE1B,iDAA2C;AAE3C,8EAA8E;AAC9E,MAAM,wBAAwB,GAAG,mCAAmC,CAAC;AAErE,mEAAmE;AACnE,MAAM,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FAA8F;IAC9F,uFAAuF;IACvF,yEAAyE;IACzE,IAAI,CAAC,gBAAgB,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAChD,MAAM,IAAI,gCAAmB,CAC3B,qDAAqD;YACnD,IAAI,UAAU,yEAAyE;YACvF,gDAAgD,CACnD,CAAC;IACJ,CAAC;SAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC7B,qFAAqF;QACrF,+EAA+E;QAC/E,MAAM,CAAC,IAAI,CACT,uDAAuD,UAAU,UAAU;YACzE,yDAAyD,UAAU,WAAW,CACjF,CAAC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.full-width {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.shipping-card {
|
|
6
|
+
min-width: 120px;
|
|
7
|
+
margin: 20px auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mat-radio-button {
|
|
11
|
+
display: block;
|
|
12
|
+
margin: 5px 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.row {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.col {
|
|
21
|
+
flex: 1;
|
|
22
|
+
margin-right: 20px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.col:last-child {
|
|
26
|
+
margin-right: 0;
|
|
27
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<form [formGroup]="addressForm" novalidate (ngSubmit)="onSubmit()">
|
|
2
|
+
<mat-card class="shipping-card">
|
|
3
|
+
<mat-card-header>
|
|
4
|
+
<mat-card-title>Shipping Information</mat-card-title>
|
|
5
|
+
</mat-card-header>
|
|
6
|
+
<mat-card-content>
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col">
|
|
9
|
+
<mat-form-field class="full-width">
|
|
10
|
+
<input matInput placeholder="Company" formControlName="company">
|
|
11
|
+
</mat-form-field>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col">
|
|
16
|
+
<mat-form-field class="full-width">
|
|
17
|
+
<input matInput placeholder="First name" formControlName="firstName">
|
|
18
|
+
@if (addressForm.controls['firstName'].hasError('required')) {
|
|
19
|
+
<mat-error>First name is <strong>required</strong></mat-error>
|
|
20
|
+
}
|
|
21
|
+
</mat-form-field>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="col">
|
|
24
|
+
<mat-form-field class="full-width">
|
|
25
|
+
<input matInput placeholder="Last name" formControlName="lastName">
|
|
26
|
+
@if (addressForm.controls['lastName'].hasError('required')) {
|
|
27
|
+
<mat-error>Last name is <strong>required</strong></mat-error>
|
|
28
|
+
}
|
|
29
|
+
</mat-form-field>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="row">
|
|
33
|
+
<div class="col">
|
|
34
|
+
<mat-form-field class="full-width">
|
|
35
|
+
<textarea matInput placeholder="Address" formControlName="address"></textarea>
|
|
36
|
+
@if (addressForm.controls['address'].hasError('required')) {
|
|
37
|
+
<mat-error>Address is <strong>required</strong></mat-error>
|
|
38
|
+
}
|
|
39
|
+
</mat-form-field>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="row">
|
|
43
|
+
<div class="col">
|
|
44
|
+
@if (hasUnitNumber) {
|
|
45
|
+
<mat-form-field class="full-width">
|
|
46
|
+
<textarea matInput placeholder="Address 2" formControlName="address2"></textarea>
|
|
47
|
+
</mat-form-field>
|
|
48
|
+
} @else {
|
|
49
|
+
<button matButton type="button" (click)="hasUnitNumber = !hasUnitNumber">
|
|
50
|
+
+ Add C/O, Apt, Suite, Unit
|
|
51
|
+
</button>
|
|
52
|
+
}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="row">
|
|
56
|
+
<div class="col">
|
|
57
|
+
<mat-form-field class="full-width">
|
|
58
|
+
<input matInput placeholder="City" formControlName="city">
|
|
59
|
+
@if (addressForm.controls['city'].hasError('required')) {
|
|
60
|
+
<mat-error>City is <strong>required</strong></mat-error>
|
|
61
|
+
}
|
|
62
|
+
</mat-form-field>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="col">
|
|
65
|
+
<mat-form-field class="full-width">
|
|
66
|
+
<mat-select placeholder="State" formControlName="state">
|
|
67
|
+
@for (state of states; track state) {
|
|
68
|
+
<mat-option [value]="state.abbreviation">{{ state.name }}</mat-option>
|
|
69
|
+
}
|
|
70
|
+
</mat-select>
|
|
71
|
+
@if (addressForm.controls['state'].hasError('required')) {
|
|
72
|
+
<mat-error>State is <strong>required</strong></mat-error>
|
|
73
|
+
}
|
|
74
|
+
</mat-form-field>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="row">
|
|
78
|
+
<div class="col">
|
|
79
|
+
<mat-form-field class="full-width">
|
|
80
|
+
<input matInput #postalCode maxlength="5" placeholder="Postal Code" type="number" formControlName="postalCode">
|
|
81
|
+
<mat-hint align="end">{{postalCode.value.length}} / 5</mat-hint>
|
|
82
|
+
</mat-form-field>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="row">
|
|
86
|
+
<div class="col">
|
|
87
|
+
<mat-radio-group formControlName="shipping">
|
|
88
|
+
<mat-radio-button value="free">Free Shipping</mat-radio-button>
|
|
89
|
+
<mat-radio-button value="priority">Priority Shipping</mat-radio-button>
|
|
90
|
+
<mat-radio-button value="nextday">Next Day Shipping</mat-radio-button>
|
|
91
|
+
</mat-radio-group>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</mat-card-content>
|
|
95
|
+
<mat-card-actions>
|
|
96
|
+
<button matButton="elevated" color="primary" type="submit">Submit</button>
|
|
97
|
+
</mat-card-actions>
|
|
98
|
+
</mat-card>
|
|
99
|
+
</form>
|