@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,1720 @@
|
|
|
1
|
+
import { Directionality, BidiModule } from '@angular/cdk/bidi';
|
|
2
|
+
import { Platform } from '@angular/cdk/platform';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, ChangeDetectorRef, NgZone, Renderer2, ElementRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ViewChild, booleanAttribute, numberAttribute, ViewChildren, ContentChild, ContentChildren, forwardRef, EventEmitter, signal, Directive, Output, NgModule } from '@angular/core';
|
|
5
|
+
import { RippleState, MatRipple, MAT_RIPPLE_GLOBAL_OPTIONS } from './_ripple-chunk.mjs';
|
|
6
|
+
import { _CdkPrivateStyleLoader } from '@angular/cdk/private';
|
|
7
|
+
import { _animationsDisabled } from './_animation-chunk.mjs';
|
|
8
|
+
import { _StructuralStylesLoader } from './_structural-styles-chunk.mjs';
|
|
9
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
10
|
+
import { Subject } from 'rxjs';
|
|
11
|
+
import { MatRippleModule } from './_ripple-module-chunk.mjs';
|
|
12
|
+
import '@angular/cdk/a11y';
|
|
13
|
+
import '@angular/cdk/coercion';
|
|
14
|
+
import '@angular/cdk/layout';
|
|
15
|
+
|
|
16
|
+
var _MatThumb;
|
|
17
|
+
(function (_MatThumb) {
|
|
18
|
+
_MatThumb[_MatThumb["START"] = 1] = "START";
|
|
19
|
+
_MatThumb[_MatThumb["END"] = 2] = "END";
|
|
20
|
+
})(_MatThumb || (_MatThumb = {}));
|
|
21
|
+
var _MatTickMark;
|
|
22
|
+
(function (_MatTickMark) {
|
|
23
|
+
_MatTickMark[_MatTickMark["ACTIVE"] = 0] = "ACTIVE";
|
|
24
|
+
_MatTickMark[_MatTickMark["INACTIVE"] = 1] = "INACTIVE";
|
|
25
|
+
})(_MatTickMark || (_MatTickMark = {}));
|
|
26
|
+
const MAT_SLIDER = new InjectionToken('_MatSlider');
|
|
27
|
+
const MAT_SLIDER_THUMB = new InjectionToken('_MatSliderThumb');
|
|
28
|
+
const MAT_SLIDER_RANGE_THUMB = new InjectionToken('_MatSliderRangeThumb');
|
|
29
|
+
const MAT_SLIDER_VISUAL_THUMB = new InjectionToken('_MatSliderVisualThumb');
|
|
30
|
+
class MatSliderChange {
|
|
31
|
+
source;
|
|
32
|
+
parent;
|
|
33
|
+
value;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
class MatSliderVisualThumb {
|
|
37
|
+
_cdr = inject(ChangeDetectorRef);
|
|
38
|
+
_ngZone = inject(NgZone);
|
|
39
|
+
_slider = inject(MAT_SLIDER);
|
|
40
|
+
_renderer = inject(Renderer2);
|
|
41
|
+
_listenerCleanups;
|
|
42
|
+
discrete = false;
|
|
43
|
+
thumbPosition;
|
|
44
|
+
valueIndicatorText;
|
|
45
|
+
_ripple;
|
|
46
|
+
_knob;
|
|
47
|
+
_valueIndicatorContainer;
|
|
48
|
+
_sliderInput;
|
|
49
|
+
_sliderInputEl;
|
|
50
|
+
_hoverRippleRef;
|
|
51
|
+
_focusRippleRef;
|
|
52
|
+
_activeRippleRef;
|
|
53
|
+
_isHovered = false;
|
|
54
|
+
_isActive = false;
|
|
55
|
+
_isValueIndicatorVisible = false;
|
|
56
|
+
_hostElement = inject(ElementRef).nativeElement;
|
|
57
|
+
_platform = inject(Platform);
|
|
58
|
+
constructor() {}
|
|
59
|
+
ngAfterViewInit() {
|
|
60
|
+
const sliderInput = this._slider._getInput(this.thumbPosition);
|
|
61
|
+
if (!sliderInput) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this._ripple.radius = 24;
|
|
65
|
+
this._sliderInput = sliderInput;
|
|
66
|
+
this._sliderInputEl = this._sliderInput._hostElement;
|
|
67
|
+
this._ngZone.runOutsideAngular(() => {
|
|
68
|
+
const input = this._sliderInputEl;
|
|
69
|
+
const renderer = this._renderer;
|
|
70
|
+
this._listenerCleanups = [renderer.listen(input, 'pointermove', this._onPointerMove), renderer.listen(input, 'pointerdown', this._onDragStart), renderer.listen(input, 'pointerup', this._onDragEnd), renderer.listen(input, 'pointerleave', this._onMouseLeave), renderer.listen(input, 'focus', this._onFocus), renderer.listen(input, 'blur', this._onBlur)];
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
ngOnDestroy() {
|
|
74
|
+
this._listenerCleanups?.forEach(cleanup => cleanup());
|
|
75
|
+
}
|
|
76
|
+
_onPointerMove = event => {
|
|
77
|
+
if (this._sliderInput._isFocused) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const rect = this._hostElement.getBoundingClientRect();
|
|
81
|
+
const isHovered = this._slider._isCursorOnSliderThumb(event, rect);
|
|
82
|
+
this._isHovered = isHovered;
|
|
83
|
+
if (isHovered) {
|
|
84
|
+
this._showHoverRipple();
|
|
85
|
+
} else {
|
|
86
|
+
this._hideRipple(this._hoverRippleRef);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
_onMouseLeave = () => {
|
|
90
|
+
this._isHovered = false;
|
|
91
|
+
this._hideRipple(this._hoverRippleRef);
|
|
92
|
+
};
|
|
93
|
+
_onFocus = () => {
|
|
94
|
+
this._hideRipple(this._hoverRippleRef);
|
|
95
|
+
this._showFocusRipple();
|
|
96
|
+
this._hostElement.classList.add('mdc-slider__thumb--focused');
|
|
97
|
+
};
|
|
98
|
+
_onBlur = () => {
|
|
99
|
+
if (!this._isActive) {
|
|
100
|
+
this._hideRipple(this._focusRippleRef);
|
|
101
|
+
}
|
|
102
|
+
if (this._isHovered) {
|
|
103
|
+
this._showHoverRipple();
|
|
104
|
+
}
|
|
105
|
+
this._hostElement.classList.remove('mdc-slider__thumb--focused');
|
|
106
|
+
};
|
|
107
|
+
_onDragStart = event => {
|
|
108
|
+
if (event.button !== 0) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this._isActive = true;
|
|
112
|
+
this._showActiveRipple();
|
|
113
|
+
};
|
|
114
|
+
_onDragEnd = () => {
|
|
115
|
+
this._isActive = false;
|
|
116
|
+
this._hideRipple(this._activeRippleRef);
|
|
117
|
+
if (!this._sliderInput._isFocused) {
|
|
118
|
+
this._hideRipple(this._focusRippleRef);
|
|
119
|
+
}
|
|
120
|
+
if (this._platform.SAFARI) {
|
|
121
|
+
this._showHoverRipple();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
_showHoverRipple() {
|
|
125
|
+
if (!this._isShowingRipple(this._hoverRippleRef)) {
|
|
126
|
+
this._hoverRippleRef = this._showRipple({
|
|
127
|
+
enterDuration: 0,
|
|
128
|
+
exitDuration: 0
|
|
129
|
+
});
|
|
130
|
+
this._hoverRippleRef?.element.classList.add('mat-mdc-slider-hover-ripple');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
_showFocusRipple() {
|
|
134
|
+
if (!this._isShowingRipple(this._focusRippleRef)) {
|
|
135
|
+
this._focusRippleRef = this._showRipple({
|
|
136
|
+
enterDuration: 0,
|
|
137
|
+
exitDuration: 0
|
|
138
|
+
}, true);
|
|
139
|
+
this._focusRippleRef?.element.classList.add('mat-mdc-slider-focus-ripple');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
_showActiveRipple() {
|
|
143
|
+
if (!this._isShowingRipple(this._activeRippleRef)) {
|
|
144
|
+
this._activeRippleRef = this._showRipple({
|
|
145
|
+
enterDuration: 225,
|
|
146
|
+
exitDuration: 400
|
|
147
|
+
});
|
|
148
|
+
this._activeRippleRef?.element.classList.add('mat-mdc-slider-active-ripple');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
_isShowingRipple(rippleRef) {
|
|
152
|
+
return rippleRef?.state === RippleState.FADING_IN || rippleRef?.state === RippleState.VISIBLE;
|
|
153
|
+
}
|
|
154
|
+
_showRipple(animation, ignoreGlobalRippleConfig) {
|
|
155
|
+
if (this._slider.disabled) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this._showValueIndicator();
|
|
159
|
+
if (this._slider._isRange) {
|
|
160
|
+
const sibling = this._slider._getThumb(this.thumbPosition === _MatThumb.START ? _MatThumb.END : _MatThumb.START);
|
|
161
|
+
sibling._showValueIndicator();
|
|
162
|
+
}
|
|
163
|
+
if (this._slider._globalRippleOptions?.disabled && !ignoreGlobalRippleConfig) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
return this._ripple.launch({
|
|
167
|
+
animation: this._slider._noopAnimations ? {
|
|
168
|
+
enterDuration: 0,
|
|
169
|
+
exitDuration: 0
|
|
170
|
+
} : animation,
|
|
171
|
+
centered: true,
|
|
172
|
+
persistent: true
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
_hideRipple(rippleRef) {
|
|
176
|
+
rippleRef?.fadeOut();
|
|
177
|
+
if (this._isShowingAnyRipple()) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (!this._slider._isRange) {
|
|
181
|
+
this._hideValueIndicator();
|
|
182
|
+
}
|
|
183
|
+
const sibling = this._getSibling();
|
|
184
|
+
if (!sibling._isShowingAnyRipple()) {
|
|
185
|
+
this._hideValueIndicator();
|
|
186
|
+
sibling._hideValueIndicator();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
_showValueIndicator() {
|
|
190
|
+
this._hostElement.classList.add('mdc-slider__thumb--with-indicator');
|
|
191
|
+
}
|
|
192
|
+
_hideValueIndicator() {
|
|
193
|
+
this._hostElement.classList.remove('mdc-slider__thumb--with-indicator');
|
|
194
|
+
}
|
|
195
|
+
_getSibling() {
|
|
196
|
+
return this._slider._getThumb(this.thumbPosition === _MatThumb.START ? _MatThumb.END : _MatThumb.START);
|
|
197
|
+
}
|
|
198
|
+
_getValueIndicatorContainer() {
|
|
199
|
+
return this._valueIndicatorContainer?.nativeElement;
|
|
200
|
+
}
|
|
201
|
+
_getKnob() {
|
|
202
|
+
return this._knob.nativeElement;
|
|
203
|
+
}
|
|
204
|
+
_isShowingAnyRipple() {
|
|
205
|
+
return this._isShowingRipple(this._hoverRippleRef) || this._isShowingRipple(this._focusRippleRef) || this._isShowingRipple(this._activeRippleRef);
|
|
206
|
+
}
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
208
|
+
minVersion: "12.0.0",
|
|
209
|
+
version: "22.0.0-next.1",
|
|
210
|
+
ngImport: i0,
|
|
211
|
+
type: MatSliderVisualThumb,
|
|
212
|
+
deps: [],
|
|
213
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
214
|
+
});
|
|
215
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
216
|
+
minVersion: "17.0.0",
|
|
217
|
+
version: "22.0.0-next.1",
|
|
218
|
+
type: MatSliderVisualThumb,
|
|
219
|
+
isStandalone: true,
|
|
220
|
+
selector: "mat-slider-visual-thumb",
|
|
221
|
+
inputs: {
|
|
222
|
+
discrete: "discrete",
|
|
223
|
+
thumbPosition: "thumbPosition",
|
|
224
|
+
valueIndicatorText: "valueIndicatorText"
|
|
225
|
+
},
|
|
226
|
+
host: {
|
|
227
|
+
classAttribute: "mdc-slider__thumb mat-mdc-slider-visual-thumb"
|
|
228
|
+
},
|
|
229
|
+
providers: [{
|
|
230
|
+
provide: MAT_SLIDER_VISUAL_THUMB,
|
|
231
|
+
useExisting: MatSliderVisualThumb
|
|
232
|
+
}],
|
|
233
|
+
viewQueries: [{
|
|
234
|
+
propertyName: "_ripple",
|
|
235
|
+
first: true,
|
|
236
|
+
predicate: MatRipple,
|
|
237
|
+
descendants: true
|
|
238
|
+
}, {
|
|
239
|
+
propertyName: "_knob",
|
|
240
|
+
first: true,
|
|
241
|
+
predicate: ["knob"],
|
|
242
|
+
descendants: true
|
|
243
|
+
}, {
|
|
244
|
+
propertyName: "_valueIndicatorContainer",
|
|
245
|
+
first: true,
|
|
246
|
+
predicate: ["valueIndicatorContainer"],
|
|
247
|
+
descendants: true
|
|
248
|
+
}],
|
|
249
|
+
ngImport: i0,
|
|
250
|
+
template: "@if (discrete) {\n <div class=\"mdc-slider__value-indicator-container\" #valueIndicatorContainer>\n <div class=\"mdc-slider__value-indicator\">\n <span class=\"mdc-slider__value-indicator-text\">{{valueIndicatorText}}</span>\n </div>\n </div>\n}\n<div class=\"mdc-slider__thumb-knob\" #knob></div>\n<div matRipple class=\"mat-focus-indicator\" [matRippleDisabled]=\"true\"></div>\n",
|
|
251
|
+
styles: [".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}\n"],
|
|
252
|
+
dependencies: [{
|
|
253
|
+
kind: "directive",
|
|
254
|
+
type: MatRipple,
|
|
255
|
+
selector: "[mat-ripple], [matRipple]",
|
|
256
|
+
inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"],
|
|
257
|
+
exportAs: ["matRipple"]
|
|
258
|
+
}],
|
|
259
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
260
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
264
|
+
minVersion: "12.0.0",
|
|
265
|
+
version: "22.0.0-next.1",
|
|
266
|
+
ngImport: i0,
|
|
267
|
+
type: MatSliderVisualThumb,
|
|
268
|
+
decorators: [{
|
|
269
|
+
type: Component,
|
|
270
|
+
args: [{
|
|
271
|
+
selector: 'mat-slider-visual-thumb',
|
|
272
|
+
host: {
|
|
273
|
+
'class': 'mdc-slider__thumb mat-mdc-slider-visual-thumb'
|
|
274
|
+
},
|
|
275
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
276
|
+
encapsulation: ViewEncapsulation.None,
|
|
277
|
+
providers: [{
|
|
278
|
+
provide: MAT_SLIDER_VISUAL_THUMB,
|
|
279
|
+
useExisting: MatSliderVisualThumb
|
|
280
|
+
}],
|
|
281
|
+
imports: [MatRipple],
|
|
282
|
+
template: "@if (discrete) {\n <div class=\"mdc-slider__value-indicator-container\" #valueIndicatorContainer>\n <div class=\"mdc-slider__value-indicator\">\n <span class=\"mdc-slider__value-indicator-text\">{{valueIndicatorText}}</span>\n </div>\n </div>\n}\n<div class=\"mdc-slider__thumb-knob\" #knob></div>\n<div matRipple class=\"mat-focus-indicator\" [matRippleDisabled]=\"true\"></div>\n",
|
|
283
|
+
styles: [".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}\n"]
|
|
284
|
+
}]
|
|
285
|
+
}],
|
|
286
|
+
ctorParameters: () => [],
|
|
287
|
+
propDecorators: {
|
|
288
|
+
discrete: [{
|
|
289
|
+
type: Input
|
|
290
|
+
}],
|
|
291
|
+
thumbPosition: [{
|
|
292
|
+
type: Input
|
|
293
|
+
}],
|
|
294
|
+
valueIndicatorText: [{
|
|
295
|
+
type: Input
|
|
296
|
+
}],
|
|
297
|
+
_ripple: [{
|
|
298
|
+
type: ViewChild,
|
|
299
|
+
args: [MatRipple]
|
|
300
|
+
}],
|
|
301
|
+
_knob: [{
|
|
302
|
+
type: ViewChild,
|
|
303
|
+
args: ['knob']
|
|
304
|
+
}],
|
|
305
|
+
_valueIndicatorContainer: [{
|
|
306
|
+
type: ViewChild,
|
|
307
|
+
args: ['valueIndicatorContainer']
|
|
308
|
+
}]
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
class MatSlider {
|
|
313
|
+
_ngZone = inject(NgZone);
|
|
314
|
+
_cdr = inject(ChangeDetectorRef);
|
|
315
|
+
_elementRef = inject(ElementRef);
|
|
316
|
+
_dir = inject(Directionality, {
|
|
317
|
+
optional: true
|
|
318
|
+
});
|
|
319
|
+
_globalRippleOptions = inject(MAT_RIPPLE_GLOBAL_OPTIONS, {
|
|
320
|
+
optional: true
|
|
321
|
+
});
|
|
322
|
+
_trackActive;
|
|
323
|
+
_thumbs;
|
|
324
|
+
_input;
|
|
325
|
+
_inputs;
|
|
326
|
+
get disabled() {
|
|
327
|
+
return this._disabled;
|
|
328
|
+
}
|
|
329
|
+
set disabled(v) {
|
|
330
|
+
this._disabled = v;
|
|
331
|
+
const endInput = this._getInput(_MatThumb.END);
|
|
332
|
+
const startInput = this._getInput(_MatThumb.START);
|
|
333
|
+
if (endInput) {
|
|
334
|
+
endInput.disabled = this._disabled;
|
|
335
|
+
}
|
|
336
|
+
if (startInput) {
|
|
337
|
+
startInput.disabled = this._disabled;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
_disabled = false;
|
|
341
|
+
get discrete() {
|
|
342
|
+
return this._discrete;
|
|
343
|
+
}
|
|
344
|
+
set discrete(v) {
|
|
345
|
+
this._discrete = v;
|
|
346
|
+
this._updateValueIndicatorUIs();
|
|
347
|
+
}
|
|
348
|
+
_discrete = false;
|
|
349
|
+
get showTickMarks() {
|
|
350
|
+
return this._showTickMarks;
|
|
351
|
+
}
|
|
352
|
+
set showTickMarks(value) {
|
|
353
|
+
this._showTickMarks = value;
|
|
354
|
+
if (this._hasViewInitialized) {
|
|
355
|
+
this._updateTickMarkUI();
|
|
356
|
+
this._updateTickMarkTrackUI();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
_showTickMarks = false;
|
|
360
|
+
get min() {
|
|
361
|
+
return this._min;
|
|
362
|
+
}
|
|
363
|
+
set min(v) {
|
|
364
|
+
const min = v === undefined || v === null || isNaN(v) ? this._min : v;
|
|
365
|
+
if (this._min !== min) {
|
|
366
|
+
this._updateMin(min);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
_min = 0;
|
|
370
|
+
color;
|
|
371
|
+
disableRipple = false;
|
|
372
|
+
_updateMin(min) {
|
|
373
|
+
const prevMin = this._min;
|
|
374
|
+
this._min = min;
|
|
375
|
+
this._isRange ? this._updateMinRange({
|
|
376
|
+
old: prevMin,
|
|
377
|
+
new: min
|
|
378
|
+
}) : this._updateMinNonRange(min);
|
|
379
|
+
this._onMinMaxOrStepChange();
|
|
380
|
+
}
|
|
381
|
+
_updateMinRange(min) {
|
|
382
|
+
const endInput = this._getInput(_MatThumb.END);
|
|
383
|
+
const startInput = this._getInput(_MatThumb.START);
|
|
384
|
+
const oldEndValue = endInput.value;
|
|
385
|
+
const oldStartValue = startInput.value;
|
|
386
|
+
startInput.min = min.new;
|
|
387
|
+
endInput.min = Math.max(min.new, startInput.value);
|
|
388
|
+
startInput.max = Math.min(endInput.max, endInput.value);
|
|
389
|
+
startInput._updateWidthInactive();
|
|
390
|
+
endInput._updateWidthInactive();
|
|
391
|
+
min.new < min.old ? this._onTranslateXChangeBySideEffect(endInput, startInput) : this._onTranslateXChangeBySideEffect(startInput, endInput);
|
|
392
|
+
if (oldEndValue !== endInput.value) {
|
|
393
|
+
this._onValueChange(endInput);
|
|
394
|
+
}
|
|
395
|
+
if (oldStartValue !== startInput.value) {
|
|
396
|
+
this._onValueChange(startInput);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
_updateMinNonRange(min) {
|
|
400
|
+
const input = this._getInput(_MatThumb.END);
|
|
401
|
+
if (input) {
|
|
402
|
+
const oldValue = input.value;
|
|
403
|
+
input.min = min;
|
|
404
|
+
input._updateThumbUIByValue();
|
|
405
|
+
this._updateTrackUI(input);
|
|
406
|
+
if (oldValue !== input.value) {
|
|
407
|
+
this._onValueChange(input);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
get max() {
|
|
412
|
+
return this._max;
|
|
413
|
+
}
|
|
414
|
+
set max(v) {
|
|
415
|
+
const max = v === undefined || v === null || isNaN(v) ? this._max : v;
|
|
416
|
+
if (this._max !== max) {
|
|
417
|
+
this._updateMax(max);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
_max = 100;
|
|
421
|
+
_updateMax(max) {
|
|
422
|
+
const prevMax = this._max;
|
|
423
|
+
this._max = max;
|
|
424
|
+
this._isRange ? this._updateMaxRange({
|
|
425
|
+
old: prevMax,
|
|
426
|
+
new: max
|
|
427
|
+
}) : this._updateMaxNonRange(max);
|
|
428
|
+
this._onMinMaxOrStepChange();
|
|
429
|
+
}
|
|
430
|
+
_updateMaxRange(max) {
|
|
431
|
+
const endInput = this._getInput(_MatThumb.END);
|
|
432
|
+
const startInput = this._getInput(_MatThumb.START);
|
|
433
|
+
const oldEndValue = endInput.value;
|
|
434
|
+
const oldStartValue = startInput.value;
|
|
435
|
+
endInput.max = max.new;
|
|
436
|
+
startInput.max = Math.min(max.new, endInput.value);
|
|
437
|
+
endInput.min = startInput.value;
|
|
438
|
+
endInput._updateWidthInactive();
|
|
439
|
+
startInput._updateWidthInactive();
|
|
440
|
+
max.new > max.old ? this._onTranslateXChangeBySideEffect(startInput, endInput) : this._onTranslateXChangeBySideEffect(endInput, startInput);
|
|
441
|
+
if (oldEndValue !== endInput.value) {
|
|
442
|
+
this._onValueChange(endInput);
|
|
443
|
+
}
|
|
444
|
+
if (oldStartValue !== startInput.value) {
|
|
445
|
+
this._onValueChange(startInput);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
_updateMaxNonRange(max) {
|
|
449
|
+
const input = this._getInput(_MatThumb.END);
|
|
450
|
+
if (input) {
|
|
451
|
+
const oldValue = input.value;
|
|
452
|
+
input.max = max;
|
|
453
|
+
input._updateThumbUIByValue();
|
|
454
|
+
this._updateTrackUI(input);
|
|
455
|
+
if (oldValue !== input.value) {
|
|
456
|
+
this._onValueChange(input);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
get step() {
|
|
461
|
+
return this._step;
|
|
462
|
+
}
|
|
463
|
+
set step(v) {
|
|
464
|
+
const step = isNaN(v) ? this._step : v;
|
|
465
|
+
if (this._step !== step) {
|
|
466
|
+
this._updateStep(step);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
_step = 1;
|
|
470
|
+
_updateStep(step) {
|
|
471
|
+
this._step = step;
|
|
472
|
+
this._isRange ? this._updateStepRange() : this._updateStepNonRange();
|
|
473
|
+
this._onMinMaxOrStepChange();
|
|
474
|
+
}
|
|
475
|
+
_updateStepRange() {
|
|
476
|
+
const endInput = this._getInput(_MatThumb.END);
|
|
477
|
+
const startInput = this._getInput(_MatThumb.START);
|
|
478
|
+
const oldEndValue = endInput.value;
|
|
479
|
+
const oldStartValue = startInput.value;
|
|
480
|
+
const prevStartValue = startInput.value;
|
|
481
|
+
endInput.min = this._min;
|
|
482
|
+
startInput.max = this._max;
|
|
483
|
+
endInput.step = this._step;
|
|
484
|
+
startInput.step = this._step;
|
|
485
|
+
if (this._platform.SAFARI) {
|
|
486
|
+
endInput.value = endInput.value;
|
|
487
|
+
startInput.value = startInput.value;
|
|
488
|
+
}
|
|
489
|
+
endInput.min = Math.max(this._min, startInput.value);
|
|
490
|
+
startInput.max = Math.min(this._max, endInput.value);
|
|
491
|
+
startInput._updateWidthInactive();
|
|
492
|
+
endInput._updateWidthInactive();
|
|
493
|
+
endInput.value < prevStartValue ? this._onTranslateXChangeBySideEffect(startInput, endInput) : this._onTranslateXChangeBySideEffect(endInput, startInput);
|
|
494
|
+
if (oldEndValue !== endInput.value) {
|
|
495
|
+
this._onValueChange(endInput);
|
|
496
|
+
}
|
|
497
|
+
if (oldStartValue !== startInput.value) {
|
|
498
|
+
this._onValueChange(startInput);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
_updateStepNonRange() {
|
|
502
|
+
const input = this._getInput(_MatThumb.END);
|
|
503
|
+
if (input) {
|
|
504
|
+
const oldValue = input.value;
|
|
505
|
+
input.step = this._step;
|
|
506
|
+
if (this._platform.SAFARI) {
|
|
507
|
+
input.value = input.value;
|
|
508
|
+
}
|
|
509
|
+
input._updateThumbUIByValue();
|
|
510
|
+
if (oldValue !== input.value) {
|
|
511
|
+
this._onValueChange(input);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
displayWith = value => `${value}`;
|
|
516
|
+
_tickMarks;
|
|
517
|
+
_noopAnimations = _animationsDisabled();
|
|
518
|
+
_dirChangeSubscription;
|
|
519
|
+
_resizeObserver = null;
|
|
520
|
+
_cachedWidth;
|
|
521
|
+
_cachedLeft;
|
|
522
|
+
_rippleRadius = 24;
|
|
523
|
+
startValueIndicatorText = '';
|
|
524
|
+
endValueIndicatorText = '';
|
|
525
|
+
_endThumbTransform;
|
|
526
|
+
_startThumbTransform;
|
|
527
|
+
_isRange = false;
|
|
528
|
+
_isRtl = false;
|
|
529
|
+
_hasViewInitialized = false;
|
|
530
|
+
_tickMarkTrackWidth = 0;
|
|
531
|
+
_hasAnimation = false;
|
|
532
|
+
_resizeTimer = null;
|
|
533
|
+
_platform = inject(Platform);
|
|
534
|
+
constructor() {
|
|
535
|
+
inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
|
|
536
|
+
if (this._dir) {
|
|
537
|
+
this._dirChangeSubscription = this._dir.change.subscribe(() => this._onDirChange());
|
|
538
|
+
this._isRtl = this._dir.value === 'rtl';
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
_knobRadius = 8;
|
|
542
|
+
_inputPadding;
|
|
543
|
+
ngAfterViewInit() {
|
|
544
|
+
if (this._platform.isBrowser) {
|
|
545
|
+
this._updateDimensions();
|
|
546
|
+
}
|
|
547
|
+
const eInput = this._getInput(_MatThumb.END);
|
|
548
|
+
const sInput = this._getInput(_MatThumb.START);
|
|
549
|
+
this._isRange = !!eInput && !!sInput;
|
|
550
|
+
this._cdr.detectChanges();
|
|
551
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
552
|
+
_validateInputs(this._isRange, this._getInput(_MatThumb.END), this._getInput(_MatThumb.START));
|
|
553
|
+
}
|
|
554
|
+
const thumb = this._getThumb(_MatThumb.END);
|
|
555
|
+
this._rippleRadius = thumb._ripple.radius;
|
|
556
|
+
this._inputPadding = this._rippleRadius - this._knobRadius;
|
|
557
|
+
this._isRange ? this._initUIRange(eInput, sInput) : this._initUINonRange(eInput);
|
|
558
|
+
this._updateTrackUI(eInput);
|
|
559
|
+
this._updateTickMarkUI();
|
|
560
|
+
this._updateTickMarkTrackUI();
|
|
561
|
+
this._observeHostResize();
|
|
562
|
+
this._cdr.detectChanges();
|
|
563
|
+
}
|
|
564
|
+
_initUINonRange(eInput) {
|
|
565
|
+
eInput.initProps();
|
|
566
|
+
eInput.initUI();
|
|
567
|
+
this._updateValueIndicatorUI(eInput);
|
|
568
|
+
this._hasViewInitialized = true;
|
|
569
|
+
eInput._updateThumbUIByValue();
|
|
570
|
+
}
|
|
571
|
+
_initUIRange(eInput, sInput) {
|
|
572
|
+
eInput.initProps();
|
|
573
|
+
eInput.initUI();
|
|
574
|
+
sInput.initProps();
|
|
575
|
+
sInput.initUI();
|
|
576
|
+
eInput._updateMinMax();
|
|
577
|
+
sInput._updateMinMax();
|
|
578
|
+
eInput._updateStaticStyles();
|
|
579
|
+
sInput._updateStaticStyles();
|
|
580
|
+
this._updateValueIndicatorUIs();
|
|
581
|
+
this._hasViewInitialized = true;
|
|
582
|
+
eInput._updateThumbUIByValue();
|
|
583
|
+
sInput._updateThumbUIByValue();
|
|
584
|
+
}
|
|
585
|
+
ngOnDestroy() {
|
|
586
|
+
this._dirChangeSubscription?.unsubscribe();
|
|
587
|
+
this._resizeObserver?.disconnect();
|
|
588
|
+
this._resizeObserver = null;
|
|
589
|
+
}
|
|
590
|
+
_onDirChange() {
|
|
591
|
+
this._isRtl = this._dir?.value === 'rtl';
|
|
592
|
+
this._isRange ? this._onDirChangeRange() : this._onDirChangeNonRange();
|
|
593
|
+
this._updateTickMarkUI();
|
|
594
|
+
}
|
|
595
|
+
_onDirChangeRange() {
|
|
596
|
+
const endInput = this._getInput(_MatThumb.END);
|
|
597
|
+
const startInput = this._getInput(_MatThumb.START);
|
|
598
|
+
endInput._setIsLeftThumb();
|
|
599
|
+
startInput._setIsLeftThumb();
|
|
600
|
+
endInput.translateX = endInput._calcTranslateXByValue();
|
|
601
|
+
startInput.translateX = startInput._calcTranslateXByValue();
|
|
602
|
+
endInput._updateStaticStyles();
|
|
603
|
+
startInput._updateStaticStyles();
|
|
604
|
+
endInput._updateWidthInactive();
|
|
605
|
+
startInput._updateWidthInactive();
|
|
606
|
+
endInput._updateThumbUIByValue();
|
|
607
|
+
startInput._updateThumbUIByValue();
|
|
608
|
+
}
|
|
609
|
+
_onDirChangeNonRange() {
|
|
610
|
+
const input = this._getInput(_MatThumb.END);
|
|
611
|
+
input._updateThumbUIByValue();
|
|
612
|
+
}
|
|
613
|
+
_observeHostResize() {
|
|
614
|
+
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
this._ngZone.runOutsideAngular(() => {
|
|
618
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
619
|
+
if (this._isActive()) {
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
if (this._resizeTimer) {
|
|
623
|
+
clearTimeout(this._resizeTimer);
|
|
624
|
+
}
|
|
625
|
+
this._onResize();
|
|
626
|
+
});
|
|
627
|
+
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
_isActive() {
|
|
631
|
+
return this._getThumb(_MatThumb.START)._isActive || this._getThumb(_MatThumb.END)._isActive;
|
|
632
|
+
}
|
|
633
|
+
_getValue(thumbPosition = _MatThumb.END) {
|
|
634
|
+
const input = this._getInput(thumbPosition);
|
|
635
|
+
if (!input) {
|
|
636
|
+
return this.min;
|
|
637
|
+
}
|
|
638
|
+
return input.value;
|
|
639
|
+
}
|
|
640
|
+
_skipUpdate() {
|
|
641
|
+
return !!(this._getInput(_MatThumb.START)?._skipUIUpdate || this._getInput(_MatThumb.END)?._skipUIUpdate);
|
|
642
|
+
}
|
|
643
|
+
_updateDimensions() {
|
|
644
|
+
this._cachedWidth = this._elementRef.nativeElement.offsetWidth;
|
|
645
|
+
this._cachedLeft = this._elementRef.nativeElement.getBoundingClientRect().left;
|
|
646
|
+
}
|
|
647
|
+
_setTrackActiveStyles(styles) {
|
|
648
|
+
const trackStyle = this._trackActive.nativeElement.style;
|
|
649
|
+
trackStyle.left = styles.left;
|
|
650
|
+
trackStyle.right = styles.right;
|
|
651
|
+
trackStyle.transformOrigin = styles.transformOrigin;
|
|
652
|
+
trackStyle.transform = styles.transform;
|
|
653
|
+
}
|
|
654
|
+
_calcTickMarkTransform(index) {
|
|
655
|
+
const offset = index * (this._tickMarkTrackWidth / (this._tickMarks.length - 1));
|
|
656
|
+
const translateX = this._isRtl ? this._cachedWidth - 6 - offset : offset;
|
|
657
|
+
return `translateX(${translateX}px)`;
|
|
658
|
+
}
|
|
659
|
+
_onTranslateXChange(source) {
|
|
660
|
+
if (!this._hasViewInitialized) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
this._updateThumbUI(source);
|
|
664
|
+
this._updateTrackUI(source);
|
|
665
|
+
this._updateOverlappingThumbUI(source);
|
|
666
|
+
}
|
|
667
|
+
_onTranslateXChangeBySideEffect(input1, input2) {
|
|
668
|
+
if (!this._hasViewInitialized) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
input1._updateThumbUIByValue();
|
|
672
|
+
input2._updateThumbUIByValue();
|
|
673
|
+
}
|
|
674
|
+
_onValueChange(source) {
|
|
675
|
+
if (!this._hasViewInitialized) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
this._updateValueIndicatorUI(source);
|
|
679
|
+
this._updateTickMarkUI();
|
|
680
|
+
this._cdr.detectChanges();
|
|
681
|
+
}
|
|
682
|
+
_onMinMaxOrStepChange() {
|
|
683
|
+
if (!this._hasViewInitialized) {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
this._updateTickMarkUI();
|
|
687
|
+
this._updateTickMarkTrackUI();
|
|
688
|
+
this._cdr.markForCheck();
|
|
689
|
+
}
|
|
690
|
+
_onResize() {
|
|
691
|
+
if (!this._hasViewInitialized) {
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
this._updateDimensions();
|
|
695
|
+
if (this._isRange) {
|
|
696
|
+
const eInput = this._getInput(_MatThumb.END);
|
|
697
|
+
const sInput = this._getInput(_MatThumb.START);
|
|
698
|
+
eInput._updateThumbUIByValue();
|
|
699
|
+
sInput._updateThumbUIByValue();
|
|
700
|
+
eInput._updateStaticStyles();
|
|
701
|
+
sInput._updateStaticStyles();
|
|
702
|
+
eInput._updateMinMax();
|
|
703
|
+
sInput._updateMinMax();
|
|
704
|
+
eInput._updateWidthInactive();
|
|
705
|
+
sInput._updateWidthInactive();
|
|
706
|
+
} else {
|
|
707
|
+
const eInput = this._getInput(_MatThumb.END);
|
|
708
|
+
if (eInput) {
|
|
709
|
+
eInput._updateThumbUIByValue();
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
this._updateTickMarkUI();
|
|
713
|
+
this._updateTickMarkTrackUI();
|
|
714
|
+
this._cdr.detectChanges();
|
|
715
|
+
}
|
|
716
|
+
_thumbsOverlap = false;
|
|
717
|
+
_areThumbsOverlapping() {
|
|
718
|
+
const startInput = this._getInput(_MatThumb.START);
|
|
719
|
+
const endInput = this._getInput(_MatThumb.END);
|
|
720
|
+
if (!startInput || !endInput) {
|
|
721
|
+
return false;
|
|
722
|
+
}
|
|
723
|
+
return endInput.translateX - startInput.translateX < 20;
|
|
724
|
+
}
|
|
725
|
+
_updateOverlappingThumbClassNames(source) {
|
|
726
|
+
const sibling = source.getSibling();
|
|
727
|
+
const sourceThumb = this._getThumb(source.thumbPosition);
|
|
728
|
+
const siblingThumb = this._getThumb(sibling.thumbPosition);
|
|
729
|
+
siblingThumb._hostElement.classList.remove('mdc-slider__thumb--top');
|
|
730
|
+
sourceThumb._hostElement.classList.toggle('mdc-slider__thumb--top', this._thumbsOverlap);
|
|
731
|
+
}
|
|
732
|
+
_updateOverlappingThumbUI(source) {
|
|
733
|
+
if (!this._isRange || this._skipUpdate()) {
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
if (this._thumbsOverlap !== this._areThumbsOverlapping()) {
|
|
737
|
+
this._thumbsOverlap = !this._thumbsOverlap;
|
|
738
|
+
this._updateOverlappingThumbClassNames(source);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
_updateThumbUI(source) {
|
|
742
|
+
if (this._skipUpdate()) {
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
const thumb = this._getThumb(source.thumbPosition === _MatThumb.END ? _MatThumb.END : _MatThumb.START);
|
|
746
|
+
thumb._hostElement.style.transform = `translateX(${source.translateX}px)`;
|
|
747
|
+
}
|
|
748
|
+
_updateValueIndicatorUI(source) {
|
|
749
|
+
if (this._skipUpdate()) {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const valuetext = this.displayWith(source.value);
|
|
753
|
+
this._hasViewInitialized ? source._valuetext.set(valuetext) : source._hostElement.setAttribute('aria-valuetext', valuetext);
|
|
754
|
+
if (this.discrete) {
|
|
755
|
+
source.thumbPosition === _MatThumb.START ? this.startValueIndicatorText = valuetext : this.endValueIndicatorText = valuetext;
|
|
756
|
+
const visualThumb = this._getThumb(source.thumbPosition);
|
|
757
|
+
valuetext.length < 3 ? visualThumb._hostElement.classList.add('mdc-slider__thumb--short-value') : visualThumb._hostElement.classList.remove('mdc-slider__thumb--short-value');
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
_updateValueIndicatorUIs() {
|
|
761
|
+
const eInput = this._getInput(_MatThumb.END);
|
|
762
|
+
const sInput = this._getInput(_MatThumb.START);
|
|
763
|
+
if (eInput) {
|
|
764
|
+
this._updateValueIndicatorUI(eInput);
|
|
765
|
+
}
|
|
766
|
+
if (sInput) {
|
|
767
|
+
this._updateValueIndicatorUI(sInput);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
_updateTickMarkTrackUI() {
|
|
771
|
+
if (!this.showTickMarks || this._skipUpdate()) {
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
const step = this._step && this._step > 0 ? this._step : 1;
|
|
775
|
+
const maxValue = Math.floor(this.max / step) * step;
|
|
776
|
+
const percentage = (maxValue - this.min) / (this.max - this.min);
|
|
777
|
+
this._tickMarkTrackWidth = (this._cachedWidth - 6) * percentage;
|
|
778
|
+
}
|
|
779
|
+
_updateTrackUI(source) {
|
|
780
|
+
if (this._skipUpdate()) {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
this._isRange ? this._updateTrackUIRange(source) : this._updateTrackUINonRange(source);
|
|
784
|
+
}
|
|
785
|
+
_updateTrackUIRange(source) {
|
|
786
|
+
const sibling = source.getSibling();
|
|
787
|
+
if (!sibling || !this._cachedWidth) {
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
const activePercentage = Math.abs(sibling.translateX - source.translateX) / this._cachedWidth;
|
|
791
|
+
if (source._isLeftThumb && this._cachedWidth) {
|
|
792
|
+
this._setTrackActiveStyles({
|
|
793
|
+
left: 'auto',
|
|
794
|
+
right: `${this._cachedWidth - sibling.translateX}px`,
|
|
795
|
+
transformOrigin: 'right',
|
|
796
|
+
transform: `scaleX(${activePercentage})`
|
|
797
|
+
});
|
|
798
|
+
} else {
|
|
799
|
+
this._setTrackActiveStyles({
|
|
800
|
+
left: `${sibling.translateX}px`,
|
|
801
|
+
right: 'auto',
|
|
802
|
+
transformOrigin: 'left',
|
|
803
|
+
transform: `scaleX(${activePercentage})`
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
_updateTrackUINonRange(source) {
|
|
808
|
+
this._isRtl ? this._setTrackActiveStyles({
|
|
809
|
+
left: 'auto',
|
|
810
|
+
right: '0px',
|
|
811
|
+
transformOrigin: 'right',
|
|
812
|
+
transform: `scaleX(${1 - source.fillPercentage})`
|
|
813
|
+
}) : this._setTrackActiveStyles({
|
|
814
|
+
left: '0px',
|
|
815
|
+
right: 'auto',
|
|
816
|
+
transformOrigin: 'left',
|
|
817
|
+
transform: `scaleX(${source.fillPercentage})`
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
_updateTickMarkUI() {
|
|
821
|
+
if (!this.showTickMarks || this.step === undefined || this.min === undefined || this.max === undefined) {
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
const step = this.step > 0 ? this.step : 1;
|
|
825
|
+
this._isRange ? this._updateTickMarkUIRange(step) : this._updateTickMarkUINonRange(step);
|
|
826
|
+
}
|
|
827
|
+
_updateTickMarkUINonRange(step) {
|
|
828
|
+
const value = this._getValue();
|
|
829
|
+
let numActive = Math.max(Math.round((value - this.min) / step), 0) + 1;
|
|
830
|
+
let numInactive = Math.max(Math.round((this.max - value) / step), 0) - 1;
|
|
831
|
+
this._isRtl ? numActive++ : numInactive++;
|
|
832
|
+
this._tickMarks = Array(numActive).fill(_MatTickMark.ACTIVE).concat(Array(numInactive).fill(_MatTickMark.INACTIVE));
|
|
833
|
+
}
|
|
834
|
+
_updateTickMarkUIRange(step) {
|
|
835
|
+
const endValue = this._getValue();
|
|
836
|
+
const startValue = this._getValue(_MatThumb.START);
|
|
837
|
+
const numInactiveBeforeStartThumb = Math.max(Math.round((startValue - this.min) / step), 0);
|
|
838
|
+
const numActive = Math.max(Math.round((endValue - startValue) / step) + 1, 0);
|
|
839
|
+
const numInactiveAfterEndThumb = Math.max(Math.round((this.max - endValue) / step), 0);
|
|
840
|
+
this._tickMarks = Array(numInactiveBeforeStartThumb).fill(_MatTickMark.INACTIVE).concat(Array(numActive).fill(_MatTickMark.ACTIVE), Array(numInactiveAfterEndThumb).fill(_MatTickMark.INACTIVE));
|
|
841
|
+
}
|
|
842
|
+
_getInput(thumbPosition) {
|
|
843
|
+
if (thumbPosition === _MatThumb.END && this._input) {
|
|
844
|
+
return this._input;
|
|
845
|
+
}
|
|
846
|
+
if (this._inputs?.length) {
|
|
847
|
+
return thumbPosition === _MatThumb.START ? this._inputs.first : this._inputs.last;
|
|
848
|
+
}
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
_getThumb(thumbPosition) {
|
|
852
|
+
return thumbPosition === _MatThumb.END ? this._thumbs?.last : this._thumbs?.first;
|
|
853
|
+
}
|
|
854
|
+
_setTransition(withAnimation) {
|
|
855
|
+
this._hasAnimation = !this._platform.IOS && withAnimation && !this._noopAnimations;
|
|
856
|
+
this._elementRef.nativeElement.classList.toggle('mat-mdc-slider-with-animation', this._hasAnimation);
|
|
857
|
+
}
|
|
858
|
+
_isCursorOnSliderThumb(event, rect) {
|
|
859
|
+
const radius = rect.width / 2;
|
|
860
|
+
const centerX = rect.x + radius;
|
|
861
|
+
const centerY = rect.y + radius;
|
|
862
|
+
const dx = event.clientX - centerX;
|
|
863
|
+
const dy = event.clientY - centerY;
|
|
864
|
+
return Math.pow(dx, 2) + Math.pow(dy, 2) < Math.pow(radius, 2);
|
|
865
|
+
}
|
|
866
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
867
|
+
minVersion: "12.0.0",
|
|
868
|
+
version: "22.0.0-next.1",
|
|
869
|
+
ngImport: i0,
|
|
870
|
+
type: MatSlider,
|
|
871
|
+
deps: [],
|
|
872
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
873
|
+
});
|
|
874
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
875
|
+
minVersion: "17.0.0",
|
|
876
|
+
version: "22.0.0-next.1",
|
|
877
|
+
type: MatSlider,
|
|
878
|
+
isStandalone: true,
|
|
879
|
+
selector: "mat-slider",
|
|
880
|
+
inputs: {
|
|
881
|
+
disabled: ["disabled", "disabled", booleanAttribute],
|
|
882
|
+
discrete: ["discrete", "discrete", booleanAttribute],
|
|
883
|
+
showTickMarks: ["showTickMarks", "showTickMarks", booleanAttribute],
|
|
884
|
+
min: ["min", "min", numberAttribute],
|
|
885
|
+
color: "color",
|
|
886
|
+
disableRipple: ["disableRipple", "disableRipple", booleanAttribute],
|
|
887
|
+
max: ["max", "max", numberAttribute],
|
|
888
|
+
step: ["step", "step", numberAttribute],
|
|
889
|
+
displayWith: "displayWith"
|
|
890
|
+
},
|
|
891
|
+
host: {
|
|
892
|
+
properties: {
|
|
893
|
+
"class": "\"mat-\" + (color || \"primary\")",
|
|
894
|
+
"class.mdc-slider--range": "_isRange",
|
|
895
|
+
"class.mdc-slider--disabled": "disabled",
|
|
896
|
+
"class.mdc-slider--discrete": "discrete",
|
|
897
|
+
"class.mdc-slider--tick-marks": "showTickMarks",
|
|
898
|
+
"class._mat-animation-noopable": "_noopAnimations"
|
|
899
|
+
},
|
|
900
|
+
classAttribute: "mat-mdc-slider mdc-slider"
|
|
901
|
+
},
|
|
902
|
+
providers: [{
|
|
903
|
+
provide: MAT_SLIDER,
|
|
904
|
+
useExisting: MatSlider
|
|
905
|
+
}],
|
|
906
|
+
queries: [{
|
|
907
|
+
propertyName: "_input",
|
|
908
|
+
first: true,
|
|
909
|
+
predicate: MAT_SLIDER_THUMB,
|
|
910
|
+
descendants: true
|
|
911
|
+
}, {
|
|
912
|
+
propertyName: "_inputs",
|
|
913
|
+
predicate: MAT_SLIDER_RANGE_THUMB
|
|
914
|
+
}],
|
|
915
|
+
viewQueries: [{
|
|
916
|
+
propertyName: "_trackActive",
|
|
917
|
+
first: true,
|
|
918
|
+
predicate: ["trackActive"],
|
|
919
|
+
descendants: true
|
|
920
|
+
}, {
|
|
921
|
+
propertyName: "_thumbs",
|
|
922
|
+
predicate: MAT_SLIDER_VISUAL_THUMB,
|
|
923
|
+
descendants: true
|
|
924
|
+
}],
|
|
925
|
+
exportAs: ["matSlider"],
|
|
926
|
+
ngImport: i0,
|
|
927
|
+
template: "<!-- Inputs -->\n<ng-content></ng-content>\n\n<!-- Track -->\n<div class=\"mdc-slider__track\">\n <div class=\"mdc-slider__track--inactive\"></div>\n <div class=\"mdc-slider__track--active\">\n <div #trackActive class=\"mdc-slider__track--active_fill\"></div>\n </div>\n @if (showTickMarks) {\n <div class=\"mdc-slider__tick-marks\" #tickMarkContainer>\n @if (_cachedWidth) {\n @for (tickMark of _tickMarks; track i; let i = $index) {\n <div\n [class]=\"tickMark === 0 ? 'mdc-slider__tick-mark--active' : 'mdc-slider__tick-mark--inactive'\"\n [style.transform]=\"_calcTickMarkTransform(i)\"></div>\n }\n }\n </div>\n }\n</div>\n\n<!-- Thumbs -->\n@if (_isRange) {\n <mat-slider-visual-thumb\n [discrete]=\"discrete\"\n [thumbPosition]=\"1\"\n [valueIndicatorText]=\"startValueIndicatorText\">\n </mat-slider-visual-thumb>\n}\n\n<mat-slider-visual-thumb\n [discrete]=\"discrete\"\n [thumbPosition]=\"2\"\n [valueIndicatorText]=\"endValueIndicatorText\">\n</mat-slider-visual-thumb>\n",
|
|
928
|
+
styles: [".mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%;pointer-events:none;height:var(--mat-slider-inactive-track-height, 4px)}.mdc-slider__track--active,.mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider__track--active{overflow:hidden;border-radius:var(--mat-slider-active-track-shape, var(--mat-sys-corner-full));height:var(--mat-slider-active-track-height, 4px);top:calc((var(--mat-slider-inactive-track-height, 4px) - var(--mat-slider-active-track-height, 4px))/2)}.mdc-slider__track--active_fill{border-top-style:solid;box-sizing:border-box;height:100%;width:100%;position:relative;transform-origin:left;transition:transform 80ms ease;border-color:var(--mat-slider-active-track-color, var(--mat-sys-primary));border-top-width:var(--mat-slider-active-track-height, 4px)}.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mat-slider-disabled-active-track-color, var(--mat-sys-on-surface))}[dir=rtl] .mdc-slider__track--active_fill{-webkit-transform-origin:right;transform-origin:right}.mdc-slider__track--inactive{left:0;top:0;opacity:.24;background-color:var(--mat-slider-inactive-track-color, var(--mat-sys-surface-variant));height:var(--mat-slider-inactive-track-height, 4px);border-radius:var(--mat-slider-inactive-track-shape, var(--mat-sys-corner-full))}.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mat-slider-disabled-inactive-track-color, var(--mat-sys-on-surface));opacity:.24}.mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media(forced-colors: active){.mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider__value-indicator-container{bottom:44px;left:50%;pointer-events:none;position:absolute;transform:var(--mat-slider-value-indicator-container-transform, translateX(-50%) rotate(-45deg))}.mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider__value-indicator{display:flex;align-items:center;transform:scale(0);transform-origin:var(--mat-slider-value-indicator-transform-origin, 0 28px);transition:transform 100ms cubic-bezier(0.4, 0, 1, 1);word-break:normal;background-color:var(--mat-slider-label-container-color, var(--mat-sys-primary));color:var(--mat-slider-label-label-text-color, var(--mat-sys-on-primary));width:var(--mat-slider-value-indicator-width, 28px);height:var(--mat-slider-value-indicator-height, 28px);padding:var(--mat-slider-value-indicator-padding, 0);opacity:var(--mat-slider-value-indicator-opacity, 1);border-radius:var(--mat-slider-value-indicator-border-radius, 50% 50% 50% 0)}.mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}.mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:\"\";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;display:var(--mat-slider-value-indicator-caret-display, none);border-top-color:var(--mat-slider-label-container-color, var(--mat-sys-primary))}.mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media(forced-colors: active){.mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider__value-indicator-text{text-align:center;width:var(--mat-slider-value-indicator-width, 28px);transform:var(--mat-slider-value-indicator-text-transform, rotate(45deg));font-family:var(--mat-slider-label-label-text-font, var(--mat-sys-label-medium-font));font-size:var(--mat-slider-label-label-text-size, var(--mat-sys-label-medium-size));font-weight:var(--mat-slider-label-label-text-weight, var(--mat-sys-label-medium-weight));line-height:var(--mat-slider-label-label-text-line-height, var(--mat-sys-label-medium-line-height));letter-spacing:var(--mat-slider-label-label-text-tracking, var(--mat-sys-label-medium-tracking))}.mdc-slider__thumb{-webkit-user-select:none;user-select:none;display:flex;left:-24px;outline:none;position:absolute;height:48px;width:48px;pointer-events:none}.mdc-slider--discrete .mdc-slider__thumb{transition:transform 80ms ease}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__thumb--top{z-index:1}.mdc-slider__thumb-knob{position:absolute;box-sizing:border-box;left:50%;top:50%;transform:translate(-50%, -50%);border-style:solid;width:var(--mat-slider-handle-width, 20px);height:var(--mat-slider-handle-height, 20px);border-width:calc(var(--mat-slider-handle-height, 20px)/2) calc(var(--mat-slider-handle-width, 20px)/2);box-shadow:var(--mat-slider-handle-elevation, var(--mat-sys-level1));background-color:var(--mat-slider-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-handle-color, var(--mat-sys-primary));border-radius:var(--mat-slider-handle-shape, var(--mat-sys-corner-full))}.mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mat-slider-hover-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-hover-handle-color, var(--mat-sys-primary))}.mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mat-slider-focus-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-focus-handle-color, var(--mat-sys-primary))}.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mat-slider-disabled-handle-color, var(--mat-sys-on-surface));border-color:var(--mat-slider-disabled-handle-color, var(--mat-sys-on-surface))}.mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border:solid 1px #fff;box-sizing:content-box;border-color:var(--mat-slider-with-overlap-handle-outline-color, var(--mat-sys-on-primary));border-width:var(--mat-slider-with-overlap-handle-outline-width, 1px)}.mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider__tick-mark--active,.mdc-slider__tick-mark--inactive{width:var(--mat-slider-with-tick-marks-container-size, 2px);height:var(--mat-slider-with-tick-marks-container-size, 2px);border-radius:var(--mat-slider-with-tick-marks-container-shape, var(--mat-sys-corner-full))}.mdc-slider__tick-mark--inactive{opacity:var(--mat-slider-with-tick-marks-inactive-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-inactive-container-color, var(--mat-sys-on-surface-variant))}.mdc-slider--disabled .mdc-slider__tick-mark--inactive{opacity:var(--mat-slider-with-tick-marks-inactive-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-disabled-container-color, var(--mat-sys-on-surface))}.mdc-slider__tick-mark--active{opacity:var(--mat-slider-with-tick-marks-active-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-active-container-color, var(--mat-sys-on-primary))}.mdc-slider__input{cursor:pointer;left:2px;margin:0;height:44px;opacity:0;position:absolute;top:2px;width:44px;box-sizing:content-box}.mdc-slider__input.mat-mdc-slider-input-no-pointer-events{pointer-events:none}.mdc-slider__input.mat-slider__right-input{left:auto;right:0}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;cursor:pointer;height:48px;margin:0 8px;position:relative;touch-action:pan-y;width:auto;min-width:112px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-slider.mdc-slider--disabled{cursor:auto;opacity:.38}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__input{cursor:auto}.mat-mdc-slider .mdc-slider__thumb,.mat-mdc-slider .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider.mdc-slider--discrete .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-slider-ripple-color, var(--mat-sys-primary))}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-slider-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-primary) 5%, transparent))}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-slider-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-focus-indicator::before{content:\"\"}\n"],
|
|
929
|
+
dependencies: [{
|
|
930
|
+
kind: "component",
|
|
931
|
+
type: MatSliderVisualThumb,
|
|
932
|
+
selector: "mat-slider-visual-thumb",
|
|
933
|
+
inputs: ["discrete", "thumbPosition", "valueIndicatorText"]
|
|
934
|
+
}],
|
|
935
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
936
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
940
|
+
minVersion: "12.0.0",
|
|
941
|
+
version: "22.0.0-next.1",
|
|
942
|
+
ngImport: i0,
|
|
943
|
+
type: MatSlider,
|
|
944
|
+
decorators: [{
|
|
945
|
+
type: Component,
|
|
946
|
+
args: [{
|
|
947
|
+
selector: 'mat-slider',
|
|
948
|
+
host: {
|
|
949
|
+
'class': 'mat-mdc-slider mdc-slider',
|
|
950
|
+
'[class]': '"mat-" + (color || "primary")',
|
|
951
|
+
'[class.mdc-slider--range]': '_isRange',
|
|
952
|
+
'[class.mdc-slider--disabled]': 'disabled',
|
|
953
|
+
'[class.mdc-slider--discrete]': 'discrete',
|
|
954
|
+
'[class.mdc-slider--tick-marks]': 'showTickMarks',
|
|
955
|
+
'[class._mat-animation-noopable]': '_noopAnimations'
|
|
956
|
+
},
|
|
957
|
+
exportAs: 'matSlider',
|
|
958
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
959
|
+
encapsulation: ViewEncapsulation.None,
|
|
960
|
+
providers: [{
|
|
961
|
+
provide: MAT_SLIDER,
|
|
962
|
+
useExisting: MatSlider
|
|
963
|
+
}],
|
|
964
|
+
imports: [MatSliderVisualThumb],
|
|
965
|
+
template: "<!-- Inputs -->\n<ng-content></ng-content>\n\n<!-- Track -->\n<div class=\"mdc-slider__track\">\n <div class=\"mdc-slider__track--inactive\"></div>\n <div class=\"mdc-slider__track--active\">\n <div #trackActive class=\"mdc-slider__track--active_fill\"></div>\n </div>\n @if (showTickMarks) {\n <div class=\"mdc-slider__tick-marks\" #tickMarkContainer>\n @if (_cachedWidth) {\n @for (tickMark of _tickMarks; track i; let i = $index) {\n <div\n [class]=\"tickMark === 0 ? 'mdc-slider__tick-mark--active' : 'mdc-slider__tick-mark--inactive'\"\n [style.transform]=\"_calcTickMarkTransform(i)\"></div>\n }\n }\n </div>\n }\n</div>\n\n<!-- Thumbs -->\n@if (_isRange) {\n <mat-slider-visual-thumb\n [discrete]=\"discrete\"\n [thumbPosition]=\"1\"\n [valueIndicatorText]=\"startValueIndicatorText\">\n </mat-slider-visual-thumb>\n}\n\n<mat-slider-visual-thumb\n [discrete]=\"discrete\"\n [thumbPosition]=\"2\"\n [valueIndicatorText]=\"endValueIndicatorText\">\n</mat-slider-visual-thumb>\n",
|
|
966
|
+
styles: [".mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%;pointer-events:none;height:var(--mat-slider-inactive-track-height, 4px)}.mdc-slider__track--active,.mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider__track--active{overflow:hidden;border-radius:var(--mat-slider-active-track-shape, var(--mat-sys-corner-full));height:var(--mat-slider-active-track-height, 4px);top:calc((var(--mat-slider-inactive-track-height, 4px) - var(--mat-slider-active-track-height, 4px))/2)}.mdc-slider__track--active_fill{border-top-style:solid;box-sizing:border-box;height:100%;width:100%;position:relative;transform-origin:left;transition:transform 80ms ease;border-color:var(--mat-slider-active-track-color, var(--mat-sys-primary));border-top-width:var(--mat-slider-active-track-height, 4px)}.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mat-slider-disabled-active-track-color, var(--mat-sys-on-surface))}[dir=rtl] .mdc-slider__track--active_fill{-webkit-transform-origin:right;transform-origin:right}.mdc-slider__track--inactive{left:0;top:0;opacity:.24;background-color:var(--mat-slider-inactive-track-color, var(--mat-sys-surface-variant));height:var(--mat-slider-inactive-track-height, 4px);border-radius:var(--mat-slider-inactive-track-shape, var(--mat-sys-corner-full))}.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mat-slider-disabled-inactive-track-color, var(--mat-sys-on-surface));opacity:.24}.mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media(forced-colors: active){.mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider__value-indicator-container{bottom:44px;left:50%;pointer-events:none;position:absolute;transform:var(--mat-slider-value-indicator-container-transform, translateX(-50%) rotate(-45deg))}.mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider__value-indicator{display:flex;align-items:center;transform:scale(0);transform-origin:var(--mat-slider-value-indicator-transform-origin, 0 28px);transition:transform 100ms cubic-bezier(0.4, 0, 1, 1);word-break:normal;background-color:var(--mat-slider-label-container-color, var(--mat-sys-primary));color:var(--mat-slider-label-label-text-color, var(--mat-sys-on-primary));width:var(--mat-slider-value-indicator-width, 28px);height:var(--mat-slider-value-indicator-height, 28px);padding:var(--mat-slider-value-indicator-padding, 0);opacity:var(--mat-slider-value-indicator-opacity, 1);border-radius:var(--mat-slider-value-indicator-border-radius, 50% 50% 50% 0)}.mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}.mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:\"\";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;display:var(--mat-slider-value-indicator-caret-display, none);border-top-color:var(--mat-slider-label-container-color, var(--mat-sys-primary))}.mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media(forced-colors: active){.mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider__value-indicator-text{text-align:center;width:var(--mat-slider-value-indicator-width, 28px);transform:var(--mat-slider-value-indicator-text-transform, rotate(45deg));font-family:var(--mat-slider-label-label-text-font, var(--mat-sys-label-medium-font));font-size:var(--mat-slider-label-label-text-size, var(--mat-sys-label-medium-size));font-weight:var(--mat-slider-label-label-text-weight, var(--mat-sys-label-medium-weight));line-height:var(--mat-slider-label-label-text-line-height, var(--mat-sys-label-medium-line-height));letter-spacing:var(--mat-slider-label-label-text-tracking, var(--mat-sys-label-medium-tracking))}.mdc-slider__thumb{-webkit-user-select:none;user-select:none;display:flex;left:-24px;outline:none;position:absolute;height:48px;width:48px;pointer-events:none}.mdc-slider--discrete .mdc-slider__thumb{transition:transform 80ms ease}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__thumb--top{z-index:1}.mdc-slider__thumb-knob{position:absolute;box-sizing:border-box;left:50%;top:50%;transform:translate(-50%, -50%);border-style:solid;width:var(--mat-slider-handle-width, 20px);height:var(--mat-slider-handle-height, 20px);border-width:calc(var(--mat-slider-handle-height, 20px)/2) calc(var(--mat-slider-handle-width, 20px)/2);box-shadow:var(--mat-slider-handle-elevation, var(--mat-sys-level1));background-color:var(--mat-slider-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-handle-color, var(--mat-sys-primary));border-radius:var(--mat-slider-handle-shape, var(--mat-sys-corner-full))}.mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mat-slider-hover-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-hover-handle-color, var(--mat-sys-primary))}.mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mat-slider-focus-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-focus-handle-color, var(--mat-sys-primary))}.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mat-slider-disabled-handle-color, var(--mat-sys-on-surface));border-color:var(--mat-slider-disabled-handle-color, var(--mat-sys-on-surface))}.mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border:solid 1px #fff;box-sizing:content-box;border-color:var(--mat-slider-with-overlap-handle-outline-color, var(--mat-sys-on-primary));border-width:var(--mat-slider-with-overlap-handle-outline-width, 1px)}.mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider__tick-mark--active,.mdc-slider__tick-mark--inactive{width:var(--mat-slider-with-tick-marks-container-size, 2px);height:var(--mat-slider-with-tick-marks-container-size, 2px);border-radius:var(--mat-slider-with-tick-marks-container-shape, var(--mat-sys-corner-full))}.mdc-slider__tick-mark--inactive{opacity:var(--mat-slider-with-tick-marks-inactive-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-inactive-container-color, var(--mat-sys-on-surface-variant))}.mdc-slider--disabled .mdc-slider__tick-mark--inactive{opacity:var(--mat-slider-with-tick-marks-inactive-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-disabled-container-color, var(--mat-sys-on-surface))}.mdc-slider__tick-mark--active{opacity:var(--mat-slider-with-tick-marks-active-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-active-container-color, var(--mat-sys-on-primary))}.mdc-slider__input{cursor:pointer;left:2px;margin:0;height:44px;opacity:0;position:absolute;top:2px;width:44px;box-sizing:content-box}.mdc-slider__input.mat-mdc-slider-input-no-pointer-events{pointer-events:none}.mdc-slider__input.mat-slider__right-input{left:auto;right:0}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;cursor:pointer;height:48px;margin:0 8px;position:relative;touch-action:pan-y;width:auto;min-width:112px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-slider.mdc-slider--disabled{cursor:auto;opacity:.38}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__input{cursor:auto}.mat-mdc-slider .mdc-slider__thumb,.mat-mdc-slider .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider.mdc-slider--discrete .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-slider-ripple-color, var(--mat-sys-primary))}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-slider-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-primary) 5%, transparent))}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-slider-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-focus-indicator::before{content:\"\"}\n"]
|
|
967
|
+
}]
|
|
968
|
+
}],
|
|
969
|
+
ctorParameters: () => [],
|
|
970
|
+
propDecorators: {
|
|
971
|
+
_trackActive: [{
|
|
972
|
+
type: ViewChild,
|
|
973
|
+
args: ['trackActive']
|
|
974
|
+
}],
|
|
975
|
+
_thumbs: [{
|
|
976
|
+
type: ViewChildren,
|
|
977
|
+
args: [MAT_SLIDER_VISUAL_THUMB]
|
|
978
|
+
}],
|
|
979
|
+
_input: [{
|
|
980
|
+
type: ContentChild,
|
|
981
|
+
args: [MAT_SLIDER_THUMB]
|
|
982
|
+
}],
|
|
983
|
+
_inputs: [{
|
|
984
|
+
type: ContentChildren,
|
|
985
|
+
args: [MAT_SLIDER_RANGE_THUMB, {
|
|
986
|
+
descendants: false
|
|
987
|
+
}]
|
|
988
|
+
}],
|
|
989
|
+
disabled: [{
|
|
990
|
+
type: Input,
|
|
991
|
+
args: [{
|
|
992
|
+
transform: booleanAttribute
|
|
993
|
+
}]
|
|
994
|
+
}],
|
|
995
|
+
discrete: [{
|
|
996
|
+
type: Input,
|
|
997
|
+
args: [{
|
|
998
|
+
transform: booleanAttribute
|
|
999
|
+
}]
|
|
1000
|
+
}],
|
|
1001
|
+
showTickMarks: [{
|
|
1002
|
+
type: Input,
|
|
1003
|
+
args: [{
|
|
1004
|
+
transform: booleanAttribute
|
|
1005
|
+
}]
|
|
1006
|
+
}],
|
|
1007
|
+
min: [{
|
|
1008
|
+
type: Input,
|
|
1009
|
+
args: [{
|
|
1010
|
+
transform: numberAttribute
|
|
1011
|
+
}]
|
|
1012
|
+
}],
|
|
1013
|
+
color: [{
|
|
1014
|
+
type: Input
|
|
1015
|
+
}],
|
|
1016
|
+
disableRipple: [{
|
|
1017
|
+
type: Input,
|
|
1018
|
+
args: [{
|
|
1019
|
+
transform: booleanAttribute
|
|
1020
|
+
}]
|
|
1021
|
+
}],
|
|
1022
|
+
max: [{
|
|
1023
|
+
type: Input,
|
|
1024
|
+
args: [{
|
|
1025
|
+
transform: numberAttribute
|
|
1026
|
+
}]
|
|
1027
|
+
}],
|
|
1028
|
+
step: [{
|
|
1029
|
+
type: Input,
|
|
1030
|
+
args: [{
|
|
1031
|
+
transform: numberAttribute
|
|
1032
|
+
}]
|
|
1033
|
+
}],
|
|
1034
|
+
displayWith: [{
|
|
1035
|
+
type: Input
|
|
1036
|
+
}]
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
function _validateInputs(isRange, endInputElement, startInputElement) {
|
|
1040
|
+
const startValid = !isRange || startInputElement?._hostElement.hasAttribute('matSliderStartThumb');
|
|
1041
|
+
const endValid = endInputElement?._hostElement.hasAttribute(isRange ? 'matSliderEndThumb' : 'matSliderThumb');
|
|
1042
|
+
if (!startValid || !endValid) {
|
|
1043
|
+
_throwInvalidInputConfigurationError();
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function _throwInvalidInputConfigurationError() {
|
|
1047
|
+
throw Error(`Invalid slider thumb input configuration!
|
|
1048
|
+
|
|
1049
|
+
Valid configurations are as follows:
|
|
1050
|
+
|
|
1051
|
+
<mat-slider>
|
|
1052
|
+
<input matSliderThumb>
|
|
1053
|
+
</mat-slider>
|
|
1054
|
+
|
|
1055
|
+
or
|
|
1056
|
+
|
|
1057
|
+
<mat-slider>
|
|
1058
|
+
<input matSliderStartThumb>
|
|
1059
|
+
<input matSliderEndThumb>
|
|
1060
|
+
</mat-slider>
|
|
1061
|
+
`);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
const MAT_SLIDER_THUMB_VALUE_ACCESSOR = {
|
|
1065
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1066
|
+
useExisting: forwardRef(() => MatSliderThumb),
|
|
1067
|
+
multi: true
|
|
1068
|
+
};
|
|
1069
|
+
const MAT_SLIDER_RANGE_THUMB_VALUE_ACCESSOR = {
|
|
1070
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1071
|
+
useExisting: forwardRef(() => MatSliderRangeThumb),
|
|
1072
|
+
multi: true
|
|
1073
|
+
};
|
|
1074
|
+
class MatSliderThumb {
|
|
1075
|
+
_ngZone = inject(NgZone);
|
|
1076
|
+
_elementRef = inject(ElementRef);
|
|
1077
|
+
_cdr = inject(ChangeDetectorRef);
|
|
1078
|
+
_slider = inject(MAT_SLIDER);
|
|
1079
|
+
_platform = inject(Platform);
|
|
1080
|
+
_listenerCleanups;
|
|
1081
|
+
get value() {
|
|
1082
|
+
return numberAttribute(this._hostElement.value, 0);
|
|
1083
|
+
}
|
|
1084
|
+
set value(value) {
|
|
1085
|
+
if (value === null) {
|
|
1086
|
+
value = this._getDefaultValue();
|
|
1087
|
+
}
|
|
1088
|
+
value = isNaN(value) ? 0 : value;
|
|
1089
|
+
const stringValue = value + '';
|
|
1090
|
+
if (!this._hasSetInitialValue) {
|
|
1091
|
+
this._initialValue = stringValue;
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
if (this._isActive) {
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
this._setValue(stringValue);
|
|
1098
|
+
}
|
|
1099
|
+
_setValue(value) {
|
|
1100
|
+
this._hostElement.value = value;
|
|
1101
|
+
this._updateThumbUIByValue();
|
|
1102
|
+
this._slider._onValueChange(this);
|
|
1103
|
+
this._cdr.detectChanges();
|
|
1104
|
+
this._slider._cdr.markForCheck();
|
|
1105
|
+
}
|
|
1106
|
+
valueChange = new EventEmitter();
|
|
1107
|
+
dragStart = new EventEmitter();
|
|
1108
|
+
dragEnd = new EventEmitter();
|
|
1109
|
+
get translateX() {
|
|
1110
|
+
if (this._slider.min >= this._slider.max) {
|
|
1111
|
+
this._translateX = this._tickMarkOffset;
|
|
1112
|
+
return this._translateX;
|
|
1113
|
+
}
|
|
1114
|
+
if (this._translateX === undefined) {
|
|
1115
|
+
this._translateX = this._calcTranslateXByValue();
|
|
1116
|
+
}
|
|
1117
|
+
return this._translateX;
|
|
1118
|
+
}
|
|
1119
|
+
set translateX(v) {
|
|
1120
|
+
this._translateX = v;
|
|
1121
|
+
}
|
|
1122
|
+
_translateX;
|
|
1123
|
+
thumbPosition = _MatThumb.END;
|
|
1124
|
+
get min() {
|
|
1125
|
+
return numberAttribute(this._hostElement.min, 0);
|
|
1126
|
+
}
|
|
1127
|
+
set min(v) {
|
|
1128
|
+
this._hostElement.min = v + '';
|
|
1129
|
+
this._cdr.detectChanges();
|
|
1130
|
+
}
|
|
1131
|
+
get max() {
|
|
1132
|
+
return numberAttribute(this._hostElement.max, 0);
|
|
1133
|
+
}
|
|
1134
|
+
set max(v) {
|
|
1135
|
+
this._hostElement.max = v + '';
|
|
1136
|
+
this._cdr.detectChanges();
|
|
1137
|
+
}
|
|
1138
|
+
get step() {
|
|
1139
|
+
return numberAttribute(this._hostElement.step, 0);
|
|
1140
|
+
}
|
|
1141
|
+
set step(v) {
|
|
1142
|
+
this._hostElement.step = v + '';
|
|
1143
|
+
this._cdr.detectChanges();
|
|
1144
|
+
}
|
|
1145
|
+
get disabled() {
|
|
1146
|
+
return booleanAttribute(this._hostElement.disabled);
|
|
1147
|
+
}
|
|
1148
|
+
set disabled(v) {
|
|
1149
|
+
this._hostElement.disabled = v;
|
|
1150
|
+
this._cdr.detectChanges();
|
|
1151
|
+
if (this._slider.disabled !== this.disabled) {
|
|
1152
|
+
this._slider.disabled = this.disabled;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
get percentage() {
|
|
1156
|
+
if (this._slider.min >= this._slider.max) {
|
|
1157
|
+
return this._slider._isRtl ? 1 : 0;
|
|
1158
|
+
}
|
|
1159
|
+
return (this.value - this._slider.min) / (this._slider.max - this._slider.min);
|
|
1160
|
+
}
|
|
1161
|
+
get fillPercentage() {
|
|
1162
|
+
if (!this._slider._cachedWidth) {
|
|
1163
|
+
return this._slider._isRtl ? 1 : 0;
|
|
1164
|
+
}
|
|
1165
|
+
if (this._translateX === 0) {
|
|
1166
|
+
return 0;
|
|
1167
|
+
}
|
|
1168
|
+
return this.translateX / this._slider._cachedWidth;
|
|
1169
|
+
}
|
|
1170
|
+
_hostElement = this._elementRef.nativeElement;
|
|
1171
|
+
_valuetext = signal('', ...(ngDevMode ? [{
|
|
1172
|
+
debugName: "_valuetext"
|
|
1173
|
+
}] : []));
|
|
1174
|
+
_knobRadius = 8;
|
|
1175
|
+
_tickMarkOffset = 3;
|
|
1176
|
+
_isActive = false;
|
|
1177
|
+
_isFocused = false;
|
|
1178
|
+
_setIsFocused(v) {
|
|
1179
|
+
this._isFocused = v;
|
|
1180
|
+
}
|
|
1181
|
+
_hasSetInitialValue = false;
|
|
1182
|
+
_initialValue;
|
|
1183
|
+
_formControl;
|
|
1184
|
+
_destroyed = new Subject();
|
|
1185
|
+
_skipUIUpdate = false;
|
|
1186
|
+
_onChangeFn;
|
|
1187
|
+
_onTouchedFn = () => {};
|
|
1188
|
+
_isControlInitialized = false;
|
|
1189
|
+
constructor() {
|
|
1190
|
+
const renderer = inject(Renderer2);
|
|
1191
|
+
this._ngZone.runOutsideAngular(() => {
|
|
1192
|
+
this._listenerCleanups = [renderer.listen(this._hostElement, 'pointerdown', this._onPointerDown.bind(this)), renderer.listen(this._hostElement, 'pointermove', this._onPointerMove.bind(this)), renderer.listen(this._hostElement, 'pointerup', this._onPointerUp.bind(this))];
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
ngOnDestroy() {
|
|
1196
|
+
this._listenerCleanups.forEach(cleanup => cleanup());
|
|
1197
|
+
this._destroyed.next();
|
|
1198
|
+
this._destroyed.complete();
|
|
1199
|
+
this.dragStart.complete();
|
|
1200
|
+
this.dragEnd.complete();
|
|
1201
|
+
}
|
|
1202
|
+
initProps() {
|
|
1203
|
+
this._updateWidthInactive();
|
|
1204
|
+
if (this.disabled !== this._slider.disabled) {
|
|
1205
|
+
this._slider.disabled = true;
|
|
1206
|
+
}
|
|
1207
|
+
this.step = this._slider.step;
|
|
1208
|
+
this.min = this._slider.min;
|
|
1209
|
+
this.max = this._slider.max;
|
|
1210
|
+
this._initValue();
|
|
1211
|
+
}
|
|
1212
|
+
initUI() {
|
|
1213
|
+
this._updateThumbUIByValue();
|
|
1214
|
+
}
|
|
1215
|
+
_initValue() {
|
|
1216
|
+
this._hasSetInitialValue = true;
|
|
1217
|
+
if (this._initialValue === undefined) {
|
|
1218
|
+
this.value = this._getDefaultValue();
|
|
1219
|
+
} else {
|
|
1220
|
+
this._hostElement.value = this._initialValue;
|
|
1221
|
+
this._updateThumbUIByValue();
|
|
1222
|
+
this._slider._onValueChange(this);
|
|
1223
|
+
this._cdr.detectChanges();
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
_getDefaultValue() {
|
|
1227
|
+
return this.min;
|
|
1228
|
+
}
|
|
1229
|
+
_onBlur() {
|
|
1230
|
+
this._setIsFocused(false);
|
|
1231
|
+
this._onTouchedFn();
|
|
1232
|
+
}
|
|
1233
|
+
_onFocus() {
|
|
1234
|
+
this._slider._setTransition(false);
|
|
1235
|
+
this._slider._updateTrackUI(this);
|
|
1236
|
+
this._setIsFocused(true);
|
|
1237
|
+
}
|
|
1238
|
+
_onChange() {
|
|
1239
|
+
this.valueChange.emit(this.value);
|
|
1240
|
+
if (this._isActive) {
|
|
1241
|
+
this._updateThumbUIByValue({
|
|
1242
|
+
withAnimation: true
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
_onInput() {
|
|
1247
|
+
this._onChangeFn?.(this.value);
|
|
1248
|
+
if (this._slider.step || !this._isActive) {
|
|
1249
|
+
this._updateThumbUIByValue({
|
|
1250
|
+
withAnimation: true
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
this._slider._onValueChange(this);
|
|
1254
|
+
}
|
|
1255
|
+
_onNgControlValueChange() {
|
|
1256
|
+
if (!this._isActive || !this._isFocused) {
|
|
1257
|
+
this._slider._onValueChange(this);
|
|
1258
|
+
this._updateThumbUIByValue();
|
|
1259
|
+
}
|
|
1260
|
+
this._slider.disabled = this._formControl.disabled;
|
|
1261
|
+
}
|
|
1262
|
+
_onPointerDown(event) {
|
|
1263
|
+
if (this.disabled || event.button !== 0) {
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
if (this._platform.IOS) {
|
|
1267
|
+
const isCursorOnSliderThumb = this._slider._isCursorOnSliderThumb(event, this._slider._getThumb(this.thumbPosition)._hostElement.getBoundingClientRect());
|
|
1268
|
+
this._isActive = isCursorOnSliderThumb;
|
|
1269
|
+
this._updateWidthActive();
|
|
1270
|
+
this._slider._updateDimensions();
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
this._isActive = true;
|
|
1274
|
+
this._setIsFocused(true);
|
|
1275
|
+
this._updateWidthActive();
|
|
1276
|
+
this._slider._updateDimensions();
|
|
1277
|
+
if (!this._slider.step) {
|
|
1278
|
+
this._updateThumbUIByPointerEvent(event, {
|
|
1279
|
+
withAnimation: true
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
if (!this.disabled) {
|
|
1283
|
+
this._handleValueCorrection(event);
|
|
1284
|
+
this.dragStart.emit({
|
|
1285
|
+
source: this,
|
|
1286
|
+
parent: this._slider,
|
|
1287
|
+
value: this.value
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
_handleValueCorrection(event) {
|
|
1292
|
+
this._skipUIUpdate = true;
|
|
1293
|
+
setTimeout(() => {
|
|
1294
|
+
this._skipUIUpdate = false;
|
|
1295
|
+
this._fixValue(event);
|
|
1296
|
+
}, 0);
|
|
1297
|
+
}
|
|
1298
|
+
_fixValue(event) {
|
|
1299
|
+
const xPos = event.clientX - this._slider._cachedLeft;
|
|
1300
|
+
const width = this._slider._cachedWidth;
|
|
1301
|
+
const step = this._slider.step === 0 ? 1 : this._slider.step;
|
|
1302
|
+
const numSteps = Math.floor((this._slider.max - this._slider.min) / step);
|
|
1303
|
+
const percentage = this._slider._isRtl ? 1 - xPos / width : xPos / width;
|
|
1304
|
+
const fixedPercentage = Math.round(percentage * numSteps) / numSteps;
|
|
1305
|
+
const impreciseValue = fixedPercentage * (this._slider.max - this._slider.min) + this._slider.min;
|
|
1306
|
+
const value = Math.round(impreciseValue / step) * step;
|
|
1307
|
+
const prevValue = this.value;
|
|
1308
|
+
if (value === prevValue) {
|
|
1309
|
+
this._slider._onValueChange(this);
|
|
1310
|
+
this._slider.step > 0 ? this._updateThumbUIByValue() : this._updateThumbUIByPointerEvent(event, {
|
|
1311
|
+
withAnimation: this._slider._hasAnimation
|
|
1312
|
+
});
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
this.value = value;
|
|
1316
|
+
this.valueChange.emit(this.value);
|
|
1317
|
+
this._onChangeFn?.(this.value);
|
|
1318
|
+
this._slider._onValueChange(this);
|
|
1319
|
+
this._slider.step > 0 ? this._updateThumbUIByValue() : this._updateThumbUIByPointerEvent(event, {
|
|
1320
|
+
withAnimation: this._slider._hasAnimation
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
_onPointerMove(event) {
|
|
1324
|
+
if (!this._slider.step && this._isActive) {
|
|
1325
|
+
this._updateThumbUIByPointerEvent(event);
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
_onPointerUp() {
|
|
1329
|
+
if (this._isActive) {
|
|
1330
|
+
this._isActive = false;
|
|
1331
|
+
if (this._platform.SAFARI) {
|
|
1332
|
+
this._setIsFocused(false);
|
|
1333
|
+
}
|
|
1334
|
+
this.dragEnd.emit({
|
|
1335
|
+
source: this,
|
|
1336
|
+
parent: this._slider,
|
|
1337
|
+
value: this.value
|
|
1338
|
+
});
|
|
1339
|
+
setTimeout(() => this._updateWidthInactive(), this._platform.IOS ? 10 : 0);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
_clamp(v) {
|
|
1343
|
+
const min = this._tickMarkOffset;
|
|
1344
|
+
const max = this._slider._cachedWidth - this._tickMarkOffset;
|
|
1345
|
+
return Math.max(Math.min(v, max), min);
|
|
1346
|
+
}
|
|
1347
|
+
_calcTranslateXByValue() {
|
|
1348
|
+
if (this._slider._isRtl) {
|
|
1349
|
+
return (1 - this.percentage) * (this._slider._cachedWidth - this._tickMarkOffset * 2) + this._tickMarkOffset;
|
|
1350
|
+
}
|
|
1351
|
+
return this.percentage * (this._slider._cachedWidth - this._tickMarkOffset * 2) + this._tickMarkOffset;
|
|
1352
|
+
}
|
|
1353
|
+
_calcTranslateXByPointerEvent(event) {
|
|
1354
|
+
return event.clientX - this._slider._cachedLeft;
|
|
1355
|
+
}
|
|
1356
|
+
_updateWidthActive() {}
|
|
1357
|
+
_updateWidthInactive() {
|
|
1358
|
+
this._hostElement.style.padding = `0 ${this._slider._inputPadding}px`;
|
|
1359
|
+
this._hostElement.style.width = `calc(100% + ${this._slider._inputPadding - this._tickMarkOffset * 2}px)`;
|
|
1360
|
+
this._hostElement.style.left = `-${this._slider._rippleRadius - this._tickMarkOffset}px`;
|
|
1361
|
+
}
|
|
1362
|
+
_updateThumbUIByValue(options) {
|
|
1363
|
+
this.translateX = this._clamp(this._calcTranslateXByValue());
|
|
1364
|
+
this._updateThumbUI(options);
|
|
1365
|
+
}
|
|
1366
|
+
_updateThumbUIByPointerEvent(event, options) {
|
|
1367
|
+
this.translateX = this._clamp(this._calcTranslateXByPointerEvent(event));
|
|
1368
|
+
this._updateThumbUI(options);
|
|
1369
|
+
}
|
|
1370
|
+
_updateThumbUI(options) {
|
|
1371
|
+
this._slider._setTransition(!!options?.withAnimation);
|
|
1372
|
+
this._slider._onTranslateXChange(this);
|
|
1373
|
+
}
|
|
1374
|
+
writeValue(value) {
|
|
1375
|
+
if (this._isControlInitialized || value !== null) {
|
|
1376
|
+
this.value = value;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
registerOnChange(fn) {
|
|
1380
|
+
this._onChangeFn = fn;
|
|
1381
|
+
this._isControlInitialized = true;
|
|
1382
|
+
}
|
|
1383
|
+
registerOnTouched(fn) {
|
|
1384
|
+
this._onTouchedFn = fn;
|
|
1385
|
+
}
|
|
1386
|
+
setDisabledState(isDisabled) {
|
|
1387
|
+
this.disabled = isDisabled;
|
|
1388
|
+
}
|
|
1389
|
+
focus() {
|
|
1390
|
+
this._hostElement.focus();
|
|
1391
|
+
}
|
|
1392
|
+
blur() {
|
|
1393
|
+
this._hostElement.blur();
|
|
1394
|
+
}
|
|
1395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1396
|
+
minVersion: "12.0.0",
|
|
1397
|
+
version: "22.0.0-next.1",
|
|
1398
|
+
ngImport: i0,
|
|
1399
|
+
type: MatSliderThumb,
|
|
1400
|
+
deps: [],
|
|
1401
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1402
|
+
});
|
|
1403
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1404
|
+
minVersion: "16.1.0",
|
|
1405
|
+
version: "22.0.0-next.1",
|
|
1406
|
+
type: MatSliderThumb,
|
|
1407
|
+
isStandalone: true,
|
|
1408
|
+
selector: "input[matSliderThumb]",
|
|
1409
|
+
inputs: {
|
|
1410
|
+
value: ["value", "value", numberAttribute]
|
|
1411
|
+
},
|
|
1412
|
+
outputs: {
|
|
1413
|
+
valueChange: "valueChange",
|
|
1414
|
+
dragStart: "dragStart",
|
|
1415
|
+
dragEnd: "dragEnd"
|
|
1416
|
+
},
|
|
1417
|
+
host: {
|
|
1418
|
+
attributes: {
|
|
1419
|
+
"type": "range"
|
|
1420
|
+
},
|
|
1421
|
+
listeners: {
|
|
1422
|
+
"change": "_onChange()",
|
|
1423
|
+
"input": "_onInput()",
|
|
1424
|
+
"blur": "_onBlur()",
|
|
1425
|
+
"focus": "_onFocus()"
|
|
1426
|
+
},
|
|
1427
|
+
properties: {
|
|
1428
|
+
"attr.aria-valuetext": "_valuetext()"
|
|
1429
|
+
},
|
|
1430
|
+
classAttribute: "mdc-slider__input"
|
|
1431
|
+
},
|
|
1432
|
+
providers: [MAT_SLIDER_THUMB_VALUE_ACCESSOR, {
|
|
1433
|
+
provide: MAT_SLIDER_THUMB,
|
|
1434
|
+
useExisting: MatSliderThumb
|
|
1435
|
+
}],
|
|
1436
|
+
exportAs: ["matSliderThumb"],
|
|
1437
|
+
ngImport: i0
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1441
|
+
minVersion: "12.0.0",
|
|
1442
|
+
version: "22.0.0-next.1",
|
|
1443
|
+
ngImport: i0,
|
|
1444
|
+
type: MatSliderThumb,
|
|
1445
|
+
decorators: [{
|
|
1446
|
+
type: Directive,
|
|
1447
|
+
args: [{
|
|
1448
|
+
selector: 'input[matSliderThumb]',
|
|
1449
|
+
exportAs: 'matSliderThumb',
|
|
1450
|
+
host: {
|
|
1451
|
+
'class': 'mdc-slider__input',
|
|
1452
|
+
'type': 'range',
|
|
1453
|
+
'[attr.aria-valuetext]': '_valuetext()',
|
|
1454
|
+
'(change)': '_onChange()',
|
|
1455
|
+
'(input)': '_onInput()',
|
|
1456
|
+
'(blur)': '_onBlur()',
|
|
1457
|
+
'(focus)': '_onFocus()'
|
|
1458
|
+
},
|
|
1459
|
+
providers: [MAT_SLIDER_THUMB_VALUE_ACCESSOR, {
|
|
1460
|
+
provide: MAT_SLIDER_THUMB,
|
|
1461
|
+
useExisting: MatSliderThumb
|
|
1462
|
+
}]
|
|
1463
|
+
}]
|
|
1464
|
+
}],
|
|
1465
|
+
ctorParameters: () => [],
|
|
1466
|
+
propDecorators: {
|
|
1467
|
+
value: [{
|
|
1468
|
+
type: Input,
|
|
1469
|
+
args: [{
|
|
1470
|
+
transform: numberAttribute
|
|
1471
|
+
}]
|
|
1472
|
+
}],
|
|
1473
|
+
valueChange: [{
|
|
1474
|
+
type: Output
|
|
1475
|
+
}],
|
|
1476
|
+
dragStart: [{
|
|
1477
|
+
type: Output
|
|
1478
|
+
}],
|
|
1479
|
+
dragEnd: [{
|
|
1480
|
+
type: Output
|
|
1481
|
+
}]
|
|
1482
|
+
}
|
|
1483
|
+
});
|
|
1484
|
+
class MatSliderRangeThumb extends MatSliderThumb {
|
|
1485
|
+
_cdr = inject(ChangeDetectorRef);
|
|
1486
|
+
getSibling() {
|
|
1487
|
+
if (!this._sibling) {
|
|
1488
|
+
this._sibling = this._slider._getInput(this._isEndThumb ? _MatThumb.START : _MatThumb.END);
|
|
1489
|
+
}
|
|
1490
|
+
return this._sibling;
|
|
1491
|
+
}
|
|
1492
|
+
_sibling;
|
|
1493
|
+
getMinPos() {
|
|
1494
|
+
const sibling = this.getSibling();
|
|
1495
|
+
if (!this._isLeftThumb && sibling) {
|
|
1496
|
+
return sibling.translateX;
|
|
1497
|
+
}
|
|
1498
|
+
return this._tickMarkOffset;
|
|
1499
|
+
}
|
|
1500
|
+
getMaxPos() {
|
|
1501
|
+
const sibling = this.getSibling();
|
|
1502
|
+
if (this._isLeftThumb && sibling) {
|
|
1503
|
+
return sibling.translateX;
|
|
1504
|
+
}
|
|
1505
|
+
return this._slider._cachedWidth - this._tickMarkOffset;
|
|
1506
|
+
}
|
|
1507
|
+
_setIsLeftThumb() {
|
|
1508
|
+
this._isLeftThumb = this._isEndThumb && this._slider._isRtl || !this._isEndThumb && !this._slider._isRtl;
|
|
1509
|
+
}
|
|
1510
|
+
_isLeftThumb = false;
|
|
1511
|
+
_isEndThumb = false;
|
|
1512
|
+
constructor() {
|
|
1513
|
+
super();
|
|
1514
|
+
this._isEndThumb = this._hostElement.hasAttribute('matSliderEndThumb');
|
|
1515
|
+
this._setIsLeftThumb();
|
|
1516
|
+
this.thumbPosition = this._isEndThumb ? _MatThumb.END : _MatThumb.START;
|
|
1517
|
+
}
|
|
1518
|
+
_getDefaultValue() {
|
|
1519
|
+
return this._isEndThumb && this._slider._isRange ? this.max : this.min;
|
|
1520
|
+
}
|
|
1521
|
+
_onInput() {
|
|
1522
|
+
super._onInput();
|
|
1523
|
+
this._updateSibling();
|
|
1524
|
+
if (!this._isActive) {
|
|
1525
|
+
this._updateWidthInactive();
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
_onNgControlValueChange() {
|
|
1529
|
+
super._onNgControlValueChange();
|
|
1530
|
+
this.getSibling()?._updateMinMax();
|
|
1531
|
+
}
|
|
1532
|
+
_onPointerDown(event) {
|
|
1533
|
+
if (this.disabled || event.button !== 0) {
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
if (this._sibling) {
|
|
1537
|
+
this._sibling._updateWidthActive();
|
|
1538
|
+
this._sibling._hostElement.classList.add('mat-mdc-slider-input-no-pointer-events');
|
|
1539
|
+
}
|
|
1540
|
+
super._onPointerDown(event);
|
|
1541
|
+
}
|
|
1542
|
+
_onPointerUp() {
|
|
1543
|
+
super._onPointerUp();
|
|
1544
|
+
if (this._sibling) {
|
|
1545
|
+
setTimeout(() => {
|
|
1546
|
+
this._sibling._updateWidthInactive();
|
|
1547
|
+
this._sibling._hostElement.classList.remove('mat-mdc-slider-input-no-pointer-events');
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
_onPointerMove(event) {
|
|
1552
|
+
super._onPointerMove(event);
|
|
1553
|
+
if (!this._slider.step && this._isActive) {
|
|
1554
|
+
this._updateSibling();
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
_fixValue(event) {
|
|
1558
|
+
super._fixValue(event);
|
|
1559
|
+
this._sibling?._updateMinMax();
|
|
1560
|
+
}
|
|
1561
|
+
_clamp(v) {
|
|
1562
|
+
return Math.max(Math.min(v, this.getMaxPos()), this.getMinPos());
|
|
1563
|
+
}
|
|
1564
|
+
_updateMinMax() {
|
|
1565
|
+
const sibling = this.getSibling();
|
|
1566
|
+
if (!sibling) {
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
if (this._isEndThumb) {
|
|
1570
|
+
this.min = Math.max(this._slider.min, sibling.value);
|
|
1571
|
+
this.max = this._slider.max;
|
|
1572
|
+
} else {
|
|
1573
|
+
this.min = this._slider.min;
|
|
1574
|
+
this.max = Math.min(this._slider.max, sibling.value);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
_updateWidthActive() {
|
|
1578
|
+
const minWidth = this._slider._rippleRadius * 2 - this._slider._inputPadding * 2;
|
|
1579
|
+
const maxWidth = this._slider._cachedWidth + this._slider._inputPadding - minWidth - this._tickMarkOffset * 2;
|
|
1580
|
+
const percentage = this._slider.min < this._slider.max ? (this.max - this.min) / (this._slider.max - this._slider.min) : 1;
|
|
1581
|
+
const width = maxWidth * percentage + minWidth;
|
|
1582
|
+
this._hostElement.style.width = `${width}px`;
|
|
1583
|
+
this._hostElement.style.padding = `0 ${this._slider._inputPadding}px`;
|
|
1584
|
+
}
|
|
1585
|
+
_updateWidthInactive() {
|
|
1586
|
+
const sibling = this.getSibling();
|
|
1587
|
+
if (!sibling) {
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
const maxWidth = this._slider._cachedWidth - this._tickMarkOffset * 2;
|
|
1591
|
+
const midValue = this._isEndThumb ? this.value - (this.value - sibling.value) / 2 : this.value + (sibling.value - this.value) / 2;
|
|
1592
|
+
const _percentage = this._isEndThumb ? (this.max - midValue) / (this._slider.max - this._slider.min) : (midValue - this.min) / (this._slider.max - this._slider.min);
|
|
1593
|
+
const percentage = this._slider.min < this._slider.max ? _percentage : 1;
|
|
1594
|
+
let ripplePadding = this._slider._rippleRadius;
|
|
1595
|
+
if (percentage === 1) {
|
|
1596
|
+
ripplePadding = 48;
|
|
1597
|
+
} else if (percentage === 0) {
|
|
1598
|
+
ripplePadding = 0;
|
|
1599
|
+
}
|
|
1600
|
+
const width = maxWidth * percentage + ripplePadding;
|
|
1601
|
+
this._hostElement.style.width = `${width}px`;
|
|
1602
|
+
this._hostElement.style.padding = '0px';
|
|
1603
|
+
if (this._isLeftThumb) {
|
|
1604
|
+
this._hostElement.style.left = `-${this._slider._rippleRadius - this._tickMarkOffset}px`;
|
|
1605
|
+
this._hostElement.style.right = 'auto';
|
|
1606
|
+
} else {
|
|
1607
|
+
this._hostElement.style.left = 'auto';
|
|
1608
|
+
this._hostElement.style.right = `-${this._slider._rippleRadius - this._tickMarkOffset}px`;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
_updateStaticStyles() {
|
|
1612
|
+
this._hostElement.classList.toggle('mat-slider__right-input', !this._isLeftThumb);
|
|
1613
|
+
}
|
|
1614
|
+
_updateSibling() {
|
|
1615
|
+
const sibling = this.getSibling();
|
|
1616
|
+
if (!sibling) {
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
sibling._updateMinMax();
|
|
1620
|
+
if (this._isActive) {
|
|
1621
|
+
sibling._updateWidthActive();
|
|
1622
|
+
} else {
|
|
1623
|
+
sibling._updateWidthInactive();
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
writeValue(value) {
|
|
1627
|
+
if (this._isControlInitialized || value !== null) {
|
|
1628
|
+
this.value = value;
|
|
1629
|
+
this._updateWidthInactive();
|
|
1630
|
+
this._updateSibling();
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
_setValue(value) {
|
|
1634
|
+
super._setValue(value);
|
|
1635
|
+
this._updateWidthInactive();
|
|
1636
|
+
this._updateSibling();
|
|
1637
|
+
}
|
|
1638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1639
|
+
minVersion: "12.0.0",
|
|
1640
|
+
version: "22.0.0-next.1",
|
|
1641
|
+
ngImport: i0,
|
|
1642
|
+
type: MatSliderRangeThumb,
|
|
1643
|
+
deps: [],
|
|
1644
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1645
|
+
});
|
|
1646
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1647
|
+
minVersion: "14.0.0",
|
|
1648
|
+
version: "22.0.0-next.1",
|
|
1649
|
+
type: MatSliderRangeThumb,
|
|
1650
|
+
isStandalone: true,
|
|
1651
|
+
selector: "input[matSliderStartThumb], input[matSliderEndThumb]",
|
|
1652
|
+
providers: [MAT_SLIDER_RANGE_THUMB_VALUE_ACCESSOR, {
|
|
1653
|
+
provide: MAT_SLIDER_RANGE_THUMB,
|
|
1654
|
+
useExisting: MatSliderRangeThumb
|
|
1655
|
+
}],
|
|
1656
|
+
exportAs: ["matSliderRangeThumb"],
|
|
1657
|
+
usesInheritance: true,
|
|
1658
|
+
ngImport: i0
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1662
|
+
minVersion: "12.0.0",
|
|
1663
|
+
version: "22.0.0-next.1",
|
|
1664
|
+
ngImport: i0,
|
|
1665
|
+
type: MatSliderRangeThumb,
|
|
1666
|
+
decorators: [{
|
|
1667
|
+
type: Directive,
|
|
1668
|
+
args: [{
|
|
1669
|
+
selector: 'input[matSliderStartThumb], input[matSliderEndThumb]',
|
|
1670
|
+
exportAs: 'matSliderRangeThumb',
|
|
1671
|
+
providers: [MAT_SLIDER_RANGE_THUMB_VALUE_ACCESSOR, {
|
|
1672
|
+
provide: MAT_SLIDER_RANGE_THUMB,
|
|
1673
|
+
useExisting: MatSliderRangeThumb
|
|
1674
|
+
}]
|
|
1675
|
+
}]
|
|
1676
|
+
}],
|
|
1677
|
+
ctorParameters: () => []
|
|
1678
|
+
});
|
|
1679
|
+
|
|
1680
|
+
class MatSliderModule {
|
|
1681
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1682
|
+
minVersion: "12.0.0",
|
|
1683
|
+
version: "22.0.0-next.1",
|
|
1684
|
+
ngImport: i0,
|
|
1685
|
+
type: MatSliderModule,
|
|
1686
|
+
deps: [],
|
|
1687
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1688
|
+
});
|
|
1689
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1690
|
+
minVersion: "14.0.0",
|
|
1691
|
+
version: "22.0.0-next.1",
|
|
1692
|
+
ngImport: i0,
|
|
1693
|
+
type: MatSliderModule,
|
|
1694
|
+
imports: [MatRippleModule, MatSlider, MatSliderThumb, MatSliderRangeThumb, MatSliderVisualThumb],
|
|
1695
|
+
exports: [MatSlider, MatSliderThumb, MatSliderRangeThumb, BidiModule]
|
|
1696
|
+
});
|
|
1697
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
1698
|
+
minVersion: "12.0.0",
|
|
1699
|
+
version: "22.0.0-next.1",
|
|
1700
|
+
ngImport: i0,
|
|
1701
|
+
type: MatSliderModule,
|
|
1702
|
+
imports: [MatRippleModule, BidiModule]
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1706
|
+
minVersion: "12.0.0",
|
|
1707
|
+
version: "22.0.0-next.1",
|
|
1708
|
+
ngImport: i0,
|
|
1709
|
+
type: MatSliderModule,
|
|
1710
|
+
decorators: [{
|
|
1711
|
+
type: NgModule,
|
|
1712
|
+
args: [{
|
|
1713
|
+
imports: [MatRippleModule, MatSlider, MatSliderThumb, MatSliderRangeThumb, MatSliderVisualThumb],
|
|
1714
|
+
exports: [MatSlider, MatSliderThumb, MatSliderRangeThumb, BidiModule]
|
|
1715
|
+
}]
|
|
1716
|
+
}]
|
|
1717
|
+
});
|
|
1718
|
+
|
|
1719
|
+
export { MatSlider, MatSliderChange, MatSliderModule, MatSliderRangeThumb, MatSliderThumb, MatSliderVisualThumb };
|
|
1720
|
+
//# sourceMappingURL=slider.mjs.map
|