@angular/cdk 8.0.0-rc.2 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/typings/aria-describer/aria-describer.d.ts +4 -3
- package/a11y/typings/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +42 -10
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +532 -87
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -2
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +5 -1
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +1 -1
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +31 -23
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +6 -7
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +8 -6
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/typings/directives/drag.d.ts +1 -1
- package/drag-drop/typings/directives/drop-list.d.ts +2 -0
- package/drag-drop/typings/drag-drop-registry.d.ts +2 -0
- package/drag-drop/typings/drag-ref.d.ts +10 -1
- package/drag-drop/typings/drop-list-ref.d.ts +59 -3
- package/drag-drop/typings/index.metadata.json +1 -1
- package/esm2015/a11y.js +35 -10
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/drag-drop.js +467 -85
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/layout.js +7 -3
- package/esm2015/layout.js.map +1 -1
- package/esm2015/overlay.js +31 -23
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/scrolling.js +6 -7
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/tree.js +7 -6
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +42 -10
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +530 -85
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/layout.es5.js +7 -3
- package/esm5/layout.es5.js.map +1 -1
- package/esm5/overlay.es5.js +32 -24
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +6 -7
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/tree.es5.js +8 -6
- package/esm5/tree.es5.js.map +1 -1
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-ref.d.ts +1 -0
- package/package.json +4 -4
- package/schematics/index.d.ts +1 -0
- package/schematics/index.js +1 -0
- package/schematics/index.js.map +1 -1
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/{__name@dasherize__.component.__style__ → __name@dasherize__.component.__style__.template} +0 -0
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/{__name@dasherize__.component.html → __name@dasherize__.component.html.template} +0 -0
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/{__name@dasherize__.component.spec.ts → __name@dasherize__.component.spec.ts.template} +0 -0
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/{__name@dasherize__.component.ts → __name@dasherize__.component.ts.template} +0 -0
- package/schematics/ng-generate/drag-drop/index.js +2 -2
- package/schematics/ng-generate/drag-drop/index.js.map +1 -1
- package/schematics/ng-update/data/attribute-selectors.d.ts +1 -1
- package/schematics/ng-update/data/attribute-selectors.js +5 -13
- package/schematics/ng-update/data/attribute-selectors.js.map +1 -1
- package/schematics/ng-update/data/class-names.d.ts +1 -1
- package/schematics/ng-update/data/class-names.js +5 -21
- package/schematics/ng-update/data/class-names.js.map +1 -1
- package/schematics/ng-update/data/constructor-checks.d.ts +1 -1
- package/schematics/ng-update/data/constructor-checks.js +3 -5
- package/schematics/ng-update/data/constructor-checks.js.map +1 -1
- package/schematics/ng-update/data/css-selectors.d.ts +1 -1
- package/schematics/ng-update/data/css-selectors.js +1 -1
- package/schematics/ng-update/data/css-selectors.js.map +1 -1
- package/schematics/ng-update/data/element-selectors.d.ts +1 -1
- package/schematics/ng-update/data/element-selectors.js +1 -1
- package/schematics/ng-update/data/element-selectors.js.map +1 -1
- package/schematics/ng-update/data/input-names.d.ts +1 -1
- package/schematics/ng-update/data/input-names.js +13 -37
- package/schematics/ng-update/data/input-names.js.map +1 -1
- package/schematics/ng-update/data/method-call-checks.d.ts +1 -1
- package/schematics/ng-update/data/method-call-checks.js +6 -15
- package/schematics/ng-update/data/method-call-checks.js.map +1 -1
- package/schematics/ng-update/data/output-names.d.ts +1 -1
- package/schematics/ng-update/data/output-names.js +1 -1
- package/schematics/ng-update/data/output-names.js.map +1 -1
- package/schematics/ng-update/data/property-names.d.ts +1 -1
- package/schematics/ng-update/data/property-names.js +19 -59
- package/schematics/ng-update/data/property-names.js.map +1 -1
- package/schematics/ng-update/html-parsing/elements.js.map +1 -1
- package/schematics/ng-update/index.d.ts +0 -2
- package/schematics/ng-update/index.js +13 -24
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/public-api.d.ts +0 -5
- package/schematics/ng-update/public-api.js +0 -5
- package/schematics/ng-update/public-api.js.map +1 -1
- package/schematics/ng-update/typescript/base-types.js.map +1 -1
- package/schematics/ng-update/typescript/module-specifiers.js.map +1 -1
- package/schematics/ng-update/upgrade-data.d.ts +5 -30
- package/schematics/ng-update/upgrade-data.js +4 -34
- package/schematics/ng-update/upgrade-data.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/attribute-selectors-rule.d.ts +25 -0
- package/schematics/ng-update/upgrade-rules/attribute-selectors-rule.js +66 -0
- package/schematics/ng-update/upgrade-rules/attribute-selectors-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/class-inheritance-rule.d.ts +26 -0
- package/schematics/ng-update/upgrade-rules/{class-inheritance/classInheritanceCheckRule.js → class-inheritance-rule.js} +24 -20
- package/schematics/ng-update/upgrade-rules/class-inheritance-rule.js.map +1 -0
- package/{typings/schematics/ng-update/upgrade-rules/class-names/classNamesIdentifierRule.d.ts → schematics/ng-update/upgrade-rules/class-names-rule.d.ts} +7 -7
- package/schematics/ng-update/upgrade-rules/{class-names/classNamesIdentifierRule.js → class-names-rule.js} +19 -24
- package/schematics/ng-update/upgrade-rules/class-names-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/constructor-signature-rule.d.ts +29 -0
- package/schematics/ng-update/upgrade-rules/constructor-signature-rule.js +134 -0
- package/schematics/ng-update/upgrade-rules/constructor-signature-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/css-selectors-rule.d.ts +25 -0
- package/schematics/ng-update/upgrade-rules/css-selectors-rule.js +73 -0
- package/schematics/ng-update/upgrade-rules/css-selectors-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/element-selectors-rule.d.ts +25 -0
- package/schematics/ng-update/upgrade-rules/element-selectors-rule.js +64 -0
- package/schematics/ng-update/upgrade-rules/element-selectors-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/index.d.ts +13 -4
- package/schematics/ng-update/upgrade-rules/index.js +49 -29
- package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/input-names-rule.d.ts +26 -0
- package/schematics/ng-update/upgrade-rules/input-names-rule.js +59 -0
- package/schematics/ng-update/upgrade-rules/input-names-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/{signature-check/methodCallsCheckRule.d.ts → method-call-arguments-rule.d.ts} +8 -9
- package/schematics/ng-update/upgrade-rules/method-call-arguments-rule.js +60 -0
- package/schematics/ng-update/upgrade-rules/method-call-arguments-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/misc-template-rule.d.ts +18 -0
- package/schematics/ng-update/upgrade-rules/misc-template-rule.js +37 -0
- package/schematics/ng-update/upgrade-rules/misc-template-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/output-names-rule.d.ts +22 -0
- package/schematics/ng-update/upgrade-rules/output-names-rule.js +46 -0
- package/schematics/ng-update/upgrade-rules/output-names-rule.js.map +1 -0
- package/schematics/ng-update/upgrade-rules/property-names-rule.d.ts +22 -0
- package/schematics/ng-update/upgrade-rules/property-names-rule.js +46 -0
- package/schematics/ng-update/upgrade-rules/property-names-rule.js.map +1 -0
- package/schematics/tsconfig.tsbuildinfo +2896 -3609
- package/schematics/update-tool/component-resource-collector.d.ts +41 -0
- package/schematics/update-tool/component-resource-collector.js +141 -0
- package/schematics/update-tool/component-resource-collector.js.map +1 -0
- package/schematics/update-tool/index.d.ts +13 -0
- package/schematics/update-tool/index.js +117 -0
- package/schematics/update-tool/index.js.map +1 -0
- package/schematics/update-tool/migration-rule.d.ts +45 -0
- package/schematics/update-tool/migration-rule.js +50 -0
- package/schematics/update-tool/migration-rule.js.map +1 -0
- package/schematics/update-tool/public-api.d.ts +12 -0
- package/schematics/update-tool/public-api.js +18 -0
- package/schematics/update-tool/public-api.js.map +1 -0
- package/schematics/{ng-update → update-tool}/target-version.d.ts +3 -3
- package/schematics/{ng-update → update-tool}/target-version.js +3 -3
- package/schematics/update-tool/target-version.js.map +1 -0
- package/schematics/update-tool/utils/decorators.d.ts +23 -0
- package/schematics/update-tool/utils/decorators.js +37 -0
- package/schematics/update-tool/utils/decorators.js.map +1 -0
- package/schematics/update-tool/utils/functions.d.ts +14 -0
- package/schematics/update-tool/utils/functions.js +20 -0
- package/schematics/update-tool/utils/functions.js.map +1 -0
- package/schematics/update-tool/utils/imports.d.ts +15 -0
- package/schematics/update-tool/utils/imports.js +35 -0
- package/schematics/update-tool/utils/imports.js.map +1 -0
- package/schematics/update-tool/utils/line-mappings.d.ts +21 -0
- package/schematics/update-tool/utils/line-mappings.js +75 -0
- package/schematics/update-tool/utils/line-mappings.js.map +1 -0
- package/schematics/update-tool/utils/parse-tsconfig.d.ts +9 -0
- package/schematics/update-tool/utils/parse-tsconfig.js +22 -0
- package/schematics/update-tool/utils/parse-tsconfig.js.map +1 -0
- package/schematics/update-tool/utils/property-name.d.ts +18 -0
- package/schematics/update-tool/utils/property-name.js +27 -0
- package/schematics/update-tool/utils/property-name.js.map +1 -0
- package/schematics/update-tool/version-changes.d.ts +32 -0
- package/schematics/update-tool/version-changes.js +41 -0
- package/schematics/update-tool/version-changes.js.map +1 -0
- package/schematics/utils/build-component.js +4 -4
- package/schematics/utils/build-component.js.map +1 -1
- package/schematics/{ng-update/upgrade-rules → utils}/project-tsconfig-paths.d.ts +4 -1
- package/schematics/utils/project-tsconfig-paths.js +77 -0
- package/schematics/utils/project-tsconfig-paths.js.map +1 -0
- package/typings/a11y/aria-describer/aria-describer.d.ts +4 -3
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/drag-drop/directives/drag.d.ts +1 -1
- package/typings/drag-drop/directives/drop-list.d.ts +2 -0
- package/typings/drag-drop/drag-drop-registry.d.ts +2 -0
- package/typings/drag-drop/drag-ref.d.ts +10 -1
- package/typings/drag-drop/drop-list-ref.d.ts +59 -3
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/a11y/aria-describer/aria-describer.d.ts +4 -3
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/directives/drag.d.ts +1 -1
- package/typings/esm5/drag-drop/directives/drop-list.d.ts +2 -0
- package/typings/esm5/drag-drop/drag-drop-registry.d.ts +2 -0
- package/typings/esm5/drag-drop/drag-ref.d.ts +10 -1
- package/typings/esm5/drag-drop/drop-list-ref.d.ts +59 -3
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/overlay-ref.d.ts +1 -0
- package/typings/index.metadata.json +1 -1
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-ref.d.ts +1 -0
- package/typings/schematics/index.d.ts +1 -0
- package/typings/schematics/ng-update/data/attribute-selectors.d.ts +1 -1
- package/typings/schematics/ng-update/data/class-names.d.ts +1 -1
- package/typings/schematics/ng-update/data/constructor-checks.d.ts +1 -1
- package/typings/schematics/ng-update/data/css-selectors.d.ts +1 -1
- package/typings/schematics/ng-update/data/element-selectors.d.ts +1 -1
- package/typings/schematics/ng-update/data/input-names.d.ts +1 -1
- package/typings/schematics/ng-update/data/method-call-checks.d.ts +1 -1
- package/typings/schematics/ng-update/data/output-names.d.ts +1 -1
- package/typings/schematics/ng-update/data/property-names.d.ts +1 -1
- package/typings/schematics/ng-update/index.d.ts +0 -2
- package/typings/schematics/ng-update/public-api.d.ts +0 -5
- package/typings/schematics/ng-update/upgrade-data.d.ts +5 -30
- package/typings/schematics/ng-update/upgrade-rules/attribute-selectors-rule.d.ts +25 -0
- package/typings/schematics/ng-update/upgrade-rules/class-inheritance-rule.d.ts +26 -0
- package/{schematics/ng-update/upgrade-rules/class-names/classNamesIdentifierRule.d.ts → typings/schematics/ng-update/upgrade-rules/class-names-rule.d.ts} +7 -7
- package/typings/schematics/ng-update/upgrade-rules/constructor-signature-rule.d.ts +29 -0
- package/typings/schematics/ng-update/upgrade-rules/css-selectors-rule.d.ts +25 -0
- package/typings/schematics/ng-update/upgrade-rules/element-selectors-rule.d.ts +25 -0
- package/typings/schematics/ng-update/upgrade-rules/index.d.ts +13 -4
- package/typings/schematics/ng-update/upgrade-rules/input-names-rule.d.ts +26 -0
- package/typings/schematics/ng-update/upgrade-rules/{signature-check/methodCallsCheckRule.d.ts → method-call-arguments-rule.d.ts} +8 -9
- package/typings/schematics/ng-update/upgrade-rules/misc-template-rule.d.ts +18 -0
- package/typings/schematics/ng-update/upgrade-rules/output-names-rule.d.ts +22 -0
- package/typings/schematics/ng-update/upgrade-rules/property-names-rule.d.ts +22 -0
- package/typings/schematics/update-tool/component-resource-collector.d.ts +41 -0
- package/typings/schematics/update-tool/index.d.ts +13 -0
- package/typings/schematics/update-tool/migration-rule.d.ts +45 -0
- package/typings/schematics/update-tool/public-api.d.ts +12 -0
- package/typings/schematics/{ng-update → update-tool}/target-version.d.ts +3 -3
- package/typings/schematics/update-tool/utils/decorators.d.ts +23 -0
- package/typings/schematics/update-tool/utils/functions.d.ts +14 -0
- package/typings/schematics/update-tool/utils/imports.d.ts +15 -0
- package/typings/schematics/update-tool/utils/line-mappings.d.ts +21 -0
- package/typings/schematics/update-tool/utils/parse-tsconfig.d.ts +9 -0
- package/typings/schematics/update-tool/utils/property-name.d.ts +18 -0
- package/typings/schematics/update-tool/version-changes.d.ts +32 -0
- package/typings/schematics/{ng-update/upgrade-rules → utils}/project-tsconfig-paths.d.ts +4 -1
- package/schematics/ng-update/target-version.js.map +0 -1
- package/schematics/ng-update/tslint/component-file.d.ts +0 -14
- package/schematics/ng-update/tslint/component-file.js +0 -31
- package/schematics/ng-update/tslint/component-file.js.map +0 -1
- package/schematics/ng-update/tslint/component-walker.d.ts +0 -47
- package/schematics/ng-update/tslint/component-walker.js +0 -142
- package/schematics/ng-update/tslint/component-walker.js.map +0 -1
- package/schematics/ng-update/tslint/external-failure-walker.d.ts +0 -25
- package/schematics/ng-update/tslint/external-failure-walker.js +0 -38
- package/schematics/ng-update/tslint/external-failure-walker.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStringLiteralRule.d.ts +0 -16
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStringLiteralRule.js +0 -49
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStringLiteralRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStylesheetRule.d.ts +0 -31
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStylesheetRule.js +0 -62
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStylesheetRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsTemplateRule.d.ts +0 -30
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsTemplateRule.js +0 -59
- package/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsTemplateRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/class-inheritance/classInheritanceCheckRule.d.ts +0 -26
- package/schematics/ng-update/upgrade-rules/class-inheritance/classInheritanceCheckRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/class-names/classNamesIdentifierRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStringLiteralRule.d.ts +0 -24
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStringLiteralRule.js +0 -53
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStringLiteralRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStylesheetRule.d.ts +0 -31
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStylesheetRule.js +0 -63
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStylesheetRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsTemplateRule.d.ts +0 -30
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsTemplateRule.js +0 -62
- package/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsTemplateRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStringLiteralRule.d.ts +0 -24
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStringLiteralRule.js +0 -50
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStringLiteralRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStylesheetRule.d.ts +0 -31
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStylesheetRule.js +0 -60
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStylesheetRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsTemplateRule.d.ts +0 -30
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsTemplateRule.js +0 -59
- package/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsTemplateRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/input-names/inputNamesStylesheetRule.d.ts +0 -36
- package/schematics/ng-update/upgrade-rules/input-names/inputNamesStylesheetRule.js +0 -67
- package/schematics/ng-update/upgrade-rules/input-names/inputNamesStylesheetRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/input-names/inputNamesTemplateRule.d.ts +0 -30
- package/schematics/ng-update/upgrade-rules/input-names/inputNamesTemplateRule.js +0 -67
- package/schematics/ng-update/upgrade-rules/input-names/inputNamesTemplateRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/misc-checks/checkTemplateMiscRule.d.ts +0 -23
- package/schematics/ng-update/upgrade-rules/misc-checks/checkTemplateMiscRule.js +0 -49
- package/schematics/ng-update/upgrade-rules/misc-checks/checkTemplateMiscRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/output-names/outputNamesTemplateRule.d.ts +0 -30
- package/schematics/ng-update/upgrade-rules/output-names/outputNamesTemplateRule.js +0 -67
- package/schematics/ng-update/upgrade-rules/output-names/outputNamesTemplateRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/project-tsconfig-paths.js +0 -64
- package/schematics/ng-update/upgrade-rules/project-tsconfig-paths.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/property-names/propertyNamesAccessRule.d.ts +0 -22
- package/schematics/ng-update/upgrade-rules/property-names/propertyNamesAccessRule.js +0 -46
- package/schematics/ng-update/upgrade-rules/property-names/propertyNamesAccessRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.d.ts +0 -16
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js +0 -132
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/signature-check/methodCallsCheckRule.js +0 -58
- package/schematics/ng-update/upgrade-rules/signature-check/methodCallsCheckRule.js.map +0 -1
- package/schematics/ng-update/upgrade-rules/tslint-config.d.ts +0 -32
- package/schematics/ng-update/upgrade-rules/tslint-config.js +0 -76
- package/schematics/ng-update/upgrade-rules/tslint-config.js.map +0 -1
- package/typings/schematics/ng-update/tslint/component-file.d.ts +0 -14
- package/typings/schematics/ng-update/tslint/component-walker.d.ts +0 -47
- package/typings/schematics/ng-update/tslint/external-failure-walker.d.ts +0 -25
- package/typings/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStringLiteralRule.d.ts +0 -16
- package/typings/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsStylesheetRule.d.ts +0 -31
- package/typings/schematics/ng-update/upgrade-rules/attribute-selectors/attributeSelectorsTemplateRule.d.ts +0 -30
- package/typings/schematics/ng-update/upgrade-rules/class-inheritance/classInheritanceCheckRule.d.ts +0 -26
- package/typings/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStringLiteralRule.d.ts +0 -24
- package/typings/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsStylesheetRule.d.ts +0 -31
- package/typings/schematics/ng-update/upgrade-rules/css-selectors/cssSelectorsTemplateRule.d.ts +0 -30
- package/typings/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStringLiteralRule.d.ts +0 -24
- package/typings/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsStylesheetRule.d.ts +0 -31
- package/typings/schematics/ng-update/upgrade-rules/element-selectors/elementSelectorsTemplateRule.d.ts +0 -30
- package/typings/schematics/ng-update/upgrade-rules/input-names/inputNamesStylesheetRule.d.ts +0 -36
- package/typings/schematics/ng-update/upgrade-rules/input-names/inputNamesTemplateRule.d.ts +0 -30
- package/typings/schematics/ng-update/upgrade-rules/misc-checks/checkTemplateMiscRule.d.ts +0 -23
- package/typings/schematics/ng-update/upgrade-rules/output-names/outputNamesTemplateRule.d.ts +0 -30
- package/typings/schematics/ng-update/upgrade-rules/property-names/propertyNamesAccessRule.d.ts +0 -22
- package/typings/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.d.ts +0 -16
- package/typings/schematics/ng-update/upgrade-rules/tslint-config.d.ts +0 -32
package/esm5/drag-drop.es5.js
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
9
9
|
import { coerceBooleanProperty, coerceElement, coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';
|
|
10
|
-
import { Subscription, Subject, Observable, merge } from 'rxjs';
|
|
10
|
+
import { Subscription, Subject, interval, animationFrameScheduler, Observable, merge } from 'rxjs';
|
|
11
|
+
import { startWith, takeUntil, take, map, switchMap, tap } from 'rxjs/operators';
|
|
11
12
|
import { ElementRef, Injectable, NgZone, Inject, InjectionToken, NgModule, ContentChildren, EventEmitter, forwardRef, Input, Output, Optional, Directive, ChangeDetectorRef, SkipSelf, ContentChild, ViewContainerRef, isDevMode, TemplateRef, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
|
|
12
13
|
import { DOCUMENT } from '@angular/common';
|
|
13
14
|
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
14
15
|
import { Directionality } from '@angular/cdk/bidi';
|
|
15
|
-
import { startWith, take, map, takeUntil, switchMap, tap } from 'rxjs/operators';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @fileoverview added by tsickle
|
|
@@ -180,6 +180,10 @@ DragRef = /** @class */ (function () {
|
|
|
180
180
|
* Subscription to the event that is dispatched when the user lifts their pointer.
|
|
181
181
|
*/
|
|
182
182
|
this._pointerUpSubscription = Subscription.EMPTY;
|
|
183
|
+
/**
|
|
184
|
+
* Subscription to the viewport being scrolled.
|
|
185
|
+
*/
|
|
186
|
+
this._scrollSubscription = Subscription.EMPTY;
|
|
183
187
|
/**
|
|
184
188
|
* Cached reference to the boundary element.
|
|
185
189
|
*/
|
|
@@ -289,12 +293,23 @@ DragRef = /** @class */ (function () {
|
|
|
289
293
|
// direction. Note that this is preferrable over doing something like `skip(minimumDistance)`
|
|
290
294
|
// in the `pointerMove` subscription, because we're not guaranteed to have one move event
|
|
291
295
|
// per pixel of movement (e.g. if the user moves their pointer quickly).
|
|
292
|
-
if (isOverThreshold
|
|
293
|
-
|
|
294
|
-
_this.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
if (isOverThreshold) {
|
|
297
|
+
/** @type {?} */
|
|
298
|
+
var isDelayElapsed = Date.now() >= _this._dragStartTime + (_this.dragStartDelay || 0);
|
|
299
|
+
if (!isDelayElapsed) {
|
|
300
|
+
_this._endDragSequence(event);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
// Prevent other drag sequences from starting while something in the container is still
|
|
304
|
+
// being dragged. This can happen while we're waiting for the drop animation to finish
|
|
305
|
+
// and can cause errors, because some elements might still be moving around.
|
|
306
|
+
if (!_this._dropContainer || !_this._dropContainer.isDragging()) {
|
|
307
|
+
_this._hasStartedDragging = true;
|
|
308
|
+
_this._ngZone.run((/**
|
|
309
|
+
* @return {?}
|
|
310
|
+
*/
|
|
311
|
+
function () { return _this._startDragSequence(event); }));
|
|
312
|
+
}
|
|
298
313
|
}
|
|
299
314
|
return;
|
|
300
315
|
}
|
|
@@ -355,47 +370,7 @@ DragRef = /** @class */ (function () {
|
|
|
355
370
|
* @return {?}
|
|
356
371
|
*/
|
|
357
372
|
function (event) {
|
|
358
|
-
|
|
359
|
-
// The difference is that the one from the service reflects whether a dragging sequence
|
|
360
|
-
// has been initiated, whereas the one on `this` includes whether the user has passed
|
|
361
|
-
// the minimum dragging threshold.
|
|
362
|
-
if (!_this._dragDropRegistry.isDragging(_this)) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
_this._removeSubscriptions();
|
|
366
|
-
_this._dragDropRegistry.stopDragging(_this);
|
|
367
|
-
if (_this._handles) {
|
|
368
|
-
_this._rootElement.style.webkitTapHighlightColor = _this._rootElementTapHighlight;
|
|
369
|
-
}
|
|
370
|
-
if (!_this._hasStartedDragging) {
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
_this.released.next({ source: _this });
|
|
374
|
-
if (!_this._dropContainer) {
|
|
375
|
-
// Convert the active transform into a passive one. This means that next time
|
|
376
|
-
// the user starts dragging the item, its position will be calculated relatively
|
|
377
|
-
// to the new passive transform.
|
|
378
|
-
_this._passiveTransform.x = _this._activeTransform.x;
|
|
379
|
-
_this._passiveTransform.y = _this._activeTransform.y;
|
|
380
|
-
_this._ngZone.run((/**
|
|
381
|
-
* @return {?}
|
|
382
|
-
*/
|
|
383
|
-
function () {
|
|
384
|
-
_this.ended.next({
|
|
385
|
-
source: _this,
|
|
386
|
-
distance: _this._getDragDistance(_this._getPointerPositionOnPage(event))
|
|
387
|
-
});
|
|
388
|
-
}));
|
|
389
|
-
_this._dragDropRegistry.stopDragging(_this);
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
_this._animatePreviewToPlaceholder().then((/**
|
|
393
|
-
* @return {?}
|
|
394
|
-
*/
|
|
395
|
-
function () {
|
|
396
|
-
_this._cleanupDragArtifacts(event);
|
|
397
|
-
_this._dragDropRegistry.stopDragging(_this);
|
|
398
|
-
}));
|
|
373
|
+
_this._endDragSequence(event);
|
|
399
374
|
});
|
|
400
375
|
this.withRootElement(element);
|
|
401
376
|
_dragDropRegistry.registerDragItem(this);
|
|
@@ -727,7 +702,9 @@ DragRef = /** @class */ (function () {
|
|
|
727
702
|
* @return {?}
|
|
728
703
|
*/
|
|
729
704
|
function () {
|
|
730
|
-
|
|
705
|
+
/** @type {?} */
|
|
706
|
+
var position = this.isDragging() ? this._activeTransform : this._passiveTransform;
|
|
707
|
+
return { x: position.x, y: position.y };
|
|
731
708
|
};
|
|
732
709
|
/**
|
|
733
710
|
* Sets the current position in pixels the draggable outside of a drop container.
|
|
@@ -756,6 +733,22 @@ DragRef = /** @class */ (function () {
|
|
|
756
733
|
}
|
|
757
734
|
return (/** @type {?} */ (this));
|
|
758
735
|
};
|
|
736
|
+
/** Updates the item's sort order based on the last-known pointer position. */
|
|
737
|
+
/**
|
|
738
|
+
* Updates the item's sort order based on the last-known pointer position.
|
|
739
|
+
* @return {?}
|
|
740
|
+
*/
|
|
741
|
+
DragRef.prototype._sortFromLastPointerPosition = /**
|
|
742
|
+
* Updates the item's sort order based on the last-known pointer position.
|
|
743
|
+
* @return {?}
|
|
744
|
+
*/
|
|
745
|
+
function () {
|
|
746
|
+
/** @type {?} */
|
|
747
|
+
var position = this._pointerPositionAtLastDirectionChange;
|
|
748
|
+
if (position && this._dropContainer) {
|
|
749
|
+
this._updateActiveDropContainer(position);
|
|
750
|
+
}
|
|
751
|
+
};
|
|
759
752
|
/** Unsubscribes from the global subscriptions. */
|
|
760
753
|
/**
|
|
761
754
|
* Unsubscribes from the global subscriptions.
|
|
@@ -770,6 +763,7 @@ DragRef = /** @class */ (function () {
|
|
|
770
763
|
function () {
|
|
771
764
|
this._pointerMoveSubscription.unsubscribe();
|
|
772
765
|
this._pointerUpSubscription.unsubscribe();
|
|
766
|
+
this._scrollSubscription.unsubscribe();
|
|
773
767
|
};
|
|
774
768
|
/** Destroys the preview element and its ViewRef. */
|
|
775
769
|
/**
|
|
@@ -811,6 +805,69 @@ DragRef = /** @class */ (function () {
|
|
|
811
805
|
}
|
|
812
806
|
this._placeholder = this._placeholderRef = (/** @type {?} */ (null));
|
|
813
807
|
};
|
|
808
|
+
/**
|
|
809
|
+
* Clears subscriptions and stops the dragging sequence.
|
|
810
|
+
* @param event Browser event object that ended the sequence.
|
|
811
|
+
*/
|
|
812
|
+
/**
|
|
813
|
+
* Clears subscriptions and stops the dragging sequence.
|
|
814
|
+
* @private
|
|
815
|
+
* @param {?} event Browser event object that ended the sequence.
|
|
816
|
+
* @return {?}
|
|
817
|
+
*/
|
|
818
|
+
DragRef.prototype._endDragSequence = /**
|
|
819
|
+
* Clears subscriptions and stops the dragging sequence.
|
|
820
|
+
* @private
|
|
821
|
+
* @param {?} event Browser event object that ended the sequence.
|
|
822
|
+
* @return {?}
|
|
823
|
+
*/
|
|
824
|
+
function (event) {
|
|
825
|
+
var _this = this;
|
|
826
|
+
// Note that here we use `isDragging` from the service, rather than from `this`.
|
|
827
|
+
// The difference is that the one from the service reflects whether a dragging sequence
|
|
828
|
+
// has been initiated, whereas the one on `this` includes whether the user has passed
|
|
829
|
+
// the minimum dragging threshold.
|
|
830
|
+
if (!this._dragDropRegistry.isDragging(this)) {
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
this._removeSubscriptions();
|
|
834
|
+
this._dragDropRegistry.stopDragging(this);
|
|
835
|
+
if (this._handles) {
|
|
836
|
+
this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight;
|
|
837
|
+
}
|
|
838
|
+
if (!this._hasStartedDragging) {
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
this.released.next({ source: this });
|
|
842
|
+
if (this._dropContainer) {
|
|
843
|
+
// Stop scrolling immediately, instead of waiting for the animation to finish.
|
|
844
|
+
this._dropContainer._stopScrolling();
|
|
845
|
+
this._animatePreviewToPlaceholder().then((/**
|
|
846
|
+
* @return {?}
|
|
847
|
+
*/
|
|
848
|
+
function () {
|
|
849
|
+
_this._cleanupDragArtifacts(event);
|
|
850
|
+
_this._dragDropRegistry.stopDragging(_this);
|
|
851
|
+
}));
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
// Convert the active transform into a passive one. This means that next time
|
|
855
|
+
// the user starts dragging the item, its position will be calculated relatively
|
|
856
|
+
// to the new passive transform.
|
|
857
|
+
this._passiveTransform.x = this._activeTransform.x;
|
|
858
|
+
this._passiveTransform.y = this._activeTransform.y;
|
|
859
|
+
this._ngZone.run((/**
|
|
860
|
+
* @return {?}
|
|
861
|
+
*/
|
|
862
|
+
function () {
|
|
863
|
+
_this.ended.next({
|
|
864
|
+
source: _this,
|
|
865
|
+
distance: _this._getDragDistance(_this._getPointerPositionOnPage(event))
|
|
866
|
+
});
|
|
867
|
+
}));
|
|
868
|
+
this._dragDropRegistry.stopDragging(this);
|
|
869
|
+
}
|
|
870
|
+
};
|
|
814
871
|
/** Starts the dragging sequence. */
|
|
815
872
|
/**
|
|
816
873
|
* Starts the dragging sequence.
|
|
@@ -830,6 +887,7 @@ DragRef = /** @class */ (function () {
|
|
|
830
887
|
if (isTouchEvent(event)) {
|
|
831
888
|
this._lastTouchEventTime = Date.now();
|
|
832
889
|
}
|
|
890
|
+
this._toggleNativeDragInteractions();
|
|
833
891
|
if (this._dropContainer) {
|
|
834
892
|
/** @type {?} */
|
|
835
893
|
var element = this._rootElement;
|
|
@@ -872,6 +930,7 @@ DragRef = /** @class */ (function () {
|
|
|
872
930
|
* @return {?}
|
|
873
931
|
*/
|
|
874
932
|
function (referenceElement, event) {
|
|
933
|
+
var _this = this;
|
|
875
934
|
// Always stop propagation for the event that initializes
|
|
876
935
|
// the dragging sequence, in order to prevent it from potentially
|
|
877
936
|
// starting another sequence for a draggable parent somewhere up the DOM tree.
|
|
@@ -907,12 +966,19 @@ DragRef = /** @class */ (function () {
|
|
|
907
966
|
this._rootElementTapHighlight = rootElement.style.webkitTapHighlightColor;
|
|
908
967
|
rootElement.style.webkitTapHighlightColor = 'transparent';
|
|
909
968
|
}
|
|
910
|
-
this._toggleNativeDragInteractions();
|
|
911
969
|
this._hasStartedDragging = this._hasMoved = false;
|
|
912
970
|
this._initialContainer = (/** @type {?} */ (this._dropContainer));
|
|
971
|
+
// Avoid multiple subscriptions and memory leaks when multi touch
|
|
972
|
+
// (isDragging check above isn't enough because of possible temporal and/or dimensional delays)
|
|
973
|
+
this._removeSubscriptions();
|
|
913
974
|
this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);
|
|
914
975
|
this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);
|
|
915
|
-
this.
|
|
976
|
+
this._scrollSubscription = this._dragDropRegistry.scroll.pipe(startWith(null)).subscribe((/**
|
|
977
|
+
* @return {?}
|
|
978
|
+
*/
|
|
979
|
+
function () {
|
|
980
|
+
_this._scrollPosition = _this._viewportRuler.getViewportScrollPosition();
|
|
981
|
+
}));
|
|
916
982
|
if (this._boundaryElement) {
|
|
917
983
|
this._boundaryRect = this._boundaryElement.getBoundingClientRect();
|
|
918
984
|
}
|
|
@@ -1036,6 +1102,7 @@ DragRef = /** @class */ (function () {
|
|
|
1036
1102
|
});
|
|
1037
1103
|
}));
|
|
1038
1104
|
}
|
|
1105
|
+
(/** @type {?} */ (this._dropContainer))._startScrollingIfNecessary(x, y);
|
|
1039
1106
|
(/** @type {?} */ (this._dropContainer))._sortItem(this, x, y, this._pointerDirectionDelta);
|
|
1040
1107
|
this._preview.style.transform =
|
|
1041
1108
|
getTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);
|
|
@@ -1264,7 +1331,7 @@ DragRef = /** @class */ (function () {
|
|
|
1264
1331
|
/** @type {?} */
|
|
1265
1332
|
var point = this._getPointerPositionOnPage(event);
|
|
1266
1333
|
/** @type {?} */
|
|
1267
|
-
var constrainedPoint = this.constrainPosition ? this.constrainPosition(point) : point;
|
|
1334
|
+
var constrainedPoint = this.constrainPosition ? this.constrainPosition(point, this) : point;
|
|
1268
1335
|
/** @type {?} */
|
|
1269
1336
|
var dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;
|
|
1270
1337
|
if (this.lockAxis === 'x' || dropContainerLock === 'x') {
|
|
@@ -1346,7 +1413,7 @@ DragRef = /** @class */ (function () {
|
|
|
1346
1413
|
return;
|
|
1347
1414
|
}
|
|
1348
1415
|
/** @type {?} */
|
|
1349
|
-
var shouldEnable = this.
|
|
1416
|
+
var shouldEnable = this._handles.length > 0 || !this.isDragging();
|
|
1350
1417
|
if (shouldEnable !== this._nativeInteractionsEnabled) {
|
|
1351
1418
|
this._nativeInteractionsEnabled = shouldEnable;
|
|
1352
1419
|
toggleNativeDragInteractions(this._rootElement, shouldEnable);
|
|
@@ -1497,7 +1564,10 @@ function removeElement(element) {
|
|
|
1497
1564
|
* @return {?}
|
|
1498
1565
|
*/
|
|
1499
1566
|
function isTouchEvent(event) {
|
|
1500
|
-
|
|
1567
|
+
// This function is called for every pixel that the user has dragged so we need it to be
|
|
1568
|
+
// as fast as possible. Since we only bind mouse events and touch events, we can assume
|
|
1569
|
+
// that if the event's name starts with `t`, it's a touch event.
|
|
1570
|
+
return event.type[0] === 't';
|
|
1501
1571
|
}
|
|
1502
1572
|
/**
|
|
1503
1573
|
* Gets the element into which the drag preview should be inserted.
|
|
@@ -1606,6 +1676,18 @@ var _uniqueIdCounter = 0;
|
|
|
1606
1676
|
* @type {?}
|
|
1607
1677
|
*/
|
|
1608
1678
|
var DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
1679
|
+
/**
|
|
1680
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
1681
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
1682
|
+
* @type {?}
|
|
1683
|
+
*/
|
|
1684
|
+
var SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
1685
|
+
/**
|
|
1686
|
+
* Number of pixels to scroll for each frame when auto-scrolling an element.
|
|
1687
|
+
* The value comes from trying it out manually until it feels right.
|
|
1688
|
+
* @type {?}
|
|
1689
|
+
*/
|
|
1690
|
+
var AUTO_SCROLL_STEP = 2;
|
|
1609
1691
|
/**
|
|
1610
1692
|
* Reference to a drop list. Used to manipulate or dispose of the container.
|
|
1611
1693
|
* \@docs-private
|
|
@@ -1617,8 +1699,11 @@ var /**
|
|
|
1617
1699
|
* @template T
|
|
1618
1700
|
*/
|
|
1619
1701
|
DropListRef = /** @class */ (function () {
|
|
1620
|
-
function DropListRef(element, _dragDropRegistry, _document) {
|
|
1702
|
+
function DropListRef(element, _dragDropRegistry, _document, _ngZone, _viewportRuler) {
|
|
1703
|
+
var _this = this;
|
|
1621
1704
|
this._dragDropRegistry = _dragDropRegistry;
|
|
1705
|
+
this._ngZone = _ngZone;
|
|
1706
|
+
this._viewportRuler = _viewportRuler;
|
|
1622
1707
|
/**
|
|
1623
1708
|
* Unique ID for the drop list.
|
|
1624
1709
|
* @deprecated No longer being used. To be removed.
|
|
@@ -1633,6 +1718,11 @@ DropListRef = /** @class */ (function () {
|
|
|
1633
1718
|
* Whether sorting items within the list is disabled.
|
|
1634
1719
|
*/
|
|
1635
1720
|
this.sortingDisabled = true;
|
|
1721
|
+
/**
|
|
1722
|
+
* Whether auto-scrolling the view when the user
|
|
1723
|
+
* moves their pointer close to the edges is disabled.
|
|
1724
|
+
*/
|
|
1725
|
+
this.autoScrollDisabled = false;
|
|
1636
1726
|
/**
|
|
1637
1727
|
* Function that is used to determine whether an item
|
|
1638
1728
|
* is allowed to be moved into a drop container.
|
|
@@ -1670,6 +1760,14 @@ DropListRef = /** @class */ (function () {
|
|
|
1670
1760
|
* Cache of the dimensions of all the items inside the container.
|
|
1671
1761
|
*/
|
|
1672
1762
|
this._itemPositions = [];
|
|
1763
|
+
/**
|
|
1764
|
+
* Keeps track of the container's scroll position.
|
|
1765
|
+
*/
|
|
1766
|
+
this._scrollPosition = { top: 0, left: 0 };
|
|
1767
|
+
/**
|
|
1768
|
+
* Keeps track of the scroll position of the viewport.
|
|
1769
|
+
*/
|
|
1770
|
+
this._viewportScrollPosition = { top: 0, left: 0 };
|
|
1673
1771
|
/**
|
|
1674
1772
|
* Keeps track of the item that was last swapped with the dragged item, as
|
|
1675
1773
|
* well as what direction the pointer was moving in when the swap occured.
|
|
@@ -1691,6 +1789,66 @@ DropListRef = /** @class */ (function () {
|
|
|
1691
1789
|
* Layout direction of the drop list.
|
|
1692
1790
|
*/
|
|
1693
1791
|
this._direction = 'ltr';
|
|
1792
|
+
/**
|
|
1793
|
+
* Subscription to the window being scrolled.
|
|
1794
|
+
*/
|
|
1795
|
+
this._viewportScrollSubscription = Subscription.EMPTY;
|
|
1796
|
+
/**
|
|
1797
|
+
* Vertical direction in which the list is currently scrolling.
|
|
1798
|
+
*/
|
|
1799
|
+
this._verticalScrollDirection = 0 /* NONE */;
|
|
1800
|
+
/**
|
|
1801
|
+
* Horizontal direction in which the list is currently scrolling.
|
|
1802
|
+
*/
|
|
1803
|
+
this._horizontalScrollDirection = 0 /* NONE */;
|
|
1804
|
+
/**
|
|
1805
|
+
* Used to signal to the current auto-scroll sequence when to stop.
|
|
1806
|
+
*/
|
|
1807
|
+
this._stopScrollTimers = new Subject();
|
|
1808
|
+
/**
|
|
1809
|
+
* Handles the container being scrolled. Has to be an arrow function to preserve the context.
|
|
1810
|
+
*/
|
|
1811
|
+
this._handleScroll = (/**
|
|
1812
|
+
* @return {?}
|
|
1813
|
+
*/
|
|
1814
|
+
function () {
|
|
1815
|
+
if (!_this.isDragging()) {
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
/** @type {?} */
|
|
1819
|
+
var element = coerceElement(_this.element);
|
|
1820
|
+
_this._updateAfterScroll(_this._scrollPosition, element.scrollTop, element.scrollLeft);
|
|
1821
|
+
});
|
|
1822
|
+
/**
|
|
1823
|
+
* Starts the interval that'll auto-scroll the element.
|
|
1824
|
+
*/
|
|
1825
|
+
this._startScrollInterval = (/**
|
|
1826
|
+
* @return {?}
|
|
1827
|
+
*/
|
|
1828
|
+
function () {
|
|
1829
|
+
_this._stopScrolling();
|
|
1830
|
+
interval(0, animationFrameScheduler)
|
|
1831
|
+
.pipe(takeUntil(_this._stopScrollTimers))
|
|
1832
|
+
.subscribe((/**
|
|
1833
|
+
* @return {?}
|
|
1834
|
+
*/
|
|
1835
|
+
function () {
|
|
1836
|
+
/** @type {?} */
|
|
1837
|
+
var node = _this._scrollNode;
|
|
1838
|
+
if (_this._verticalScrollDirection === 1 /* UP */) {
|
|
1839
|
+
incrementVerticalScroll(node, -AUTO_SCROLL_STEP);
|
|
1840
|
+
}
|
|
1841
|
+
else if (_this._verticalScrollDirection === 2 /* DOWN */) {
|
|
1842
|
+
incrementVerticalScroll(node, AUTO_SCROLL_STEP);
|
|
1843
|
+
}
|
|
1844
|
+
if (_this._horizontalScrollDirection === 1 /* LEFT */) {
|
|
1845
|
+
incrementHorizontalScroll(node, -AUTO_SCROLL_STEP);
|
|
1846
|
+
}
|
|
1847
|
+
else if (_this._horizontalScrollDirection === 2 /* RIGHT */) {
|
|
1848
|
+
incrementHorizontalScroll(node, AUTO_SCROLL_STEP);
|
|
1849
|
+
}
|
|
1850
|
+
}));
|
|
1851
|
+
});
|
|
1694
1852
|
_dragDropRegistry.registerDropContainer(this);
|
|
1695
1853
|
this._document = _document;
|
|
1696
1854
|
this.element = element instanceof ElementRef ? element.nativeElement : element;
|
|
@@ -1705,12 +1863,16 @@ DropListRef = /** @class */ (function () {
|
|
|
1705
1863
|
* @return {?}
|
|
1706
1864
|
*/
|
|
1707
1865
|
function () {
|
|
1866
|
+
this._stopScrolling();
|
|
1867
|
+
this._stopScrollTimers.complete();
|
|
1868
|
+
this._removeListeners();
|
|
1708
1869
|
this.beforeStarted.complete();
|
|
1709
1870
|
this.entered.complete();
|
|
1710
1871
|
this.exited.complete();
|
|
1711
1872
|
this.dropped.complete();
|
|
1712
1873
|
this.sorted.complete();
|
|
1713
1874
|
this._activeSiblings.clear();
|
|
1875
|
+
this._scrollNode = (/** @type {?} */ (null));
|
|
1714
1876
|
this._dragDropRegistry.removeDropContainer(this);
|
|
1715
1877
|
};
|
|
1716
1878
|
/** Whether an item from this list is currently being dragged. */
|
|
@@ -1736,6 +1898,8 @@ DropListRef = /** @class */ (function () {
|
|
|
1736
1898
|
*/
|
|
1737
1899
|
function () {
|
|
1738
1900
|
var _this = this;
|
|
1901
|
+
/** @type {?} */
|
|
1902
|
+
var element = coerceElement(this.element);
|
|
1739
1903
|
this.beforeStarted.next();
|
|
1740
1904
|
this._isDragging = true;
|
|
1741
1905
|
this._cacheItems();
|
|
@@ -1744,6 +1908,31 @@ DropListRef = /** @class */ (function () {
|
|
|
1744
1908
|
* @return {?}
|
|
1745
1909
|
*/
|
|
1746
1910
|
function (sibling) { return sibling._startReceiving(_this); }));
|
|
1911
|
+
this._removeListeners();
|
|
1912
|
+
// @breaking-change 9.0.0 Remove check for _ngZone once it's marked as a required param.
|
|
1913
|
+
if (this._ngZone) {
|
|
1914
|
+
this._ngZone.runOutsideAngular((/**
|
|
1915
|
+
* @return {?}
|
|
1916
|
+
*/
|
|
1917
|
+
function () { return element.addEventListener('scroll', _this._handleScroll); }));
|
|
1918
|
+
}
|
|
1919
|
+
else {
|
|
1920
|
+
element.addEventListener('scroll', this._handleScroll);
|
|
1921
|
+
}
|
|
1922
|
+
// @breaking-change 9.0.0 Remove check for _viewportRuler once it's marked as a required param.
|
|
1923
|
+
if (this._viewportRuler) {
|
|
1924
|
+
this._viewportScrollPosition = this._viewportRuler.getViewportScrollPosition();
|
|
1925
|
+
this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe((/**
|
|
1926
|
+
* @return {?}
|
|
1927
|
+
*/
|
|
1928
|
+
function () {
|
|
1929
|
+
if (_this.isDragging()) {
|
|
1930
|
+
/** @type {?} */
|
|
1931
|
+
var newPosition = (/** @type {?} */ (_this._viewportRuler)).getViewportScrollPosition();
|
|
1932
|
+
_this._updateAfterScroll(_this._viewportScrollPosition, newPosition.top, newPosition.left, _this._clientRect);
|
|
1933
|
+
}
|
|
1934
|
+
}));
|
|
1935
|
+
}
|
|
1747
1936
|
};
|
|
1748
1937
|
/**
|
|
1749
1938
|
* Emits an event to indicate that the user moved an item into the container.
|
|
@@ -2127,6 +2316,91 @@ DropListRef = /** @class */ (function () {
|
|
|
2127
2316
|
}
|
|
2128
2317
|
}));
|
|
2129
2318
|
};
|
|
2319
|
+
/**
|
|
2320
|
+
* Checks whether the user's pointer is close to the edges of either the
|
|
2321
|
+
* viewport or the drop list and starts the auto-scroll sequence.
|
|
2322
|
+
* @param pointerX User's pointer position along the x axis.
|
|
2323
|
+
* @param pointerY User's pointer position along the y axis.
|
|
2324
|
+
*/
|
|
2325
|
+
/**
|
|
2326
|
+
* Checks whether the user's pointer is close to the edges of either the
|
|
2327
|
+
* viewport or the drop list and starts the auto-scroll sequence.
|
|
2328
|
+
* @param {?} pointerX User's pointer position along the x axis.
|
|
2329
|
+
* @param {?} pointerY User's pointer position along the y axis.
|
|
2330
|
+
* @return {?}
|
|
2331
|
+
*/
|
|
2332
|
+
DropListRef.prototype._startScrollingIfNecessary = /**
|
|
2333
|
+
* Checks whether the user's pointer is close to the edges of either the
|
|
2334
|
+
* viewport or the drop list and starts the auto-scroll sequence.
|
|
2335
|
+
* @param {?} pointerX User's pointer position along the x axis.
|
|
2336
|
+
* @param {?} pointerY User's pointer position along the y axis.
|
|
2337
|
+
* @return {?}
|
|
2338
|
+
*/
|
|
2339
|
+
function (pointerX, pointerY) {
|
|
2340
|
+
if (this.autoScrollDisabled) {
|
|
2341
|
+
return;
|
|
2342
|
+
}
|
|
2343
|
+
/** @type {?} */
|
|
2344
|
+
var scrollNode;
|
|
2345
|
+
/** @type {?} */
|
|
2346
|
+
var verticalScrollDirection = 0 /* NONE */;
|
|
2347
|
+
/** @type {?} */
|
|
2348
|
+
var horizontalScrollDirection = 0 /* NONE */;
|
|
2349
|
+
// @breaking-change 9.0.0 Remove null check for _viewportRuler once it's a required parameter.
|
|
2350
|
+
// Check whether we're in range to scroll the viewport.
|
|
2351
|
+
if (this._viewportRuler) {
|
|
2352
|
+
var _a = this._viewportRuler.getViewportSize(), width = _a.width, height = _a.height;
|
|
2353
|
+
/** @type {?} */
|
|
2354
|
+
var clientRect = { width: width, height: height, top: 0, right: width, bottom: height, left: 0 };
|
|
2355
|
+
verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);
|
|
2356
|
+
horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
2357
|
+
scrollNode = window;
|
|
2358
|
+
}
|
|
2359
|
+
// If we couldn't find a scroll direction based on the
|
|
2360
|
+
// window, try with the container, if the pointer is close by.
|
|
2361
|
+
if (!verticalScrollDirection && !horizontalScrollDirection &&
|
|
2362
|
+
this._isPointerNearDropContainer(pointerX, pointerY)) {
|
|
2363
|
+
verticalScrollDirection = getVerticalScrollDirection(this._clientRect, pointerY);
|
|
2364
|
+
horizontalScrollDirection = getHorizontalScrollDirection(this._clientRect, pointerX);
|
|
2365
|
+
scrollNode = coerceElement(this.element);
|
|
2366
|
+
}
|
|
2367
|
+
// TODO(crisbeto): we also need to account for whether the view or element are scrollable in
|
|
2368
|
+
// the first place. With the current approach we'll still try to scroll them, but it just
|
|
2369
|
+
// won't do anything. The only case where this is relevant is that if we have a scrollable
|
|
2370
|
+
// list close to the viewport edge where the viewport isn't scrollable. In this case the
|
|
2371
|
+
// we'll be trying to scroll the viewport rather than the list.
|
|
2372
|
+
if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection ||
|
|
2373
|
+
horizontalScrollDirection !== this._horizontalScrollDirection ||
|
|
2374
|
+
scrollNode !== this._scrollNode)) {
|
|
2375
|
+
this._verticalScrollDirection = verticalScrollDirection;
|
|
2376
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
2377
|
+
this._scrollNode = scrollNode;
|
|
2378
|
+
if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {
|
|
2379
|
+
// @breaking-change 9.0.0 Remove null check for `_ngZone` once it is made required.
|
|
2380
|
+
if (this._ngZone) {
|
|
2381
|
+
this._ngZone.runOutsideAngular(this._startScrollInterval);
|
|
2382
|
+
}
|
|
2383
|
+
else {
|
|
2384
|
+
this._startScrollInterval();
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
else {
|
|
2388
|
+
this._stopScrolling();
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
};
|
|
2392
|
+
/** Stops any currently-running auto-scroll sequences. */
|
|
2393
|
+
/**
|
|
2394
|
+
* Stops any currently-running auto-scroll sequences.
|
|
2395
|
+
* @return {?}
|
|
2396
|
+
*/
|
|
2397
|
+
DropListRef.prototype._stopScrolling = /**
|
|
2398
|
+
* Stops any currently-running auto-scroll sequences.
|
|
2399
|
+
* @return {?}
|
|
2400
|
+
*/
|
|
2401
|
+
function () {
|
|
2402
|
+
this._stopScrollTimers.next();
|
|
2403
|
+
};
|
|
2130
2404
|
/** Caches the position of the drop list. */
|
|
2131
2405
|
/**
|
|
2132
2406
|
* Caches the position of the drop list.
|
|
@@ -2139,7 +2413,10 @@ DropListRef = /** @class */ (function () {
|
|
|
2139
2413
|
* @return {?}
|
|
2140
2414
|
*/
|
|
2141
2415
|
function () {
|
|
2142
|
-
|
|
2416
|
+
/** @type {?} */
|
|
2417
|
+
var element = coerceElement(this.element);
|
|
2418
|
+
this._clientRect = getMutableClientRect(element);
|
|
2419
|
+
this._scrollPosition = { top: element.scrollTop, left: element.scrollLeft };
|
|
2143
2420
|
};
|
|
2144
2421
|
/** Refreshes the position cache of the items and sibling containers. */
|
|
2145
2422
|
/**
|
|
@@ -2167,24 +2444,7 @@ DropListRef = /** @class */ (function () {
|
|
|
2167
2444
|
// placeholder, because the element is hidden.
|
|
2168
2445
|
drag.getPlaceholderElement() :
|
|
2169
2446
|
drag.getRootElement();
|
|
2170
|
-
|
|
2171
|
-
var clientRect = elementToMeasure.getBoundingClientRect();
|
|
2172
|
-
return {
|
|
2173
|
-
drag: drag,
|
|
2174
|
-
offset: 0,
|
|
2175
|
-
// We need to clone the `clientRect` here, because all the values on it are readonly
|
|
2176
|
-
// and we need to be able to update them. Also we can't use a spread here, because
|
|
2177
|
-
// the values on a `ClientRect` aren't own properties. See:
|
|
2178
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes
|
|
2179
|
-
clientRect: {
|
|
2180
|
-
top: clientRect.top,
|
|
2181
|
-
right: clientRect.right,
|
|
2182
|
-
bottom: clientRect.bottom,
|
|
2183
|
-
left: clientRect.left,
|
|
2184
|
-
width: clientRect.width,
|
|
2185
|
-
height: clientRect.height
|
|
2186
|
-
}
|
|
2187
|
-
};
|
|
2447
|
+
return { drag: drag, offset: 0, clientRect: getMutableClientRect(elementToMeasure) };
|
|
2188
2448
|
})).sort((/**
|
|
2189
2449
|
* @param {?} a
|
|
2190
2450
|
* @param {?} b
|
|
@@ -2224,6 +2484,8 @@ DropListRef = /** @class */ (function () {
|
|
|
2224
2484
|
this._itemPositions = [];
|
|
2225
2485
|
this._previousSwap.drag = null;
|
|
2226
2486
|
this._previousSwap.delta = 0;
|
|
2487
|
+
this._stopScrolling();
|
|
2488
|
+
this._removeListeners();
|
|
2227
2489
|
};
|
|
2228
2490
|
/**
|
|
2229
2491
|
* Gets the offset in pixels by which the items that aren't being dragged should be moved.
|
|
@@ -2411,6 +2673,89 @@ DropListRef = /** @class */ (function () {
|
|
|
2411
2673
|
this._cacheItemPositions();
|
|
2412
2674
|
this._cacheOwnPosition();
|
|
2413
2675
|
};
|
|
2676
|
+
/**
|
|
2677
|
+
* Updates the internal state of the container after a scroll event has happened.
|
|
2678
|
+
* @param scrollPosition Object that is keeping track of the scroll position.
|
|
2679
|
+
* @param newTop New top scroll position.
|
|
2680
|
+
* @param newLeft New left scroll position.
|
|
2681
|
+
* @param extraClientRect Extra `ClientRect` object that should be updated, in addition to the
|
|
2682
|
+
* ones of the drag items. Useful when the viewport has been scrolled and we also need to update
|
|
2683
|
+
* the `ClientRect` of the list.
|
|
2684
|
+
*/
|
|
2685
|
+
/**
|
|
2686
|
+
* Updates the internal state of the container after a scroll event has happened.
|
|
2687
|
+
* @private
|
|
2688
|
+
* @param {?} scrollPosition Object that is keeping track of the scroll position.
|
|
2689
|
+
* @param {?} newTop New top scroll position.
|
|
2690
|
+
* @param {?} newLeft New left scroll position.
|
|
2691
|
+
* @param {?=} extraClientRect Extra `ClientRect` object that should be updated, in addition to the
|
|
2692
|
+
* ones of the drag items. Useful when the viewport has been scrolled and we also need to update
|
|
2693
|
+
* the `ClientRect` of the list.
|
|
2694
|
+
* @return {?}
|
|
2695
|
+
*/
|
|
2696
|
+
DropListRef.prototype._updateAfterScroll = /**
|
|
2697
|
+
* Updates the internal state of the container after a scroll event has happened.
|
|
2698
|
+
* @private
|
|
2699
|
+
* @param {?} scrollPosition Object that is keeping track of the scroll position.
|
|
2700
|
+
* @param {?} newTop New top scroll position.
|
|
2701
|
+
* @param {?} newLeft New left scroll position.
|
|
2702
|
+
* @param {?=} extraClientRect Extra `ClientRect` object that should be updated, in addition to the
|
|
2703
|
+
* ones of the drag items. Useful when the viewport has been scrolled and we also need to update
|
|
2704
|
+
* the `ClientRect` of the list.
|
|
2705
|
+
* @return {?}
|
|
2706
|
+
*/
|
|
2707
|
+
function (scrollPosition, newTop, newLeft, extraClientRect) {
|
|
2708
|
+
var _this = this;
|
|
2709
|
+
/** @type {?} */
|
|
2710
|
+
var topDifference = scrollPosition.top - newTop;
|
|
2711
|
+
/** @type {?} */
|
|
2712
|
+
var leftDifference = scrollPosition.left - newLeft;
|
|
2713
|
+
if (extraClientRect) {
|
|
2714
|
+
adjustClientRect(extraClientRect, topDifference, leftDifference);
|
|
2715
|
+
}
|
|
2716
|
+
// Since we know the amount that the user has scrolled we can shift all of the client rectangles
|
|
2717
|
+
// ourselves. This is cheaper than re-measuring everything and we can avoid inconsistent
|
|
2718
|
+
// behavior where we might be measuring the element before its position has changed.
|
|
2719
|
+
this._itemPositions.forEach((/**
|
|
2720
|
+
* @param {?} __0
|
|
2721
|
+
* @return {?}
|
|
2722
|
+
*/
|
|
2723
|
+
function (_a) {
|
|
2724
|
+
var clientRect = _a.clientRect;
|
|
2725
|
+
adjustClientRect(clientRect, topDifference, leftDifference);
|
|
2726
|
+
}));
|
|
2727
|
+
// We need two loops for this, because we want all of the cached
|
|
2728
|
+
// positions to be up-to-date before we re-sort the item.
|
|
2729
|
+
this._itemPositions.forEach((/**
|
|
2730
|
+
* @param {?} __0
|
|
2731
|
+
* @return {?}
|
|
2732
|
+
*/
|
|
2733
|
+
function (_a) {
|
|
2734
|
+
var drag = _a.drag;
|
|
2735
|
+
if (_this._dragDropRegistry.isDragging(drag)) {
|
|
2736
|
+
// We need to re-sort the item manually, because the pointer move
|
|
2737
|
+
// events won't be dispatched while the user is scrolling.
|
|
2738
|
+
drag._sortFromLastPointerPosition();
|
|
2739
|
+
}
|
|
2740
|
+
}));
|
|
2741
|
+
scrollPosition.top = newTop;
|
|
2742
|
+
scrollPosition.left = newLeft;
|
|
2743
|
+
};
|
|
2744
|
+
/** Removes the event listeners associated with this drop list. */
|
|
2745
|
+
/**
|
|
2746
|
+
* Removes the event listeners associated with this drop list.
|
|
2747
|
+
* @private
|
|
2748
|
+
* @return {?}
|
|
2749
|
+
*/
|
|
2750
|
+
DropListRef.prototype._removeListeners = /**
|
|
2751
|
+
* Removes the event listeners associated with this drop list.
|
|
2752
|
+
* @private
|
|
2753
|
+
* @return {?}
|
|
2754
|
+
*/
|
|
2755
|
+
function () {
|
|
2756
|
+
coerceElement(this.element).removeEventListener('scroll', this._handleScroll);
|
|
2757
|
+
this._viewportScrollSubscription.unsubscribe();
|
|
2758
|
+
};
|
|
2414
2759
|
/**
|
|
2415
2760
|
* Checks whether the user's pointer is positioned over the container.
|
|
2416
2761
|
* @param x Pointer position along the X axis.
|
|
@@ -2558,7 +2903,7 @@ function adjustClientRect(clientRect, top, left) {
|
|
|
2558
2903
|
}
|
|
2559
2904
|
/**
|
|
2560
2905
|
* Finds the index of an item that matches a predicate function. Used as an equivalent
|
|
2561
|
-
* of `Array.prototype.
|
|
2906
|
+
* of `Array.prototype.findIndex` which isn't part of the standard Google typings.
|
|
2562
2907
|
* @template T
|
|
2563
2908
|
* @param {?} array Array in which to look for matches.
|
|
2564
2909
|
* @param {?} predicate Function used to determine whether an item is a match.
|
|
@@ -2583,6 +2928,93 @@ function isInsideClientRect(clientRect, x, y) {
|
|
|
2583
2928
|
var top = clientRect.top, bottom = clientRect.bottom, left = clientRect.left, right = clientRect.right;
|
|
2584
2929
|
return y >= top && y <= bottom && x >= left && x <= right;
|
|
2585
2930
|
}
|
|
2931
|
+
/**
|
|
2932
|
+
* Gets a mutable version of an element's bounding `ClientRect`.
|
|
2933
|
+
* @param {?} element
|
|
2934
|
+
* @return {?}
|
|
2935
|
+
*/
|
|
2936
|
+
function getMutableClientRect(element) {
|
|
2937
|
+
/** @type {?} */
|
|
2938
|
+
var clientRect = element.getBoundingClientRect();
|
|
2939
|
+
// We need to clone the `clientRect` here, because all the values on it are readonly
|
|
2940
|
+
// and we need to be able to update them. Also we can't use a spread here, because
|
|
2941
|
+
// the values on a `ClientRect` aren't own properties. See:
|
|
2942
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes
|
|
2943
|
+
return {
|
|
2944
|
+
top: clientRect.top,
|
|
2945
|
+
right: clientRect.right,
|
|
2946
|
+
bottom: clientRect.bottom,
|
|
2947
|
+
left: clientRect.left,
|
|
2948
|
+
width: clientRect.width,
|
|
2949
|
+
height: clientRect.height
|
|
2950
|
+
};
|
|
2951
|
+
}
|
|
2952
|
+
/**
|
|
2953
|
+
* Increments the vertical scroll position of a node.
|
|
2954
|
+
* @param {?} node Node whose scroll position should change.
|
|
2955
|
+
* @param {?} amount Amount of pixels that the `node` should be scrolled.
|
|
2956
|
+
* @return {?}
|
|
2957
|
+
*/
|
|
2958
|
+
function incrementVerticalScroll(node, amount) {
|
|
2959
|
+
if (node === window) {
|
|
2960
|
+
((/** @type {?} */ (node))).scrollBy(0, amount);
|
|
2961
|
+
}
|
|
2962
|
+
else {
|
|
2963
|
+
// Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.
|
|
2964
|
+
((/** @type {?} */ (node))).scrollTop += amount;
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
/**
|
|
2968
|
+
* Increments the horizontal scroll position of a node.
|
|
2969
|
+
* @param {?} node Node whose scroll position should change.
|
|
2970
|
+
* @param {?} amount Amount of pixels that the `node` should be scrolled.
|
|
2971
|
+
* @return {?}
|
|
2972
|
+
*/
|
|
2973
|
+
function incrementHorizontalScroll(node, amount) {
|
|
2974
|
+
if (node === window) {
|
|
2975
|
+
((/** @type {?} */ (node))).scrollBy(amount, 0);
|
|
2976
|
+
}
|
|
2977
|
+
else {
|
|
2978
|
+
// Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.
|
|
2979
|
+
((/** @type {?} */ (node))).scrollLeft += amount;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
/**
|
|
2983
|
+
* Gets whether the vertical auto-scroll direction of a node.
|
|
2984
|
+
* @param {?} clientRect Dimensions of the node.
|
|
2985
|
+
* @param {?} pointerY Position of the user's pointer along the y axis.
|
|
2986
|
+
* @return {?}
|
|
2987
|
+
*/
|
|
2988
|
+
function getVerticalScrollDirection(clientRect, pointerY) {
|
|
2989
|
+
var top = clientRect.top, bottom = clientRect.bottom, height = clientRect.height;
|
|
2990
|
+
/** @type {?} */
|
|
2991
|
+
var yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;
|
|
2992
|
+
if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {
|
|
2993
|
+
return 1 /* UP */;
|
|
2994
|
+
}
|
|
2995
|
+
else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {
|
|
2996
|
+
return 2 /* DOWN */;
|
|
2997
|
+
}
|
|
2998
|
+
return 0 /* NONE */;
|
|
2999
|
+
}
|
|
3000
|
+
/**
|
|
3001
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
3002
|
+
* @param {?} clientRect Dimensions of the node.
|
|
3003
|
+
* @param {?} pointerX Position of the user's pointer along the x axis.
|
|
3004
|
+
* @return {?}
|
|
3005
|
+
*/
|
|
3006
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
3007
|
+
var left = clientRect.left, right = clientRect.right, width = clientRect.width;
|
|
3008
|
+
/** @type {?} */
|
|
3009
|
+
var xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
3010
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
3011
|
+
return 1 /* LEFT */;
|
|
3012
|
+
}
|
|
3013
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
3014
|
+
return 2 /* RIGHT */;
|
|
3015
|
+
}
|
|
3016
|
+
return 0 /* NONE */;
|
|
3017
|
+
}
|
|
2586
3018
|
|
|
2587
3019
|
/**
|
|
2588
3020
|
* @fileoverview added by tsickle
|
|
@@ -2635,6 +3067,10 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2635
3067
|
* while the user is dragging a drag item instance.
|
|
2636
3068
|
*/
|
|
2637
3069
|
this.pointerUp = new Subject();
|
|
3070
|
+
/**
|
|
3071
|
+
* Emits when the viewport has been scrolled while the user is dragging an item.
|
|
3072
|
+
*/
|
|
3073
|
+
this.scroll = new Subject();
|
|
2638
3074
|
/**
|
|
2639
3075
|
* Event listener that will prevent the default browser action while the user is dragging.
|
|
2640
3076
|
* @param event Event whose default action should be prevented.
|
|
@@ -2748,6 +3184,10 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2748
3184
|
*/
|
|
2749
3185
|
function (drag, event) {
|
|
2750
3186
|
var _this = this;
|
|
3187
|
+
// Do not process the same drag twice to avoid memory leaks and redundant listeners
|
|
3188
|
+
if (this._activeDragInstances.has(drag)) {
|
|
3189
|
+
return;
|
|
3190
|
+
}
|
|
2751
3191
|
this._activeDragInstances.add(drag);
|
|
2752
3192
|
if (this._activeDragInstances.size === 1) {
|
|
2753
3193
|
/** @type {?} */
|
|
@@ -2775,6 +3215,13 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2775
3215
|
*/
|
|
2776
3216
|
function (e) { return _this.pointerUp.next((/** @type {?} */ (e))); }),
|
|
2777
3217
|
options: true
|
|
3218
|
+
})
|
|
3219
|
+
.set('scroll', {
|
|
3220
|
+
handler: (/**
|
|
3221
|
+
* @param {?} e
|
|
3222
|
+
* @return {?}
|
|
3223
|
+
*/
|
|
3224
|
+
function (e) { return _this.scroll.next(e); })
|
|
2778
3225
|
})
|
|
2779
3226
|
// Preventing the default action on `mousemove` isn't enough to disable text selection
|
|
2780
3227
|
// on Safari so we need to prevent the selection event as well. Alternatively this can
|
|
@@ -2784,14 +3231,6 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2784
3231
|
handler: this._preventDefaultWhileDragging,
|
|
2785
3232
|
options: activeCapturingEventOptions
|
|
2786
3233
|
});
|
|
2787
|
-
// TODO(crisbeto): prevent mouse wheel scrolling while
|
|
2788
|
-
// dragging until we've set up proper scroll handling.
|
|
2789
|
-
if (!isTouchEvent) {
|
|
2790
|
-
this._globalListeners.set('wheel', {
|
|
2791
|
-
handler: this._preventDefaultWhileDragging,
|
|
2792
|
-
options: activeCapturingEventOptions
|
|
2793
|
-
});
|
|
2794
|
-
}
|
|
2795
3234
|
this._ngZone.runOutsideAngular((/**
|
|
2796
3235
|
* @return {?}
|
|
2797
3236
|
*/
|
|
@@ -2983,7 +3422,7 @@ var DragDrop = /** @class */ (function () {
|
|
|
2983
3422
|
* @return {?}
|
|
2984
3423
|
*/
|
|
2985
3424
|
function (element) {
|
|
2986
|
-
return new DropListRef(element, this._dragDropRegistry, this._document);
|
|
3425
|
+
return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);
|
|
2987
3426
|
};
|
|
2988
3427
|
DragDrop.decorators = [
|
|
2989
3428
|
{ type: Injectable, args: [{ providedIn: 'root' },] },
|
|
@@ -3811,6 +4250,10 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3811
4250
|
* @return {?}
|
|
3812
4251
|
*/
|
|
3813
4252
|
function () { return true; });
|
|
4253
|
+
/**
|
|
4254
|
+
* Whether to auto-scroll the view when the user moves their pointer close to the edges.
|
|
4255
|
+
*/
|
|
4256
|
+
this.autoScrollDisabled = false;
|
|
3814
4257
|
/**
|
|
3815
4258
|
* Emits when the user drops an item inside the container.
|
|
3816
4259
|
*/
|
|
@@ -4149,6 +4592,7 @@ var CdkDropList = /** @class */ (function () {
|
|
|
4149
4592
|
ref.disabled = _this.disabled;
|
|
4150
4593
|
ref.lockAxis = _this.lockAxis;
|
|
4151
4594
|
ref.sortingDisabled = _this.sortingDisabled;
|
|
4595
|
+
ref.autoScrollDisabled = _this.autoScrollDisabled;
|
|
4152
4596
|
ref
|
|
4153
4597
|
.connectedTo(siblings.filter((/**
|
|
4154
4598
|
* @param {?} drop
|
|
@@ -4283,6 +4727,7 @@ var CdkDropList = /** @class */ (function () {
|
|
|
4283
4727
|
disabled: [{ type: Input, args: ['cdkDropListDisabled',] }],
|
|
4284
4728
|
sortingDisabled: [{ type: Input, args: ['cdkDropListSortingDisabled',] }],
|
|
4285
4729
|
enterPredicate: [{ type: Input, args: ['cdkDropListEnterPredicate',] }],
|
|
4730
|
+
autoScrollDisabled: [{ type: Input, args: ['cdkDropListAutoScrollDisabled',] }],
|
|
4286
4731
|
dropped: [{ type: Output, args: ['cdkDropListDropped',] }],
|
|
4287
4732
|
entered: [{ type: Output, args: ['cdkDropListEntered',] }],
|
|
4288
4733
|
exited: [{ type: Output, args: ['cdkDropListExited',] }],
|