@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
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
(function (global, factory) {
|
|
9
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/cdk/coercion'), require('rxjs'), require('@angular/core'), require('@angular/common'), require('@angular/cdk/scrolling'), require('@angular/cdk/bidi')
|
|
10
|
-
typeof define === 'function' && define.amd ? define('@angular/cdk/drag-drop', ['exports', '@angular/cdk/platform', '@angular/cdk/coercion', 'rxjs', '@angular/core', '@angular/common', '@angular/cdk/scrolling', '@angular/cdk/bidi'
|
|
11
|
-
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.dragDrop = {}),global.ng.cdk.platform,global.ng.cdk.coercion,global.rxjs,global.ng.core,global.ng.common,global.ng.cdk.scrolling,global.ng.cdk.bidi
|
|
12
|
-
}(this, (function (exports,platform,coercion,rxjs,core,common,scrolling,bidi
|
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/cdk/coercion'), require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/common'), require('@angular/cdk/scrolling'), require('@angular/cdk/bidi')) :
|
|
10
|
+
typeof define === 'function' && define.amd ? define('@angular/cdk/drag-drop', ['exports', '@angular/cdk/platform', '@angular/cdk/coercion', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/common', '@angular/cdk/scrolling', '@angular/cdk/bidi'], factory) :
|
|
11
|
+
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.dragDrop = {}),global.ng.cdk.platform,global.ng.cdk.coercion,global.rxjs,global.rxjs.operators,global.ng.core,global.ng.common,global.ng.cdk.scrolling,global.ng.cdk.bidi));
|
|
12
|
+
}(this, (function (exports,platform,coercion,rxjs,operators,core,common,scrolling,bidi) { 'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @fileoverview added by tsickle
|
|
@@ -177,6 +177,10 @@ DragRef = /** @class */ (function () {
|
|
|
177
177
|
* Subscription to the event that is dispatched when the user lifts their pointer.
|
|
178
178
|
*/
|
|
179
179
|
this._pointerUpSubscription = rxjs.Subscription.EMPTY;
|
|
180
|
+
/**
|
|
181
|
+
* Subscription to the viewport being scrolled.
|
|
182
|
+
*/
|
|
183
|
+
this._scrollSubscription = rxjs.Subscription.EMPTY;
|
|
180
184
|
/**
|
|
181
185
|
* Cached reference to the boundary element.
|
|
182
186
|
*/
|
|
@@ -286,12 +290,23 @@ DragRef = /** @class */ (function () {
|
|
|
286
290
|
// direction. Note that this is preferrable over doing something like `skip(minimumDistance)`
|
|
287
291
|
// in the `pointerMove` subscription, because we're not guaranteed to have one move event
|
|
288
292
|
// per pixel of movement (e.g. if the user moves their pointer quickly).
|
|
289
|
-
if (isOverThreshold
|
|
290
|
-
|
|
291
|
-
_this.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
if (isOverThreshold) {
|
|
294
|
+
/** @type {?} */
|
|
295
|
+
var isDelayElapsed = Date.now() >= _this._dragStartTime + (_this.dragStartDelay || 0);
|
|
296
|
+
if (!isDelayElapsed) {
|
|
297
|
+
_this._endDragSequence(event);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
// Prevent other drag sequences from starting while something in the container is still
|
|
301
|
+
// being dragged. This can happen while we're waiting for the drop animation to finish
|
|
302
|
+
// and can cause errors, because some elements might still be moving around.
|
|
303
|
+
if (!_this._dropContainer || !_this._dropContainer.isDragging()) {
|
|
304
|
+
_this._hasStartedDragging = true;
|
|
305
|
+
_this._ngZone.run((/**
|
|
306
|
+
* @return {?}
|
|
307
|
+
*/
|
|
308
|
+
function () { return _this._startDragSequence(event); }));
|
|
309
|
+
}
|
|
295
310
|
}
|
|
296
311
|
return;
|
|
297
312
|
}
|
|
@@ -352,47 +367,7 @@ DragRef = /** @class */ (function () {
|
|
|
352
367
|
* @return {?}
|
|
353
368
|
*/
|
|
354
369
|
function (event) {
|
|
355
|
-
|
|
356
|
-
// The difference is that the one from the service reflects whether a dragging sequence
|
|
357
|
-
// has been initiated, whereas the one on `this` includes whether the user has passed
|
|
358
|
-
// the minimum dragging threshold.
|
|
359
|
-
if (!_this._dragDropRegistry.isDragging(_this)) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
_this._removeSubscriptions();
|
|
363
|
-
_this._dragDropRegistry.stopDragging(_this);
|
|
364
|
-
if (_this._handles) {
|
|
365
|
-
_this._rootElement.style.webkitTapHighlightColor = _this._rootElementTapHighlight;
|
|
366
|
-
}
|
|
367
|
-
if (!_this._hasStartedDragging) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
_this.released.next({ source: _this });
|
|
371
|
-
if (!_this._dropContainer) {
|
|
372
|
-
// Convert the active transform into a passive one. This means that next time
|
|
373
|
-
// the user starts dragging the item, its position will be calculated relatively
|
|
374
|
-
// to the new passive transform.
|
|
375
|
-
_this._passiveTransform.x = _this._activeTransform.x;
|
|
376
|
-
_this._passiveTransform.y = _this._activeTransform.y;
|
|
377
|
-
_this._ngZone.run((/**
|
|
378
|
-
* @return {?}
|
|
379
|
-
*/
|
|
380
|
-
function () {
|
|
381
|
-
_this.ended.next({
|
|
382
|
-
source: _this,
|
|
383
|
-
distance: _this._getDragDistance(_this._getPointerPositionOnPage(event))
|
|
384
|
-
});
|
|
385
|
-
}));
|
|
386
|
-
_this._dragDropRegistry.stopDragging(_this);
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
_this._animatePreviewToPlaceholder().then((/**
|
|
390
|
-
* @return {?}
|
|
391
|
-
*/
|
|
392
|
-
function () {
|
|
393
|
-
_this._cleanupDragArtifacts(event);
|
|
394
|
-
_this._dragDropRegistry.stopDragging(_this);
|
|
395
|
-
}));
|
|
370
|
+
_this._endDragSequence(event);
|
|
396
371
|
});
|
|
397
372
|
this.withRootElement(element);
|
|
398
373
|
_dragDropRegistry.registerDragItem(this);
|
|
@@ -724,7 +699,9 @@ DragRef = /** @class */ (function () {
|
|
|
724
699
|
* @return {?}
|
|
725
700
|
*/
|
|
726
701
|
function () {
|
|
727
|
-
|
|
702
|
+
/** @type {?} */
|
|
703
|
+
var position = this.isDragging() ? this._activeTransform : this._passiveTransform;
|
|
704
|
+
return { x: position.x, y: position.y };
|
|
728
705
|
};
|
|
729
706
|
/**
|
|
730
707
|
* Sets the current position in pixels the draggable outside of a drop container.
|
|
@@ -753,6 +730,22 @@ DragRef = /** @class */ (function () {
|
|
|
753
730
|
}
|
|
754
731
|
return (/** @type {?} */ (this));
|
|
755
732
|
};
|
|
733
|
+
/** Updates the item's sort order based on the last-known pointer position. */
|
|
734
|
+
/**
|
|
735
|
+
* Updates the item's sort order based on the last-known pointer position.
|
|
736
|
+
* @return {?}
|
|
737
|
+
*/
|
|
738
|
+
DragRef.prototype._sortFromLastPointerPosition = /**
|
|
739
|
+
* Updates the item's sort order based on the last-known pointer position.
|
|
740
|
+
* @return {?}
|
|
741
|
+
*/
|
|
742
|
+
function () {
|
|
743
|
+
/** @type {?} */
|
|
744
|
+
var position = this._pointerPositionAtLastDirectionChange;
|
|
745
|
+
if (position && this._dropContainer) {
|
|
746
|
+
this._updateActiveDropContainer(position);
|
|
747
|
+
}
|
|
748
|
+
};
|
|
756
749
|
/** Unsubscribes from the global subscriptions. */
|
|
757
750
|
/**
|
|
758
751
|
* Unsubscribes from the global subscriptions.
|
|
@@ -767,6 +760,7 @@ DragRef = /** @class */ (function () {
|
|
|
767
760
|
function () {
|
|
768
761
|
this._pointerMoveSubscription.unsubscribe();
|
|
769
762
|
this._pointerUpSubscription.unsubscribe();
|
|
763
|
+
this._scrollSubscription.unsubscribe();
|
|
770
764
|
};
|
|
771
765
|
/** Destroys the preview element and its ViewRef. */
|
|
772
766
|
/**
|
|
@@ -808,6 +802,69 @@ DragRef = /** @class */ (function () {
|
|
|
808
802
|
}
|
|
809
803
|
this._placeholder = this._placeholderRef = (/** @type {?} */ (null));
|
|
810
804
|
};
|
|
805
|
+
/**
|
|
806
|
+
* Clears subscriptions and stops the dragging sequence.
|
|
807
|
+
* @param event Browser event object that ended the sequence.
|
|
808
|
+
*/
|
|
809
|
+
/**
|
|
810
|
+
* Clears subscriptions and stops the dragging sequence.
|
|
811
|
+
* @private
|
|
812
|
+
* @param {?} event Browser event object that ended the sequence.
|
|
813
|
+
* @return {?}
|
|
814
|
+
*/
|
|
815
|
+
DragRef.prototype._endDragSequence = /**
|
|
816
|
+
* Clears subscriptions and stops the dragging sequence.
|
|
817
|
+
* @private
|
|
818
|
+
* @param {?} event Browser event object that ended the sequence.
|
|
819
|
+
* @return {?}
|
|
820
|
+
*/
|
|
821
|
+
function (event) {
|
|
822
|
+
var _this = this;
|
|
823
|
+
// Note that here we use `isDragging` from the service, rather than from `this`.
|
|
824
|
+
// The difference is that the one from the service reflects whether a dragging sequence
|
|
825
|
+
// has been initiated, whereas the one on `this` includes whether the user has passed
|
|
826
|
+
// the minimum dragging threshold.
|
|
827
|
+
if (!this._dragDropRegistry.isDragging(this)) {
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
this._removeSubscriptions();
|
|
831
|
+
this._dragDropRegistry.stopDragging(this);
|
|
832
|
+
if (this._handles) {
|
|
833
|
+
this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight;
|
|
834
|
+
}
|
|
835
|
+
if (!this._hasStartedDragging) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
this.released.next({ source: this });
|
|
839
|
+
if (this._dropContainer) {
|
|
840
|
+
// Stop scrolling immediately, instead of waiting for the animation to finish.
|
|
841
|
+
this._dropContainer._stopScrolling();
|
|
842
|
+
this._animatePreviewToPlaceholder().then((/**
|
|
843
|
+
* @return {?}
|
|
844
|
+
*/
|
|
845
|
+
function () {
|
|
846
|
+
_this._cleanupDragArtifacts(event);
|
|
847
|
+
_this._dragDropRegistry.stopDragging(_this);
|
|
848
|
+
}));
|
|
849
|
+
}
|
|
850
|
+
else {
|
|
851
|
+
// Convert the active transform into a passive one. This means that next time
|
|
852
|
+
// the user starts dragging the item, its position will be calculated relatively
|
|
853
|
+
// to the new passive transform.
|
|
854
|
+
this._passiveTransform.x = this._activeTransform.x;
|
|
855
|
+
this._passiveTransform.y = this._activeTransform.y;
|
|
856
|
+
this._ngZone.run((/**
|
|
857
|
+
* @return {?}
|
|
858
|
+
*/
|
|
859
|
+
function () {
|
|
860
|
+
_this.ended.next({
|
|
861
|
+
source: _this,
|
|
862
|
+
distance: _this._getDragDistance(_this._getPointerPositionOnPage(event))
|
|
863
|
+
});
|
|
864
|
+
}));
|
|
865
|
+
this._dragDropRegistry.stopDragging(this);
|
|
866
|
+
}
|
|
867
|
+
};
|
|
811
868
|
/** Starts the dragging sequence. */
|
|
812
869
|
/**
|
|
813
870
|
* Starts the dragging sequence.
|
|
@@ -827,6 +884,7 @@ DragRef = /** @class */ (function () {
|
|
|
827
884
|
if (isTouchEvent(event)) {
|
|
828
885
|
this._lastTouchEventTime = Date.now();
|
|
829
886
|
}
|
|
887
|
+
this._toggleNativeDragInteractions();
|
|
830
888
|
if (this._dropContainer) {
|
|
831
889
|
/** @type {?} */
|
|
832
890
|
var element = this._rootElement;
|
|
@@ -869,6 +927,7 @@ DragRef = /** @class */ (function () {
|
|
|
869
927
|
* @return {?}
|
|
870
928
|
*/
|
|
871
929
|
function (referenceElement, event) {
|
|
930
|
+
var _this = this;
|
|
872
931
|
// Always stop propagation for the event that initializes
|
|
873
932
|
// the dragging sequence, in order to prevent it from potentially
|
|
874
933
|
// starting another sequence for a draggable parent somewhere up the DOM tree.
|
|
@@ -904,12 +963,19 @@ DragRef = /** @class */ (function () {
|
|
|
904
963
|
this._rootElementTapHighlight = rootElement.style.webkitTapHighlightColor;
|
|
905
964
|
rootElement.style.webkitTapHighlightColor = 'transparent';
|
|
906
965
|
}
|
|
907
|
-
this._toggleNativeDragInteractions();
|
|
908
966
|
this._hasStartedDragging = this._hasMoved = false;
|
|
909
967
|
this._initialContainer = (/** @type {?} */ (this._dropContainer));
|
|
968
|
+
// Avoid multiple subscriptions and memory leaks when multi touch
|
|
969
|
+
// (isDragging check above isn't enough because of possible temporal and/or dimensional delays)
|
|
970
|
+
this._removeSubscriptions();
|
|
910
971
|
this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);
|
|
911
972
|
this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);
|
|
912
|
-
this.
|
|
973
|
+
this._scrollSubscription = this._dragDropRegistry.scroll.pipe(operators.startWith(null)).subscribe((/**
|
|
974
|
+
* @return {?}
|
|
975
|
+
*/
|
|
976
|
+
function () {
|
|
977
|
+
_this._scrollPosition = _this._viewportRuler.getViewportScrollPosition();
|
|
978
|
+
}));
|
|
913
979
|
if (this._boundaryElement) {
|
|
914
980
|
this._boundaryRect = this._boundaryElement.getBoundingClientRect();
|
|
915
981
|
}
|
|
@@ -1033,6 +1099,7 @@ DragRef = /** @class */ (function () {
|
|
|
1033
1099
|
});
|
|
1034
1100
|
}));
|
|
1035
1101
|
}
|
|
1102
|
+
(/** @type {?} */ (this._dropContainer))._startScrollingIfNecessary(x, y);
|
|
1036
1103
|
(/** @type {?} */ (this._dropContainer))._sortItem(this, x, y, this._pointerDirectionDelta);
|
|
1037
1104
|
this._preview.style.transform =
|
|
1038
1105
|
getTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);
|
|
@@ -1261,7 +1328,7 @@ DragRef = /** @class */ (function () {
|
|
|
1261
1328
|
/** @type {?} */
|
|
1262
1329
|
var point = this._getPointerPositionOnPage(event);
|
|
1263
1330
|
/** @type {?} */
|
|
1264
|
-
var constrainedPoint = this.constrainPosition ? this.constrainPosition(point) : point;
|
|
1331
|
+
var constrainedPoint = this.constrainPosition ? this.constrainPosition(point, this) : point;
|
|
1265
1332
|
/** @type {?} */
|
|
1266
1333
|
var dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;
|
|
1267
1334
|
if (this.lockAxis === 'x' || dropContainerLock === 'x') {
|
|
@@ -1343,7 +1410,7 @@ DragRef = /** @class */ (function () {
|
|
|
1343
1410
|
return;
|
|
1344
1411
|
}
|
|
1345
1412
|
/** @type {?} */
|
|
1346
|
-
var shouldEnable = this.
|
|
1413
|
+
var shouldEnable = this._handles.length > 0 || !this.isDragging();
|
|
1347
1414
|
if (shouldEnable !== this._nativeInteractionsEnabled) {
|
|
1348
1415
|
this._nativeInteractionsEnabled = shouldEnable;
|
|
1349
1416
|
toggleNativeDragInteractions(this._rootElement, shouldEnable);
|
|
@@ -1494,7 +1561,10 @@ function removeElement(element) {
|
|
|
1494
1561
|
* @return {?}
|
|
1495
1562
|
*/
|
|
1496
1563
|
function isTouchEvent(event) {
|
|
1497
|
-
|
|
1564
|
+
// This function is called for every pixel that the user has dragged so we need it to be
|
|
1565
|
+
// as fast as possible. Since we only bind mouse events and touch events, we can assume
|
|
1566
|
+
// that if the event's name starts with `t`, it's a touch event.
|
|
1567
|
+
return event.type[0] === 't';
|
|
1498
1568
|
}
|
|
1499
1569
|
/**
|
|
1500
1570
|
* Gets the element into which the drag preview should be inserted.
|
|
@@ -1603,6 +1673,18 @@ var _uniqueIdCounter = 0;
|
|
|
1603
1673
|
* @type {?}
|
|
1604
1674
|
*/
|
|
1605
1675
|
var DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
1676
|
+
/**
|
|
1677
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
1678
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
1679
|
+
* @type {?}
|
|
1680
|
+
*/
|
|
1681
|
+
var SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
1682
|
+
/**
|
|
1683
|
+
* Number of pixels to scroll for each frame when auto-scrolling an element.
|
|
1684
|
+
* The value comes from trying it out manually until it feels right.
|
|
1685
|
+
* @type {?}
|
|
1686
|
+
*/
|
|
1687
|
+
var AUTO_SCROLL_STEP = 2;
|
|
1606
1688
|
/**
|
|
1607
1689
|
* Reference to a drop list. Used to manipulate or dispose of the container.
|
|
1608
1690
|
* \@docs-private
|
|
@@ -1614,8 +1696,11 @@ var /**
|
|
|
1614
1696
|
* @template T
|
|
1615
1697
|
*/
|
|
1616
1698
|
DropListRef = /** @class */ (function () {
|
|
1617
|
-
function DropListRef(element, _dragDropRegistry, _document) {
|
|
1699
|
+
function DropListRef(element, _dragDropRegistry, _document, _ngZone, _viewportRuler) {
|
|
1700
|
+
var _this = this;
|
|
1618
1701
|
this._dragDropRegistry = _dragDropRegistry;
|
|
1702
|
+
this._ngZone = _ngZone;
|
|
1703
|
+
this._viewportRuler = _viewportRuler;
|
|
1619
1704
|
/**
|
|
1620
1705
|
* Unique ID for the drop list.
|
|
1621
1706
|
* @deprecated No longer being used. To be removed.
|
|
@@ -1630,6 +1715,11 @@ DropListRef = /** @class */ (function () {
|
|
|
1630
1715
|
* Whether sorting items within the list is disabled.
|
|
1631
1716
|
*/
|
|
1632
1717
|
this.sortingDisabled = true;
|
|
1718
|
+
/**
|
|
1719
|
+
* Whether auto-scrolling the view when the user
|
|
1720
|
+
* moves their pointer close to the edges is disabled.
|
|
1721
|
+
*/
|
|
1722
|
+
this.autoScrollDisabled = false;
|
|
1633
1723
|
/**
|
|
1634
1724
|
* Function that is used to determine whether an item
|
|
1635
1725
|
* is allowed to be moved into a drop container.
|
|
@@ -1667,6 +1757,14 @@ DropListRef = /** @class */ (function () {
|
|
|
1667
1757
|
* Cache of the dimensions of all the items inside the container.
|
|
1668
1758
|
*/
|
|
1669
1759
|
this._itemPositions = [];
|
|
1760
|
+
/**
|
|
1761
|
+
* Keeps track of the container's scroll position.
|
|
1762
|
+
*/
|
|
1763
|
+
this._scrollPosition = { top: 0, left: 0 };
|
|
1764
|
+
/**
|
|
1765
|
+
* Keeps track of the scroll position of the viewport.
|
|
1766
|
+
*/
|
|
1767
|
+
this._viewportScrollPosition = { top: 0, left: 0 };
|
|
1670
1768
|
/**
|
|
1671
1769
|
* Keeps track of the item that was last swapped with the dragged item, as
|
|
1672
1770
|
* well as what direction the pointer was moving in when the swap occured.
|
|
@@ -1688,6 +1786,66 @@ DropListRef = /** @class */ (function () {
|
|
|
1688
1786
|
* Layout direction of the drop list.
|
|
1689
1787
|
*/
|
|
1690
1788
|
this._direction = 'ltr';
|
|
1789
|
+
/**
|
|
1790
|
+
* Subscription to the window being scrolled.
|
|
1791
|
+
*/
|
|
1792
|
+
this._viewportScrollSubscription = rxjs.Subscription.EMPTY;
|
|
1793
|
+
/**
|
|
1794
|
+
* Vertical direction in which the list is currently scrolling.
|
|
1795
|
+
*/
|
|
1796
|
+
this._verticalScrollDirection = 0 /* NONE */;
|
|
1797
|
+
/**
|
|
1798
|
+
* Horizontal direction in which the list is currently scrolling.
|
|
1799
|
+
*/
|
|
1800
|
+
this._horizontalScrollDirection = 0 /* NONE */;
|
|
1801
|
+
/**
|
|
1802
|
+
* Used to signal to the current auto-scroll sequence when to stop.
|
|
1803
|
+
*/
|
|
1804
|
+
this._stopScrollTimers = new rxjs.Subject();
|
|
1805
|
+
/**
|
|
1806
|
+
* Handles the container being scrolled. Has to be an arrow function to preserve the context.
|
|
1807
|
+
*/
|
|
1808
|
+
this._handleScroll = (/**
|
|
1809
|
+
* @return {?}
|
|
1810
|
+
*/
|
|
1811
|
+
function () {
|
|
1812
|
+
if (!_this.isDragging()) {
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
/** @type {?} */
|
|
1816
|
+
var element = coercion.coerceElement(_this.element);
|
|
1817
|
+
_this._updateAfterScroll(_this._scrollPosition, element.scrollTop, element.scrollLeft);
|
|
1818
|
+
});
|
|
1819
|
+
/**
|
|
1820
|
+
* Starts the interval that'll auto-scroll the element.
|
|
1821
|
+
*/
|
|
1822
|
+
this._startScrollInterval = (/**
|
|
1823
|
+
* @return {?}
|
|
1824
|
+
*/
|
|
1825
|
+
function () {
|
|
1826
|
+
_this._stopScrolling();
|
|
1827
|
+
rxjs.interval(0, rxjs.animationFrameScheduler)
|
|
1828
|
+
.pipe(operators.takeUntil(_this._stopScrollTimers))
|
|
1829
|
+
.subscribe((/**
|
|
1830
|
+
* @return {?}
|
|
1831
|
+
*/
|
|
1832
|
+
function () {
|
|
1833
|
+
/** @type {?} */
|
|
1834
|
+
var node = _this._scrollNode;
|
|
1835
|
+
if (_this._verticalScrollDirection === 1 /* UP */) {
|
|
1836
|
+
incrementVerticalScroll(node, -AUTO_SCROLL_STEP);
|
|
1837
|
+
}
|
|
1838
|
+
else if (_this._verticalScrollDirection === 2 /* DOWN */) {
|
|
1839
|
+
incrementVerticalScroll(node, AUTO_SCROLL_STEP);
|
|
1840
|
+
}
|
|
1841
|
+
if (_this._horizontalScrollDirection === 1 /* LEFT */) {
|
|
1842
|
+
incrementHorizontalScroll(node, -AUTO_SCROLL_STEP);
|
|
1843
|
+
}
|
|
1844
|
+
else if (_this._horizontalScrollDirection === 2 /* RIGHT */) {
|
|
1845
|
+
incrementHorizontalScroll(node, AUTO_SCROLL_STEP);
|
|
1846
|
+
}
|
|
1847
|
+
}));
|
|
1848
|
+
});
|
|
1691
1849
|
_dragDropRegistry.registerDropContainer(this);
|
|
1692
1850
|
this._document = _document;
|
|
1693
1851
|
this.element = element instanceof core.ElementRef ? element.nativeElement : element;
|
|
@@ -1702,12 +1860,16 @@ DropListRef = /** @class */ (function () {
|
|
|
1702
1860
|
* @return {?}
|
|
1703
1861
|
*/
|
|
1704
1862
|
function () {
|
|
1863
|
+
this._stopScrolling();
|
|
1864
|
+
this._stopScrollTimers.complete();
|
|
1865
|
+
this._removeListeners();
|
|
1705
1866
|
this.beforeStarted.complete();
|
|
1706
1867
|
this.entered.complete();
|
|
1707
1868
|
this.exited.complete();
|
|
1708
1869
|
this.dropped.complete();
|
|
1709
1870
|
this.sorted.complete();
|
|
1710
1871
|
this._activeSiblings.clear();
|
|
1872
|
+
this._scrollNode = (/** @type {?} */ (null));
|
|
1711
1873
|
this._dragDropRegistry.removeDropContainer(this);
|
|
1712
1874
|
};
|
|
1713
1875
|
/** Whether an item from this list is currently being dragged. */
|
|
@@ -1733,6 +1895,8 @@ DropListRef = /** @class */ (function () {
|
|
|
1733
1895
|
*/
|
|
1734
1896
|
function () {
|
|
1735
1897
|
var _this = this;
|
|
1898
|
+
/** @type {?} */
|
|
1899
|
+
var element = coercion.coerceElement(this.element);
|
|
1736
1900
|
this.beforeStarted.next();
|
|
1737
1901
|
this._isDragging = true;
|
|
1738
1902
|
this._cacheItems();
|
|
@@ -1741,6 +1905,31 @@ DropListRef = /** @class */ (function () {
|
|
|
1741
1905
|
* @return {?}
|
|
1742
1906
|
*/
|
|
1743
1907
|
function (sibling) { return sibling._startReceiving(_this); }));
|
|
1908
|
+
this._removeListeners();
|
|
1909
|
+
// @breaking-change 9.0.0 Remove check for _ngZone once it's marked as a required param.
|
|
1910
|
+
if (this._ngZone) {
|
|
1911
|
+
this._ngZone.runOutsideAngular((/**
|
|
1912
|
+
* @return {?}
|
|
1913
|
+
*/
|
|
1914
|
+
function () { return element.addEventListener('scroll', _this._handleScroll); }));
|
|
1915
|
+
}
|
|
1916
|
+
else {
|
|
1917
|
+
element.addEventListener('scroll', this._handleScroll);
|
|
1918
|
+
}
|
|
1919
|
+
// @breaking-change 9.0.0 Remove check for _viewportRuler once it's marked as a required param.
|
|
1920
|
+
if (this._viewportRuler) {
|
|
1921
|
+
this._viewportScrollPosition = this._viewportRuler.getViewportScrollPosition();
|
|
1922
|
+
this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe((/**
|
|
1923
|
+
* @return {?}
|
|
1924
|
+
*/
|
|
1925
|
+
function () {
|
|
1926
|
+
if (_this.isDragging()) {
|
|
1927
|
+
/** @type {?} */
|
|
1928
|
+
var newPosition = (/** @type {?} */ (_this._viewportRuler)).getViewportScrollPosition();
|
|
1929
|
+
_this._updateAfterScroll(_this._viewportScrollPosition, newPosition.top, newPosition.left, _this._clientRect);
|
|
1930
|
+
}
|
|
1931
|
+
}));
|
|
1932
|
+
}
|
|
1744
1933
|
};
|
|
1745
1934
|
/**
|
|
1746
1935
|
* Emits an event to indicate that the user moved an item into the container.
|
|
@@ -2124,6 +2313,91 @@ DropListRef = /** @class */ (function () {
|
|
|
2124
2313
|
}
|
|
2125
2314
|
}));
|
|
2126
2315
|
};
|
|
2316
|
+
/**
|
|
2317
|
+
* Checks whether the user's pointer is close to the edges of either the
|
|
2318
|
+
* viewport or the drop list and starts the auto-scroll sequence.
|
|
2319
|
+
* @param pointerX User's pointer position along the x axis.
|
|
2320
|
+
* @param pointerY User's pointer position along the y axis.
|
|
2321
|
+
*/
|
|
2322
|
+
/**
|
|
2323
|
+
* Checks whether the user's pointer is close to the edges of either the
|
|
2324
|
+
* viewport or the drop list and starts the auto-scroll sequence.
|
|
2325
|
+
* @param {?} pointerX User's pointer position along the x axis.
|
|
2326
|
+
* @param {?} pointerY User's pointer position along the y axis.
|
|
2327
|
+
* @return {?}
|
|
2328
|
+
*/
|
|
2329
|
+
DropListRef.prototype._startScrollingIfNecessary = /**
|
|
2330
|
+
* Checks whether the user's pointer is close to the edges of either the
|
|
2331
|
+
* viewport or the drop list and starts the auto-scroll sequence.
|
|
2332
|
+
* @param {?} pointerX User's pointer position along the x axis.
|
|
2333
|
+
* @param {?} pointerY User's pointer position along the y axis.
|
|
2334
|
+
* @return {?}
|
|
2335
|
+
*/
|
|
2336
|
+
function (pointerX, pointerY) {
|
|
2337
|
+
if (this.autoScrollDisabled) {
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
/** @type {?} */
|
|
2341
|
+
var scrollNode;
|
|
2342
|
+
/** @type {?} */
|
|
2343
|
+
var verticalScrollDirection = 0 /* NONE */;
|
|
2344
|
+
/** @type {?} */
|
|
2345
|
+
var horizontalScrollDirection = 0 /* NONE */;
|
|
2346
|
+
// @breaking-change 9.0.0 Remove null check for _viewportRuler once it's a required parameter.
|
|
2347
|
+
// Check whether we're in range to scroll the viewport.
|
|
2348
|
+
if (this._viewportRuler) {
|
|
2349
|
+
var _a = this._viewportRuler.getViewportSize(), width = _a.width, height = _a.height;
|
|
2350
|
+
/** @type {?} */
|
|
2351
|
+
var clientRect = { width: width, height: height, top: 0, right: width, bottom: height, left: 0 };
|
|
2352
|
+
verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);
|
|
2353
|
+
horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
2354
|
+
scrollNode = window;
|
|
2355
|
+
}
|
|
2356
|
+
// If we couldn't find a scroll direction based on the
|
|
2357
|
+
// window, try with the container, if the pointer is close by.
|
|
2358
|
+
if (!verticalScrollDirection && !horizontalScrollDirection &&
|
|
2359
|
+
this._isPointerNearDropContainer(pointerX, pointerY)) {
|
|
2360
|
+
verticalScrollDirection = getVerticalScrollDirection(this._clientRect, pointerY);
|
|
2361
|
+
horizontalScrollDirection = getHorizontalScrollDirection(this._clientRect, pointerX);
|
|
2362
|
+
scrollNode = coercion.coerceElement(this.element);
|
|
2363
|
+
}
|
|
2364
|
+
// TODO(crisbeto): we also need to account for whether the view or element are scrollable in
|
|
2365
|
+
// the first place. With the current approach we'll still try to scroll them, but it just
|
|
2366
|
+
// won't do anything. The only case where this is relevant is that if we have a scrollable
|
|
2367
|
+
// list close to the viewport edge where the viewport isn't scrollable. In this case the
|
|
2368
|
+
// we'll be trying to scroll the viewport rather than the list.
|
|
2369
|
+
if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection ||
|
|
2370
|
+
horizontalScrollDirection !== this._horizontalScrollDirection ||
|
|
2371
|
+
scrollNode !== this._scrollNode)) {
|
|
2372
|
+
this._verticalScrollDirection = verticalScrollDirection;
|
|
2373
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
2374
|
+
this._scrollNode = scrollNode;
|
|
2375
|
+
if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {
|
|
2376
|
+
// @breaking-change 9.0.0 Remove null check for `_ngZone` once it is made required.
|
|
2377
|
+
if (this._ngZone) {
|
|
2378
|
+
this._ngZone.runOutsideAngular(this._startScrollInterval);
|
|
2379
|
+
}
|
|
2380
|
+
else {
|
|
2381
|
+
this._startScrollInterval();
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
else {
|
|
2385
|
+
this._stopScrolling();
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
/** Stops any currently-running auto-scroll sequences. */
|
|
2390
|
+
/**
|
|
2391
|
+
* Stops any currently-running auto-scroll sequences.
|
|
2392
|
+
* @return {?}
|
|
2393
|
+
*/
|
|
2394
|
+
DropListRef.prototype._stopScrolling = /**
|
|
2395
|
+
* Stops any currently-running auto-scroll sequences.
|
|
2396
|
+
* @return {?}
|
|
2397
|
+
*/
|
|
2398
|
+
function () {
|
|
2399
|
+
this._stopScrollTimers.next();
|
|
2400
|
+
};
|
|
2127
2401
|
/** Caches the position of the drop list. */
|
|
2128
2402
|
/**
|
|
2129
2403
|
* Caches the position of the drop list.
|
|
@@ -2136,7 +2410,10 @@ DropListRef = /** @class */ (function () {
|
|
|
2136
2410
|
* @return {?}
|
|
2137
2411
|
*/
|
|
2138
2412
|
function () {
|
|
2139
|
-
|
|
2413
|
+
/** @type {?} */
|
|
2414
|
+
var element = coercion.coerceElement(this.element);
|
|
2415
|
+
this._clientRect = getMutableClientRect(element);
|
|
2416
|
+
this._scrollPosition = { top: element.scrollTop, left: element.scrollLeft };
|
|
2140
2417
|
};
|
|
2141
2418
|
/** Refreshes the position cache of the items and sibling containers. */
|
|
2142
2419
|
/**
|
|
@@ -2164,24 +2441,7 @@ DropListRef = /** @class */ (function () {
|
|
|
2164
2441
|
// placeholder, because the element is hidden.
|
|
2165
2442
|
drag.getPlaceholderElement() :
|
|
2166
2443
|
drag.getRootElement();
|
|
2167
|
-
|
|
2168
|
-
var clientRect = elementToMeasure.getBoundingClientRect();
|
|
2169
|
-
return {
|
|
2170
|
-
drag: drag,
|
|
2171
|
-
offset: 0,
|
|
2172
|
-
// We need to clone the `clientRect` here, because all the values on it are readonly
|
|
2173
|
-
// and we need to be able to update them. Also we can't use a spread here, because
|
|
2174
|
-
// the values on a `ClientRect` aren't own properties. See:
|
|
2175
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes
|
|
2176
|
-
clientRect: {
|
|
2177
|
-
top: clientRect.top,
|
|
2178
|
-
right: clientRect.right,
|
|
2179
|
-
bottom: clientRect.bottom,
|
|
2180
|
-
left: clientRect.left,
|
|
2181
|
-
width: clientRect.width,
|
|
2182
|
-
height: clientRect.height
|
|
2183
|
-
}
|
|
2184
|
-
};
|
|
2444
|
+
return { drag: drag, offset: 0, clientRect: getMutableClientRect(elementToMeasure) };
|
|
2185
2445
|
})).sort((/**
|
|
2186
2446
|
* @param {?} a
|
|
2187
2447
|
* @param {?} b
|
|
@@ -2221,6 +2481,8 @@ DropListRef = /** @class */ (function () {
|
|
|
2221
2481
|
this._itemPositions = [];
|
|
2222
2482
|
this._previousSwap.drag = null;
|
|
2223
2483
|
this._previousSwap.delta = 0;
|
|
2484
|
+
this._stopScrolling();
|
|
2485
|
+
this._removeListeners();
|
|
2224
2486
|
};
|
|
2225
2487
|
/**
|
|
2226
2488
|
* Gets the offset in pixels by which the items that aren't being dragged should be moved.
|
|
@@ -2408,6 +2670,89 @@ DropListRef = /** @class */ (function () {
|
|
|
2408
2670
|
this._cacheItemPositions();
|
|
2409
2671
|
this._cacheOwnPosition();
|
|
2410
2672
|
};
|
|
2673
|
+
/**
|
|
2674
|
+
* Updates the internal state of the container after a scroll event has happened.
|
|
2675
|
+
* @param scrollPosition Object that is keeping track of the scroll position.
|
|
2676
|
+
* @param newTop New top scroll position.
|
|
2677
|
+
* @param newLeft New left scroll position.
|
|
2678
|
+
* @param extraClientRect Extra `ClientRect` object that should be updated, in addition to the
|
|
2679
|
+
* ones of the drag items. Useful when the viewport has been scrolled and we also need to update
|
|
2680
|
+
* the `ClientRect` of the list.
|
|
2681
|
+
*/
|
|
2682
|
+
/**
|
|
2683
|
+
* Updates the internal state of the container after a scroll event has happened.
|
|
2684
|
+
* @private
|
|
2685
|
+
* @param {?} scrollPosition Object that is keeping track of the scroll position.
|
|
2686
|
+
* @param {?} newTop New top scroll position.
|
|
2687
|
+
* @param {?} newLeft New left scroll position.
|
|
2688
|
+
* @param {?=} extraClientRect Extra `ClientRect` object that should be updated, in addition to the
|
|
2689
|
+
* ones of the drag items. Useful when the viewport has been scrolled and we also need to update
|
|
2690
|
+
* the `ClientRect` of the list.
|
|
2691
|
+
* @return {?}
|
|
2692
|
+
*/
|
|
2693
|
+
DropListRef.prototype._updateAfterScroll = /**
|
|
2694
|
+
* Updates the internal state of the container after a scroll event has happened.
|
|
2695
|
+
* @private
|
|
2696
|
+
* @param {?} scrollPosition Object that is keeping track of the scroll position.
|
|
2697
|
+
* @param {?} newTop New top scroll position.
|
|
2698
|
+
* @param {?} newLeft New left scroll position.
|
|
2699
|
+
* @param {?=} extraClientRect Extra `ClientRect` object that should be updated, in addition to the
|
|
2700
|
+
* ones of the drag items. Useful when the viewport has been scrolled and we also need to update
|
|
2701
|
+
* the `ClientRect` of the list.
|
|
2702
|
+
* @return {?}
|
|
2703
|
+
*/
|
|
2704
|
+
function (scrollPosition, newTop, newLeft, extraClientRect) {
|
|
2705
|
+
var _this = this;
|
|
2706
|
+
/** @type {?} */
|
|
2707
|
+
var topDifference = scrollPosition.top - newTop;
|
|
2708
|
+
/** @type {?} */
|
|
2709
|
+
var leftDifference = scrollPosition.left - newLeft;
|
|
2710
|
+
if (extraClientRect) {
|
|
2711
|
+
adjustClientRect(extraClientRect, topDifference, leftDifference);
|
|
2712
|
+
}
|
|
2713
|
+
// Since we know the amount that the user has scrolled we can shift all of the client rectangles
|
|
2714
|
+
// ourselves. This is cheaper than re-measuring everything and we can avoid inconsistent
|
|
2715
|
+
// behavior where we might be measuring the element before its position has changed.
|
|
2716
|
+
this._itemPositions.forEach((/**
|
|
2717
|
+
* @param {?} __0
|
|
2718
|
+
* @return {?}
|
|
2719
|
+
*/
|
|
2720
|
+
function (_a) {
|
|
2721
|
+
var clientRect = _a.clientRect;
|
|
2722
|
+
adjustClientRect(clientRect, topDifference, leftDifference);
|
|
2723
|
+
}));
|
|
2724
|
+
// We need two loops for this, because we want all of the cached
|
|
2725
|
+
// positions to be up-to-date before we re-sort the item.
|
|
2726
|
+
this._itemPositions.forEach((/**
|
|
2727
|
+
* @param {?} __0
|
|
2728
|
+
* @return {?}
|
|
2729
|
+
*/
|
|
2730
|
+
function (_a) {
|
|
2731
|
+
var drag = _a.drag;
|
|
2732
|
+
if (_this._dragDropRegistry.isDragging(drag)) {
|
|
2733
|
+
// We need to re-sort the item manually, because the pointer move
|
|
2734
|
+
// events won't be dispatched while the user is scrolling.
|
|
2735
|
+
drag._sortFromLastPointerPosition();
|
|
2736
|
+
}
|
|
2737
|
+
}));
|
|
2738
|
+
scrollPosition.top = newTop;
|
|
2739
|
+
scrollPosition.left = newLeft;
|
|
2740
|
+
};
|
|
2741
|
+
/** Removes the event listeners associated with this drop list. */
|
|
2742
|
+
/**
|
|
2743
|
+
* Removes the event listeners associated with this drop list.
|
|
2744
|
+
* @private
|
|
2745
|
+
* @return {?}
|
|
2746
|
+
*/
|
|
2747
|
+
DropListRef.prototype._removeListeners = /**
|
|
2748
|
+
* Removes the event listeners associated with this drop list.
|
|
2749
|
+
* @private
|
|
2750
|
+
* @return {?}
|
|
2751
|
+
*/
|
|
2752
|
+
function () {
|
|
2753
|
+
coercion.coerceElement(this.element).removeEventListener('scroll', this._handleScroll);
|
|
2754
|
+
this._viewportScrollSubscription.unsubscribe();
|
|
2755
|
+
};
|
|
2411
2756
|
/**
|
|
2412
2757
|
* Checks whether the user's pointer is positioned over the container.
|
|
2413
2758
|
* @param x Pointer position along the X axis.
|
|
@@ -2555,7 +2900,7 @@ function adjustClientRect(clientRect, top, left) {
|
|
|
2555
2900
|
}
|
|
2556
2901
|
/**
|
|
2557
2902
|
* Finds the index of an item that matches a predicate function. Used as an equivalent
|
|
2558
|
-
* of `Array.prototype.
|
|
2903
|
+
* of `Array.prototype.findIndex` which isn't part of the standard Google typings.
|
|
2559
2904
|
* @template T
|
|
2560
2905
|
* @param {?} array Array in which to look for matches.
|
|
2561
2906
|
* @param {?} predicate Function used to determine whether an item is a match.
|
|
@@ -2580,6 +2925,93 @@ function isInsideClientRect(clientRect, x, y) {
|
|
|
2580
2925
|
var top = clientRect.top, bottom = clientRect.bottom, left = clientRect.left, right = clientRect.right;
|
|
2581
2926
|
return y >= top && y <= bottom && x >= left && x <= right;
|
|
2582
2927
|
}
|
|
2928
|
+
/**
|
|
2929
|
+
* Gets a mutable version of an element's bounding `ClientRect`.
|
|
2930
|
+
* @param {?} element
|
|
2931
|
+
* @return {?}
|
|
2932
|
+
*/
|
|
2933
|
+
function getMutableClientRect(element) {
|
|
2934
|
+
/** @type {?} */
|
|
2935
|
+
var clientRect = element.getBoundingClientRect();
|
|
2936
|
+
// We need to clone the `clientRect` here, because all the values on it are readonly
|
|
2937
|
+
// and we need to be able to update them. Also we can't use a spread here, because
|
|
2938
|
+
// the values on a `ClientRect` aren't own properties. See:
|
|
2939
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes
|
|
2940
|
+
return {
|
|
2941
|
+
top: clientRect.top,
|
|
2942
|
+
right: clientRect.right,
|
|
2943
|
+
bottom: clientRect.bottom,
|
|
2944
|
+
left: clientRect.left,
|
|
2945
|
+
width: clientRect.width,
|
|
2946
|
+
height: clientRect.height
|
|
2947
|
+
};
|
|
2948
|
+
}
|
|
2949
|
+
/**
|
|
2950
|
+
* Increments the vertical scroll position of a node.
|
|
2951
|
+
* @param {?} node Node whose scroll position should change.
|
|
2952
|
+
* @param {?} amount Amount of pixels that the `node` should be scrolled.
|
|
2953
|
+
* @return {?}
|
|
2954
|
+
*/
|
|
2955
|
+
function incrementVerticalScroll(node, amount) {
|
|
2956
|
+
if (node === window) {
|
|
2957
|
+
((/** @type {?} */ (node))).scrollBy(0, amount);
|
|
2958
|
+
}
|
|
2959
|
+
else {
|
|
2960
|
+
// Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.
|
|
2961
|
+
((/** @type {?} */ (node))).scrollTop += amount;
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2965
|
+
* Increments the horizontal scroll position of a node.
|
|
2966
|
+
* @param {?} node Node whose scroll position should change.
|
|
2967
|
+
* @param {?} amount Amount of pixels that the `node` should be scrolled.
|
|
2968
|
+
* @return {?}
|
|
2969
|
+
*/
|
|
2970
|
+
function incrementHorizontalScroll(node, amount) {
|
|
2971
|
+
if (node === window) {
|
|
2972
|
+
((/** @type {?} */ (node))).scrollBy(amount, 0);
|
|
2973
|
+
}
|
|
2974
|
+
else {
|
|
2975
|
+
// Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.
|
|
2976
|
+
((/** @type {?} */ (node))).scrollLeft += amount;
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
/**
|
|
2980
|
+
* Gets whether the vertical auto-scroll direction of a node.
|
|
2981
|
+
* @param {?} clientRect Dimensions of the node.
|
|
2982
|
+
* @param {?} pointerY Position of the user's pointer along the y axis.
|
|
2983
|
+
* @return {?}
|
|
2984
|
+
*/
|
|
2985
|
+
function getVerticalScrollDirection(clientRect, pointerY) {
|
|
2986
|
+
var top = clientRect.top, bottom = clientRect.bottom, height = clientRect.height;
|
|
2987
|
+
/** @type {?} */
|
|
2988
|
+
var yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;
|
|
2989
|
+
if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {
|
|
2990
|
+
return 1 /* UP */;
|
|
2991
|
+
}
|
|
2992
|
+
else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {
|
|
2993
|
+
return 2 /* DOWN */;
|
|
2994
|
+
}
|
|
2995
|
+
return 0 /* NONE */;
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
2999
|
+
* @param {?} clientRect Dimensions of the node.
|
|
3000
|
+
* @param {?} pointerX Position of the user's pointer along the x axis.
|
|
3001
|
+
* @return {?}
|
|
3002
|
+
*/
|
|
3003
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
3004
|
+
var left = clientRect.left, right = clientRect.right, width = clientRect.width;
|
|
3005
|
+
/** @type {?} */
|
|
3006
|
+
var xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
3007
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
3008
|
+
return 1 /* LEFT */;
|
|
3009
|
+
}
|
|
3010
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
3011
|
+
return 2 /* RIGHT */;
|
|
3012
|
+
}
|
|
3013
|
+
return 0 /* NONE */;
|
|
3014
|
+
}
|
|
2583
3015
|
|
|
2584
3016
|
/**
|
|
2585
3017
|
* @fileoverview added by tsickle
|
|
@@ -2632,6 +3064,10 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2632
3064
|
* while the user is dragging a drag item instance.
|
|
2633
3065
|
*/
|
|
2634
3066
|
this.pointerUp = new rxjs.Subject();
|
|
3067
|
+
/**
|
|
3068
|
+
* Emits when the viewport has been scrolled while the user is dragging an item.
|
|
3069
|
+
*/
|
|
3070
|
+
this.scroll = new rxjs.Subject();
|
|
2635
3071
|
/**
|
|
2636
3072
|
* Event listener that will prevent the default browser action while the user is dragging.
|
|
2637
3073
|
* @param event Event whose default action should be prevented.
|
|
@@ -2745,6 +3181,10 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2745
3181
|
*/
|
|
2746
3182
|
function (drag, event) {
|
|
2747
3183
|
var _this = this;
|
|
3184
|
+
// Do not process the same drag twice to avoid memory leaks and redundant listeners
|
|
3185
|
+
if (this._activeDragInstances.has(drag)) {
|
|
3186
|
+
return;
|
|
3187
|
+
}
|
|
2748
3188
|
this._activeDragInstances.add(drag);
|
|
2749
3189
|
if (this._activeDragInstances.size === 1) {
|
|
2750
3190
|
/** @type {?} */
|
|
@@ -2772,6 +3212,13 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2772
3212
|
*/
|
|
2773
3213
|
function (e) { return _this.pointerUp.next((/** @type {?} */ (e))); }),
|
|
2774
3214
|
options: true
|
|
3215
|
+
})
|
|
3216
|
+
.set('scroll', {
|
|
3217
|
+
handler: (/**
|
|
3218
|
+
* @param {?} e
|
|
3219
|
+
* @return {?}
|
|
3220
|
+
*/
|
|
3221
|
+
function (e) { return _this.scroll.next(e); })
|
|
2775
3222
|
})
|
|
2776
3223
|
// Preventing the default action on `mousemove` isn't enough to disable text selection
|
|
2777
3224
|
// on Safari so we need to prevent the selection event as well. Alternatively this can
|
|
@@ -2781,14 +3228,6 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2781
3228
|
handler: this._preventDefaultWhileDragging,
|
|
2782
3229
|
options: activeCapturingEventOptions
|
|
2783
3230
|
});
|
|
2784
|
-
// TODO(crisbeto): prevent mouse wheel scrolling while
|
|
2785
|
-
// dragging until we've set up proper scroll handling.
|
|
2786
|
-
if (!isTouchEvent) {
|
|
2787
|
-
this._globalListeners.set('wheel', {
|
|
2788
|
-
handler: this._preventDefaultWhileDragging,
|
|
2789
|
-
options: activeCapturingEventOptions
|
|
2790
|
-
});
|
|
2791
|
-
}
|
|
2792
3231
|
this._ngZone.runOutsideAngular((/**
|
|
2793
3232
|
* @return {?}
|
|
2794
3233
|
*/
|
|
@@ -2980,7 +3419,7 @@ var DragDrop = /** @class */ (function () {
|
|
|
2980
3419
|
* @return {?}
|
|
2981
3420
|
*/
|
|
2982
3421
|
function (element) {
|
|
2983
|
-
return new DropListRef(element, this._dragDropRegistry, this._document);
|
|
3422
|
+
return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);
|
|
2984
3423
|
};
|
|
2985
3424
|
DragDrop.decorators = [
|
|
2986
3425
|
{ type: core.Injectable, args: [{ providedIn: 'root' },] },
|
|
@@ -3808,6 +4247,10 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3808
4247
|
* @return {?}
|
|
3809
4248
|
*/
|
|
3810
4249
|
function () { return true; });
|
|
4250
|
+
/**
|
|
4251
|
+
* Whether to auto-scroll the view when the user moves their pointer close to the edges.
|
|
4252
|
+
*/
|
|
4253
|
+
this.autoScrollDisabled = false;
|
|
3811
4254
|
/**
|
|
3812
4255
|
* Emits when the user drops an item inside the container.
|
|
3813
4256
|
*/
|
|
@@ -4146,6 +4589,7 @@ var CdkDropList = /** @class */ (function () {
|
|
|
4146
4589
|
ref.disabled = _this.disabled;
|
|
4147
4590
|
ref.lockAxis = _this.lockAxis;
|
|
4148
4591
|
ref.sortingDisabled = _this.sortingDisabled;
|
|
4592
|
+
ref.autoScrollDisabled = _this.autoScrollDisabled;
|
|
4149
4593
|
ref
|
|
4150
4594
|
.connectedTo(siblings.filter((/**
|
|
4151
4595
|
* @param {?} drop
|
|
@@ -4280,6 +4724,7 @@ var CdkDropList = /** @class */ (function () {
|
|
|
4280
4724
|
disabled: [{ type: core.Input, args: ['cdkDropListDisabled',] }],
|
|
4281
4725
|
sortingDisabled: [{ type: core.Input, args: ['cdkDropListSortingDisabled',] }],
|
|
4282
4726
|
enterPredicate: [{ type: core.Input, args: ['cdkDropListEnterPredicate',] }],
|
|
4727
|
+
autoScrollDisabled: [{ type: core.Input, args: ['cdkDropListAutoScrollDisabled',] }],
|
|
4283
4728
|
dropped: [{ type: core.Output, args: ['cdkDropListDropped',] }],
|
|
4284
4729
|
entered: [{ type: core.Output, args: ['cdkDropListEntered',] }],
|
|
4285
4730
|
exited: [{ type: core.Output, args: ['cdkDropListExited',] }],
|