@angular/material 17.2.0-rc.0 → 17.2.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/_index.scss +3 -20
- package/autocomplete/_autocomplete-theme.scss +3 -0
- package/badge/_badge-theme.scss +3 -0
- package/bottom-sheet/_bottom-sheet-theme.scss +3 -0
- package/button/_button-theme.scss +4 -1
- package/button/_fab-theme.scss +3 -0
- package/button/_icon-button-theme.scss +3 -0
- package/button-toggle/_button-toggle-theme.scss +3 -0
- package/card/_card-theme.scss +3 -0
- package/checkbox/_checkbox-theme.scss +3 -0
- package/chips/_chips-theme.scss +3 -0
- package/core/_core-theme.scss +3 -0
- package/core/option/_optgroup-theme.scss +3 -0
- package/core/option/_option-theme.scss +3 -0
- package/core/ripple/_ripple-theme.scss +3 -0
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +3 -0
- package/core/style/_menu-common.scss +5 -18
- package/core/theming/_inspection.scss +1 -0
- package/core/theming/_validation.scss +5 -0
- package/core/tokens/m2/_index.scss +2 -0
- package/core/tokens/m2/mat/_datepicker.scss +10 -1
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +5 -5
- package/core/tokens/m2/mat/_list.scss +44 -0
- package/core/tokens/m2/mat/_menu.scss +9 -0
- package/core/tokens/m2/mat/_paginator.scss +22 -2
- package/core/tokens/m2/mat/_select.scss +11 -1
- package/core/tokens/m2/mat/_standard-button-toggle.scss +5 -5
- package/core/tokens/m2/mat/_switch.scss +8 -0
- package/core/tokens/m2/mdc/_switch.scss +1 -1
- package/core/typography/_all-typography.scss +6 -1
- package/datepicker/_datepicker-theme.scss +9 -1
- package/dialog/_dialog-theme.scss +3 -0
- package/divider/_divider-theme.scss +3 -0
- package/esm2022/autocomplete/autocomplete-origin.mjs +3 -3
- package/esm2022/autocomplete/autocomplete-trigger.mjs +3 -3
- package/esm2022/autocomplete/autocomplete.mjs +3 -3
- package/esm2022/autocomplete/module.mjs +4 -4
- package/esm2022/badge/badge-module.mjs +4 -4
- package/esm2022/badge/badge.mjs +6 -6
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
- package/esm2022/bottom-sheet/bottom-sheet-module.mjs +4 -4
- package/esm2022/bottom-sheet/bottom-sheet.mjs +3 -3
- package/esm2022/button/button-base.mjs +6 -6
- package/esm2022/button/button.mjs +6 -6
- package/esm2022/button/fab.mjs +12 -12
- package/esm2022/button/icon-button.mjs +6 -6
- package/esm2022/button/module.mjs +4 -4
- package/esm2022/button-toggle/button-toggle-module.mjs +4 -4
- package/esm2022/button-toggle/button-toggle.mjs +8 -8
- package/esm2022/card/card.mjs +42 -42
- package/esm2022/card/module.mjs +4 -4
- package/esm2022/checkbox/checkbox-required-validator.mjs +3 -3
- package/esm2022/checkbox/checkbox.mjs +3 -3
- package/esm2022/checkbox/module.mjs +8 -8
- package/esm2022/chips/chip-action.mjs +3 -3
- package/esm2022/chips/chip-edit-input.mjs +3 -3
- package/esm2022/chips/chip-grid.mjs +3 -3
- package/esm2022/chips/chip-icons.mjs +9 -9
- package/esm2022/chips/chip-input.mjs +3 -3
- package/esm2022/chips/chip-listbox.mjs +3 -3
- package/esm2022/chips/chip-option.mjs +3 -3
- package/esm2022/chips/chip-row.mjs +3 -3
- package/esm2022/chips/chip-set.mjs +3 -3
- package/esm2022/chips/chip.mjs +3 -3
- package/esm2022/chips/module.mjs +4 -4
- package/esm2022/core/common-behaviors/common-module.mjs +4 -4
- package/esm2022/core/datetime/index.mjs +8 -8
- package/esm2022/core/datetime/native-date-adapter.mjs +3 -3
- package/esm2022/core/error/error-options.mjs +6 -6
- package/esm2022/core/internal-form-field/internal-form-field.mjs +3 -3
- package/esm2022/core/line/line.mjs +7 -7
- package/esm2022/core/option/index.mjs +4 -4
- package/esm2022/core/option/optgroup.mjs +3 -3
- package/esm2022/core/option/option.mjs +3 -3
- package/esm2022/core/private/ripple-loader.mjs +3 -3
- package/esm2022/core/ripple/index.mjs +4 -4
- package/esm2022/core/ripple/ripple.mjs +3 -3
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +5 -5
- package/esm2022/datepicker/calendar.mjs +8 -8
- package/esm2022/datepicker/date-range-input-parts.mjs +9 -9
- package/esm2022/datepicker/date-range-input.mjs +3 -3
- package/esm2022/datepicker/date-range-picker.mjs +3 -3
- package/esm2022/datepicker/date-range-selection-strategy.mjs +3 -3
- package/esm2022/datepicker/date-selection-model.mjs +9 -9
- package/esm2022/datepicker/datepicker-actions.mjs +9 -9
- package/esm2022/datepicker/datepicker-base.mjs +8 -8
- package/esm2022/datepicker/datepicker-input-base.mjs +3 -3
- package/esm2022/datepicker/datepicker-input.mjs +3 -3
- package/esm2022/datepicker/datepicker-intl.mjs +3 -3
- package/esm2022/datepicker/datepicker-module.mjs +4 -4
- package/esm2022/datepicker/datepicker-toggle.mjs +6 -6
- package/esm2022/datepicker/datepicker.mjs +3 -3
- package/esm2022/datepicker/month-view.mjs +3 -3
- package/esm2022/datepicker/multi-year-view.mjs +3 -3
- package/esm2022/datepicker/year-view.mjs +3 -3
- package/esm2022/dialog/dialog-container.mjs +3 -3
- package/esm2022/dialog/dialog-content-directives.mjs +15 -15
- package/esm2022/dialog/dialog.mjs +3 -3
- package/esm2022/dialog/module.mjs +4 -4
- package/esm2022/divider/divider-module.mjs +4 -4
- package/esm2022/divider/divider.mjs +3 -3
- package/esm2022/expansion/accordion.mjs +3 -3
- package/esm2022/expansion/expansion-module.mjs +4 -4
- package/esm2022/expansion/expansion-panel-content.mjs +3 -3
- package/esm2022/expansion/expansion-panel-header.mjs +9 -9
- package/esm2022/expansion/expansion-panel.mjs +6 -6
- package/esm2022/form-field/directives/error.mjs +3 -3
- package/esm2022/form-field/directives/floating-label.mjs +3 -3
- package/esm2022/form-field/directives/hint.mjs +3 -3
- package/esm2022/form-field/directives/label.mjs +3 -3
- package/esm2022/form-field/directives/line-ripple.mjs +3 -3
- package/esm2022/form-field/directives/notched-outline.mjs +3 -3
- package/esm2022/form-field/directives/prefix.mjs +3 -3
- package/esm2022/form-field/directives/suffix.mjs +3 -3
- package/esm2022/form-field/form-field-control.mjs +3 -3
- package/esm2022/form-field/form-field.mjs +6 -6
- package/esm2022/form-field/module.mjs +4 -4
- package/esm2022/grid-list/grid-list-module.mjs +4 -4
- package/esm2022/grid-list/grid-list.mjs +3 -3
- package/esm2022/grid-list/grid-tile.mjs +15 -15
- package/esm2022/icon/icon-module.mjs +4 -4
- package/esm2022/icon/icon-registry.mjs +3 -3
- package/esm2022/icon/icon.mjs +3 -3
- package/esm2022/icon/testing/fake-icon-registry.mjs +7 -7
- package/esm2022/input/input.mjs +3 -3
- package/esm2022/input/module.mjs +4 -4
- package/esm2022/list/action-list.mjs +4 -4
- package/esm2022/list/list-base.mjs +6 -6
- package/esm2022/list/list-item-sections.mjs +18 -18
- package/esm2022/list/list-module.mjs +4 -4
- package/esm2022/list/list-option.mjs +3 -3
- package/esm2022/list/list.mjs +7 -7
- package/esm2022/list/nav-list.mjs +4 -4
- package/esm2022/list/selection-list.mjs +7 -7
- package/esm2022/list/subheader.mjs +3 -3
- package/esm2022/menu/menu-content.mjs +3 -3
- package/esm2022/menu/menu-item.mjs +3 -3
- package/esm2022/menu/menu-trigger.mjs +3 -3
- package/esm2022/menu/menu.mjs +5 -5
- package/esm2022/menu/module.mjs +4 -4
- package/esm2022/paginator/module.mjs +4 -4
- package/esm2022/paginator/paginator-intl.mjs +3 -3
- package/esm2022/paginator/paginator.mjs +5 -5
- package/esm2022/progress-bar/module.mjs +4 -4
- package/esm2022/progress-bar/progress-bar.mjs +4 -4
- package/esm2022/progress-spinner/module.mjs +4 -4
- package/esm2022/progress-spinner/progress-spinner.mjs +3 -3
- package/esm2022/radio/module.mjs +4 -4
- package/esm2022/radio/radio.mjs +6 -6
- package/esm2022/select/module.mjs +4 -4
- package/esm2022/select/select.mjs +9 -9
- package/esm2022/sidenav/drawer.mjs +9 -9
- package/esm2022/sidenav/sidenav-module.mjs +4 -4
- package/esm2022/sidenav/sidenav.mjs +9 -9
- package/esm2022/slide-toggle/module.mjs +8 -8
- package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +3 -3
- package/esm2022/slide-toggle/slide-toggle.mjs +6 -6
- package/esm2022/slider/module.mjs +4 -4
- package/esm2022/slider/slider-input.mjs +6 -6
- package/esm2022/slider/slider-thumb.mjs +3 -3
- package/esm2022/slider/slider.mjs +3 -3
- package/esm2022/snack-bar/module.mjs +4 -4
- package/esm2022/snack-bar/simple-snack-bar.mjs +3 -3
- package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
- package/esm2022/snack-bar/snack-bar-content.mjs +9 -9
- package/esm2022/snack-bar/snack-bar.mjs +3 -3
- package/esm2022/sort/sort-header-intl.mjs +3 -3
- package/esm2022/sort/sort-header.mjs +3 -3
- package/esm2022/sort/sort-module.mjs +4 -4
- package/esm2022/sort/sort.mjs +3 -3
- package/esm2022/stepper/step-content.mjs +3 -3
- package/esm2022/stepper/step-header.mjs +3 -3
- package/esm2022/stepper/step-label.mjs +3 -3
- package/esm2022/stepper/stepper-button.mjs +6 -6
- package/esm2022/stepper/stepper-icon.mjs +3 -3
- package/esm2022/stepper/stepper-intl.mjs +3 -3
- package/esm2022/stepper/stepper-module.mjs +4 -4
- package/esm2022/stepper/stepper.mjs +6 -6
- package/esm2022/table/cell.mjs +21 -21
- package/esm2022/table/module.mjs +4 -4
- package/esm2022/table/row.mjs +21 -21
- package/esm2022/table/table.mjs +6 -6
- package/esm2022/table/text-column.mjs +3 -3
- package/esm2022/tabs/module.mjs +4 -4
- package/esm2022/tabs/paginated-tab-header.mjs +3 -3
- package/esm2022/tabs/tab-body.mjs +6 -6
- package/esm2022/tabs/tab-content.mjs +3 -3
- package/esm2022/tabs/tab-group.mjs +3 -3
- package/esm2022/tabs/tab-header.mjs +3 -3
- package/esm2022/tabs/tab-label-wrapper.mjs +3 -3
- package/esm2022/tabs/tab-label.mjs +3 -3
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +15 -10
- package/esm2022/tabs/tab.mjs +3 -3
- package/esm2022/toolbar/toolbar-module.mjs +4 -4
- package/esm2022/toolbar/toolbar.mjs +6 -6
- package/esm2022/tooltip/module.mjs +4 -4
- package/esm2022/tooltip/tooltip.mjs +6 -6
- package/esm2022/tree/node.mjs +9 -9
- package/esm2022/tree/outlet.mjs +3 -3
- package/esm2022/tree/padding.mjs +3 -3
- package/esm2022/tree/toggle.mjs +3 -3
- package/esm2022/tree/tree-module.mjs +4 -4
- package/esm2022/tree/tree.mjs +3 -3
- package/expansion/_expansion-theme.scss +3 -0
- package/fesm2022/autocomplete.mjs +13 -13
- package/fesm2022/badge.mjs +10 -10
- package/fesm2022/bottom-sheet.mjs +10 -10
- package/fesm2022/button-toggle.mjs +11 -11
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +34 -34
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/checkbox.mjs +14 -14
- package/fesm2022/chips.mjs +40 -40
- package/fesm2022/core.mjs +59 -59
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +85 -85
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +25 -25
- package/fesm2022/divider.mjs +7 -7
- package/fesm2022/expansion.mjs +25 -25
- package/fesm2022/form-field.mjs +36 -36
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +22 -22
- package/fesm2022/icon/testing.mjs +7 -7
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/input.mjs +7 -7
- package/fesm2022/list.mjs +55 -55
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +17 -17
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +11 -11
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +8 -8
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +7 -7
- package/fesm2022/radio.mjs +10 -10
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +22 -22
- package/fesm2022/slide-toggle.mjs +16 -16
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +16 -16
- package/fesm2022/snack-bar.mjs +22 -22
- package/fesm2022/sort.mjs +13 -13
- package/fesm2022/stepper.mjs +31 -31
- package/fesm2022/table.mjs +55 -55
- package/fesm2022/tabs.mjs +45 -40
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +10 -10
- package/fesm2022/tooltip.mjs +10 -10
- package/fesm2022/tree.mjs +25 -25
- package/form-field/_form-field-theme.scss +3 -0
- package/grid-list/_grid-list-theme.scss +3 -0
- package/icon/_icon-theme.scss +3 -0
- package/input/_input-theme.scss +5 -1
- package/list/_list-theme.scss +17 -3
- package/menu/_menu-theme.scss +3 -0
- package/package.json +7 -7
- package/paginator/_paginator-theme.scss +3 -7
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +3 -0
- package/progress-spinner/_progress-spinner-theme.scss +3 -0
- package/radio/_radio-theme.scss +3 -0
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-add/index.mjs +2 -2
- package/schematics/ng-generate/mdc-migration/index_bundled.js +981 -568
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
- package/select/_select-theme.scss +3 -19
- package/sidenav/_sidenav-theme.scss +3 -0
- package/slide-toggle/_slide-toggle-theme.scss +3 -0
- package/slider/_slider-theme.scss +3 -0
- package/snack-bar/_snack-bar-theme.scss +3 -0
- package/sort/_sort-theme.scss +3 -0
- package/stepper/_stepper-theme.scss +3 -0
- package/table/_table-theme.scss +3 -0
- package/tabs/_tabs-theme.scss +3 -0
- package/toolbar/_toolbar-theme.scss +3 -0
- package/tooltip/_tooltip-theme.scss +3 -0
- package/tree/_tree-theme.scss +3 -0
|
@@ -8189,6 +8189,7 @@ var ConstantPool = class {
|
|
|
8189
8189
|
this.literals = /* @__PURE__ */ new Map();
|
|
8190
8190
|
this.literalFactories = /* @__PURE__ */ new Map();
|
|
8191
8191
|
this.sharedConstants = /* @__PURE__ */ new Map();
|
|
8192
|
+
this._claimedNames = /* @__PURE__ */ new Map();
|
|
8192
8193
|
this.nextNameIndex = 0;
|
|
8193
8194
|
}
|
|
8194
8195
|
getConstLiteral(literal2, forceShared) {
|
|
@@ -8281,8 +8282,12 @@ var ConstantPool = class {
|
|
|
8281
8282
|
}
|
|
8282
8283
|
return { literalFactory, literalFactoryArguments };
|
|
8283
8284
|
}
|
|
8284
|
-
uniqueName(
|
|
8285
|
-
|
|
8285
|
+
uniqueName(name, alwaysIncludeSuffix = true) {
|
|
8286
|
+
var _a2;
|
|
8287
|
+
const count = (_a2 = this._claimedNames.get(name)) != null ? _a2 : 0;
|
|
8288
|
+
const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`;
|
|
8289
|
+
this._claimedNames.set(name, count + 1);
|
|
8290
|
+
return result;
|
|
8286
8291
|
}
|
|
8287
8292
|
freshName() {
|
|
8288
8293
|
return this.uniqueName(CONSTANT_PREFIX);
|
|
@@ -8905,6 +8910,24 @@ var Identifiers = _Identifiers;
|
|
|
8905
8910
|
(() => {
|
|
8906
8911
|
_Identifiers.contentQuery = { name: "\u0275\u0275contentQuery", moduleName: CORE };
|
|
8907
8912
|
})();
|
|
8913
|
+
(() => {
|
|
8914
|
+
_Identifiers.viewQuerySignal = { name: "\u0275\u0275viewQuerySignal", moduleName: CORE };
|
|
8915
|
+
})();
|
|
8916
|
+
(() => {
|
|
8917
|
+
_Identifiers.contentQuerySignal = { name: "\u0275\u0275contentQuerySignal", moduleName: CORE };
|
|
8918
|
+
})();
|
|
8919
|
+
(() => {
|
|
8920
|
+
_Identifiers.queryAdvance = { name: "\u0275\u0275queryAdvance", moduleName: CORE };
|
|
8921
|
+
})();
|
|
8922
|
+
(() => {
|
|
8923
|
+
_Identifiers.twoWayProperty = { name: "\u0275\u0275twoWayProperty", moduleName: CORE };
|
|
8924
|
+
})();
|
|
8925
|
+
(() => {
|
|
8926
|
+
_Identifiers.twoWayBindingSet = { name: "\u0275\u0275twoWayBindingSet", moduleName: CORE };
|
|
8927
|
+
})();
|
|
8928
|
+
(() => {
|
|
8929
|
+
_Identifiers.twoWayListener = { name: "\u0275\u0275twoWayListener", moduleName: CORE };
|
|
8930
|
+
})();
|
|
8908
8931
|
(() => {
|
|
8909
8932
|
_Identifiers.NgOnChangesFeature = { name: "\u0275\u0275NgOnChangesFeature", moduleName: CORE };
|
|
8910
8933
|
})();
|
|
@@ -8974,6 +8997,9 @@ var Identifiers = _Identifiers;
|
|
|
8974
8997
|
(() => {
|
|
8975
8998
|
_Identifiers.UnwrapDirectiveSignalInputs = { name: "\u0275UnwrapDirectiveSignalInputs", moduleName: CORE };
|
|
8976
8999
|
})();
|
|
9000
|
+
(() => {
|
|
9001
|
+
_Identifiers.unwrapWritableSignal = { name: "\u0275unwrapWritableSignal", moduleName: CORE };
|
|
9002
|
+
})();
|
|
8977
9003
|
var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
8978
9004
|
function dashCaseToCamelCase(input) {
|
|
8979
9005
|
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
@@ -10621,16 +10647,18 @@ var CHAINABLE_INSTRUCTIONS = /* @__PURE__ */ new Set([
|
|
|
10621
10647
|
Identifiers.textInterpolate7,
|
|
10622
10648
|
Identifiers.textInterpolate8,
|
|
10623
10649
|
Identifiers.textInterpolateV,
|
|
10624
|
-
Identifiers.templateCreate
|
|
10650
|
+
Identifiers.templateCreate,
|
|
10651
|
+
Identifiers.twoWayProperty,
|
|
10652
|
+
Identifiers.twoWayListener
|
|
10625
10653
|
]);
|
|
10626
10654
|
function invokeInstruction(span, reference2, params) {
|
|
10627
10655
|
return importExpr(reference2, null, span).callFn(params, span);
|
|
10628
10656
|
}
|
|
10629
|
-
function temporaryAllocator(
|
|
10657
|
+
function temporaryAllocator(pushStatement, name) {
|
|
10630
10658
|
let temp = null;
|
|
10631
10659
|
return () => {
|
|
10632
10660
|
if (!temp) {
|
|
10633
|
-
|
|
10661
|
+
pushStatement(new DeclareVarStmt(TEMPORARY_NAME, void 0, DYNAMIC_TYPE));
|
|
10634
10662
|
temp = variable(name);
|
|
10635
10663
|
}
|
|
10636
10664
|
return temp;
|
|
@@ -10710,24 +10738,6 @@ function trimTrailingNulls(parameters) {
|
|
|
10710
10738
|
}
|
|
10711
10739
|
return parameters;
|
|
10712
10740
|
}
|
|
10713
|
-
function getQueryPredicate(query, constantPool) {
|
|
10714
|
-
if (Array.isArray(query.predicate)) {
|
|
10715
|
-
let predicate = [];
|
|
10716
|
-
query.predicate.forEach((selector) => {
|
|
10717
|
-
const selectors = selector.split(",").map((token) => literal(token.trim()));
|
|
10718
|
-
predicate.push(...selectors);
|
|
10719
|
-
});
|
|
10720
|
-
return constantPool.getConstLiteral(literalArr(predicate), true);
|
|
10721
|
-
} else {
|
|
10722
|
-
switch (query.predicate.forwardRef) {
|
|
10723
|
-
case 0:
|
|
10724
|
-
case 2:
|
|
10725
|
-
return query.predicate.expression;
|
|
10726
|
-
case 1:
|
|
10727
|
-
return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
|
|
10728
|
-
}
|
|
10729
|
-
}
|
|
10730
|
-
}
|
|
10731
10741
|
var DefinitionMap = class {
|
|
10732
10742
|
constructor() {
|
|
10733
10743
|
this.values = [];
|
|
@@ -10774,7 +10784,7 @@ function getAttrsForDirectiveMatching(elOrTpl) {
|
|
|
10774
10784
|
}
|
|
10775
10785
|
});
|
|
10776
10786
|
elOrTpl.inputs.forEach((i) => {
|
|
10777
|
-
if (i.type === 0) {
|
|
10787
|
+
if (i.type === 0 || i.type === 5) {
|
|
10778
10788
|
attributesMap[i.name] = "";
|
|
10779
10789
|
}
|
|
10780
10790
|
});
|
|
@@ -12201,6 +12211,7 @@ var ParsedPropertyType;
|
|
|
12201
12211
|
ParsedPropertyType2[ParsedPropertyType2["DEFAULT"] = 0] = "DEFAULT";
|
|
12202
12212
|
ParsedPropertyType2[ParsedPropertyType2["LITERAL_ATTR"] = 1] = "LITERAL_ATTR";
|
|
12203
12213
|
ParsedPropertyType2[ParsedPropertyType2["ANIMATION"] = 2] = "ANIMATION";
|
|
12214
|
+
ParsedPropertyType2[ParsedPropertyType2["TWO_WAY"] = 3] = "TWO_WAY";
|
|
12204
12215
|
})(ParsedPropertyType || (ParsedPropertyType = {}));
|
|
12205
12216
|
var ParsedEvent = class {
|
|
12206
12217
|
constructor(name, targetOrPhase, type, handler, sourceSpan, handlerSpan, keySpan) {
|
|
@@ -12241,30 +12252,10 @@ var EventHandlerVars = _EventHandlerVars;
|
|
|
12241
12252
|
_EventHandlerVars.event = variable("$event");
|
|
12242
12253
|
})();
|
|
12243
12254
|
function convertActionBinding(localResolver, implicitReceiver, action, bindingId, baseSourceSpan, implicitReceiverAccesses, globals) {
|
|
12244
|
-
|
|
12245
|
-
localResolver = new DefaultLocalResolver(globals);
|
|
12246
|
-
}
|
|
12247
|
-
const actionWithoutBuiltins = convertPropertyBindingBuiltins({
|
|
12248
|
-
createLiteralArrayConverter: (argCount) => {
|
|
12249
|
-
return (args) => literalArr(args);
|
|
12250
|
-
},
|
|
12251
|
-
createLiteralMapConverter: (keys) => {
|
|
12252
|
-
return (values) => {
|
|
12253
|
-
const entries = keys.map((k, i) => ({
|
|
12254
|
-
key: k.key,
|
|
12255
|
-
value: values[i],
|
|
12256
|
-
quoted: k.quoted
|
|
12257
|
-
}));
|
|
12258
|
-
return literalMap(entries);
|
|
12259
|
-
};
|
|
12260
|
-
},
|
|
12261
|
-
createPipeConverter: (name) => {
|
|
12262
|
-
throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`);
|
|
12263
|
-
}
|
|
12264
|
-
}, action);
|
|
12255
|
+
localResolver != null ? localResolver : localResolver = new DefaultLocalResolver(globals);
|
|
12265
12256
|
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, false, baseSourceSpan, implicitReceiverAccesses);
|
|
12266
12257
|
const actionStmts = [];
|
|
12267
|
-
flattenStatements(
|
|
12258
|
+
flattenStatements(convertActionBuiltins(action).visit(visitor, _Mode.Statement), actionStmts);
|
|
12268
12259
|
prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
|
|
12269
12260
|
if (visitor.usesImplicitReceiver) {
|
|
12270
12261
|
localResolver.notifyImplicitReceiverUse();
|
|
@@ -12278,6 +12269,55 @@ function convertActionBinding(localResolver, implicitReceiver, action, bindingId
|
|
|
12278
12269
|
}
|
|
12279
12270
|
return actionStmts;
|
|
12280
12271
|
}
|
|
12272
|
+
function convertAssignmentActionBinding(localResolver, implicitReceiver, action, bindingId, baseSourceSpan, implicitReceiverAccesses, globals) {
|
|
12273
|
+
localResolver != null ? localResolver : localResolver = new DefaultLocalResolver(globals);
|
|
12274
|
+
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, false, baseSourceSpan, implicitReceiverAccesses);
|
|
12275
|
+
let convertedAction = convertActionBuiltins(action).visit(visitor, _Mode.Statement);
|
|
12276
|
+
if (!(convertedAction instanceof ExpressionStatement)) {
|
|
12277
|
+
throw new Error(`Illegal state: unsupported expression in two-way action binding.`);
|
|
12278
|
+
}
|
|
12279
|
+
convertedAction = wrapAssignmentAction(convertedAction.expr).toStmt();
|
|
12280
|
+
const actionStmts = [];
|
|
12281
|
+
flattenStatements(convertedAction, actionStmts);
|
|
12282
|
+
prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
|
|
12283
|
+
actionStmts.push(new ReturnStatement(EventHandlerVars.event));
|
|
12284
|
+
implicitReceiverAccesses == null ? void 0 : implicitReceiverAccesses.add(EventHandlerVars.event.name);
|
|
12285
|
+
if (visitor.usesImplicitReceiver) {
|
|
12286
|
+
localResolver.notifyImplicitReceiverUse();
|
|
12287
|
+
}
|
|
12288
|
+
return actionStmts;
|
|
12289
|
+
}
|
|
12290
|
+
function wrapAssignmentReadExpression(ast) {
|
|
12291
|
+
return new ExternalExpr(Identifiers.twoWayBindingSet).callFn([ast, EventHandlerVars.event]).or(ast.set(EventHandlerVars.event));
|
|
12292
|
+
}
|
|
12293
|
+
function isReadExpression$1(value) {
|
|
12294
|
+
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr;
|
|
12295
|
+
}
|
|
12296
|
+
function wrapAssignmentAction(ast) {
|
|
12297
|
+
if (isReadExpression$1(ast)) {
|
|
12298
|
+
return wrapAssignmentReadExpression(ast);
|
|
12299
|
+
}
|
|
12300
|
+
if (ast instanceof BinaryOperatorExpr && isReadExpression$1(ast.rhs)) {
|
|
12301
|
+
return new BinaryOperatorExpr(ast.operator, ast.lhs, wrapAssignmentReadExpression(ast.rhs));
|
|
12302
|
+
}
|
|
12303
|
+
if (ast instanceof ConditionalExpr && isReadExpression$1(ast.falseCase)) {
|
|
12304
|
+
return new ConditionalExpr(ast.condition, ast.trueCase, wrapAssignmentReadExpression(ast.falseCase));
|
|
12305
|
+
}
|
|
12306
|
+
if (ast instanceof NotExpr) {
|
|
12307
|
+
let expr = ast.condition;
|
|
12308
|
+
while (true) {
|
|
12309
|
+
if (expr instanceof NotExpr) {
|
|
12310
|
+
expr = expr.condition;
|
|
12311
|
+
} else {
|
|
12312
|
+
if (isReadExpression$1(expr)) {
|
|
12313
|
+
return wrapAssignmentReadExpression(expr);
|
|
12314
|
+
}
|
|
12315
|
+
break;
|
|
12316
|
+
}
|
|
12317
|
+
}
|
|
12318
|
+
}
|
|
12319
|
+
throw new Error(`Illegal state: unsupported expression in two-way action binding.`);
|
|
12320
|
+
}
|
|
12281
12321
|
function convertPropertyBindingBuiltins(converterFactory, ast) {
|
|
12282
12322
|
return convertBuiltins(converterFactory, ast);
|
|
12283
12323
|
}
|
|
@@ -12339,6 +12379,27 @@ function convertBuiltins(converterFactory, ast) {
|
|
|
12339
12379
|
const visitor = new _BuiltinAstConverter(converterFactory);
|
|
12340
12380
|
return ast.visit(visitor);
|
|
12341
12381
|
}
|
|
12382
|
+
function convertActionBuiltins(action) {
|
|
12383
|
+
const converterFactory = {
|
|
12384
|
+
createLiteralArrayConverter: () => {
|
|
12385
|
+
return (args) => literalArr(args);
|
|
12386
|
+
},
|
|
12387
|
+
createLiteralMapConverter: (keys) => {
|
|
12388
|
+
return (values) => {
|
|
12389
|
+
const entries = keys.map((k, i) => ({
|
|
12390
|
+
key: k.key,
|
|
12391
|
+
value: values[i],
|
|
12392
|
+
quoted: k.quoted
|
|
12393
|
+
}));
|
|
12394
|
+
return literalMap(entries);
|
|
12395
|
+
};
|
|
12396
|
+
},
|
|
12397
|
+
createPipeConverter: (name) => {
|
|
12398
|
+
throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`);
|
|
12399
|
+
}
|
|
12400
|
+
};
|
|
12401
|
+
return convertPropertyBindingBuiltins(converterFactory, action);
|
|
12402
|
+
}
|
|
12342
12403
|
function temporaryName(bindingId, temporaryNumber) {
|
|
12343
12404
|
return `tmp_${bindingId}_${temporaryNumber}`;
|
|
12344
12405
|
}
|
|
@@ -12958,6 +13019,7 @@ var animationKeywords = /* @__PURE__ */ new Set([
|
|
|
12958
13019
|
"jump-start",
|
|
12959
13020
|
"start"
|
|
12960
13021
|
]);
|
|
13022
|
+
var scopedAtRuleIdentifiers = ["@media", "@supports", "@document", "@layer", "@container", "@scope", "@starting-style"];
|
|
12961
13023
|
var ShadowCss = class {
|
|
12962
13024
|
constructor() {
|
|
12963
13025
|
this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
|
|
@@ -13092,7 +13154,7 @@ var ShadowCss = class {
|
|
|
13092
13154
|
let content = rule2.content;
|
|
13093
13155
|
if (rule2.selector[0] !== "@") {
|
|
13094
13156
|
selector = this._scopeSelector(rule2.selector, scopeSelector, hostSelector);
|
|
13095
|
-
} else if (
|
|
13157
|
+
} else if (scopedAtRuleIdentifiers.some((atRule2) => rule2.selector.startsWith(atRule2))) {
|
|
13096
13158
|
content = this._scopeSelectors(rule2.content, scopeSelector, hostSelector);
|
|
13097
13159
|
} else if (rule2.selector.startsWith("@font-face") || rule2.selector.startsWith("@page")) {
|
|
13098
13160
|
content = this._stripScopingSelectors(rule2.content);
|
|
@@ -13436,16 +13498,18 @@ var OpKind;
|
|
|
13436
13498
|
OpKind2[OpKind2["Projection"] = 33] = "Projection";
|
|
13437
13499
|
OpKind2[OpKind2["RepeaterCreate"] = 34] = "RepeaterCreate";
|
|
13438
13500
|
OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
|
|
13439
|
-
OpKind2[OpKind2["
|
|
13440
|
-
OpKind2[OpKind2["
|
|
13441
|
-
OpKind2[OpKind2["
|
|
13442
|
-
OpKind2[OpKind2["
|
|
13443
|
-
OpKind2[OpKind2["
|
|
13444
|
-
OpKind2[OpKind2["
|
|
13445
|
-
OpKind2[OpKind2["
|
|
13446
|
-
OpKind2[OpKind2["
|
|
13447
|
-
OpKind2[OpKind2["
|
|
13448
|
-
OpKind2[OpKind2["
|
|
13501
|
+
OpKind2[OpKind2["TwoWayProperty"] = 36] = "TwoWayProperty";
|
|
13502
|
+
OpKind2[OpKind2["TwoWayListener"] = 37] = "TwoWayListener";
|
|
13503
|
+
OpKind2[OpKind2["I18nStart"] = 38] = "I18nStart";
|
|
13504
|
+
OpKind2[OpKind2["I18n"] = 39] = "I18n";
|
|
13505
|
+
OpKind2[OpKind2["I18nEnd"] = 40] = "I18nEnd";
|
|
13506
|
+
OpKind2[OpKind2["I18nExpression"] = 41] = "I18nExpression";
|
|
13507
|
+
OpKind2[OpKind2["I18nApply"] = 42] = "I18nApply";
|
|
13508
|
+
OpKind2[OpKind2["IcuStart"] = 43] = "IcuStart";
|
|
13509
|
+
OpKind2[OpKind2["IcuEnd"] = 44] = "IcuEnd";
|
|
13510
|
+
OpKind2[OpKind2["IcuPlaceholder"] = 45] = "IcuPlaceholder";
|
|
13511
|
+
OpKind2[OpKind2["I18nContext"] = 46] = "I18nContext";
|
|
13512
|
+
OpKind2[OpKind2["I18nAttributes"] = 47] = "I18nAttributes";
|
|
13449
13513
|
})(OpKind || (OpKind = {}));
|
|
13450
13514
|
var ExpressionKind;
|
|
13451
13515
|
(function(ExpressionKind2) {
|
|
@@ -13475,6 +13539,7 @@ var ExpressionKind;
|
|
|
13475
13539
|
ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
|
|
13476
13540
|
ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 24] = "DerivedRepeaterVar";
|
|
13477
13541
|
ExpressionKind2[ExpressionKind2["ConstCollected"] = 25] = "ConstCollected";
|
|
13542
|
+
ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 26] = "TwoWayBindingSet";
|
|
13478
13543
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
13479
13544
|
var VariableFlags;
|
|
13480
13545
|
(function(VariableFlags2) {
|
|
@@ -13508,6 +13573,7 @@ var BindingKind;
|
|
|
13508
13573
|
BindingKind2[BindingKind2["Template"] = 4] = "Template";
|
|
13509
13574
|
BindingKind2[BindingKind2["I18n"] = 5] = "I18n";
|
|
13510
13575
|
BindingKind2[BindingKind2["Animation"] = 6] = "Animation";
|
|
13576
|
+
BindingKind2[BindingKind2["TwoWayProperty"] = 7] = "TwoWayProperty";
|
|
13511
13577
|
})(BindingKind || (BindingKind = {}));
|
|
13512
13578
|
var I18nParamResolutionTime;
|
|
13513
13579
|
(function(I18nParamResolutionTime2) {
|
|
@@ -13656,6 +13722,21 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
|
|
|
13656
13722
|
sourceSpan
|
|
13657
13723
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
13658
13724
|
}
|
|
13725
|
+
function createTwoWayPropertyOp(target, name, expression, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {
|
|
13726
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
13727
|
+
kind: OpKind.TwoWayProperty,
|
|
13728
|
+
target,
|
|
13729
|
+
name,
|
|
13730
|
+
expression,
|
|
13731
|
+
securityContext,
|
|
13732
|
+
sanitizer: null,
|
|
13733
|
+
isStructuralTemplateAttribute,
|
|
13734
|
+
templateKind,
|
|
13735
|
+
i18nContext,
|
|
13736
|
+
i18nMessage,
|
|
13737
|
+
sourceSpan
|
|
13738
|
+
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
13739
|
+
}
|
|
13659
13740
|
function createStylePropOp(xref, name, expression, unit, sourceSpan) {
|
|
13660
13741
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
13661
13742
|
kind: OpKind.StyleProp,
|
|
@@ -13961,6 +14042,31 @@ var ResetViewExpr = class extends ExpressionBase {
|
|
|
13961
14042
|
return new ResetViewExpr(this.expr.clone());
|
|
13962
14043
|
}
|
|
13963
14044
|
};
|
|
14045
|
+
var TwoWayBindingSetExpr = class extends ExpressionBase {
|
|
14046
|
+
constructor(target, value) {
|
|
14047
|
+
super();
|
|
14048
|
+
this.target = target;
|
|
14049
|
+
this.value = value;
|
|
14050
|
+
this.kind = ExpressionKind.TwoWayBindingSet;
|
|
14051
|
+
}
|
|
14052
|
+
visitExpression(visitor, context) {
|
|
14053
|
+
this.target.visitExpression(visitor, context);
|
|
14054
|
+
this.value.visitExpression(visitor, context);
|
|
14055
|
+
}
|
|
14056
|
+
isEquivalent(other) {
|
|
14057
|
+
return this.target.isEquivalent(other.target) && this.value.isEquivalent(other.value);
|
|
14058
|
+
}
|
|
14059
|
+
isConstant() {
|
|
14060
|
+
return false;
|
|
14061
|
+
}
|
|
14062
|
+
transformInternalExpressions(transform2, flags) {
|
|
14063
|
+
this.target = transformExpressionsInExpression(this.target, transform2, flags);
|
|
14064
|
+
this.value = transformExpressionsInExpression(this.value, transform2, flags);
|
|
14065
|
+
}
|
|
14066
|
+
clone() {
|
|
14067
|
+
return new TwoWayBindingSetExpr(this.target, this.value);
|
|
14068
|
+
}
|
|
14069
|
+
};
|
|
13964
14070
|
var ReadVariableExpr = class extends ExpressionBase {
|
|
13965
14071
|
constructor(xref) {
|
|
13966
14072
|
super();
|
|
@@ -14412,6 +14518,10 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
14412
14518
|
}
|
|
14413
14519
|
op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform2, flags);
|
|
14414
14520
|
break;
|
|
14521
|
+
case OpKind.TwoWayProperty:
|
|
14522
|
+
op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
|
|
14523
|
+
op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform2, flags);
|
|
14524
|
+
break;
|
|
14415
14525
|
case OpKind.I18nExpression:
|
|
14416
14526
|
op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
|
|
14417
14527
|
break;
|
|
@@ -14439,6 +14549,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
14439
14549
|
}
|
|
14440
14550
|
break;
|
|
14441
14551
|
case OpKind.Listener:
|
|
14552
|
+
case OpKind.TwoWayListener:
|
|
14442
14553
|
for (const innerOp of op.handlerOps) {
|
|
14443
14554
|
transformExpressionsInOp(innerOp, transform2, flags | VisitorContextFlag.InChildOperation);
|
|
14444
14555
|
}
|
|
@@ -14914,6 +15025,20 @@ function createListenerOp(target, targetSlot, name, tag, handlerOps, animationPh
|
|
|
14914
15025
|
sourceSpan
|
|
14915
15026
|
}, NEW_OP);
|
|
14916
15027
|
}
|
|
15028
|
+
function createTwoWayListenerOp(target, targetSlot, name, tag, handlerOps, sourceSpan) {
|
|
15029
|
+
const handlerList = new OpList();
|
|
15030
|
+
handlerList.push(handlerOps);
|
|
15031
|
+
return __spreadValues({
|
|
15032
|
+
kind: OpKind.TwoWayListener,
|
|
15033
|
+
target,
|
|
15034
|
+
targetSlot,
|
|
15035
|
+
tag,
|
|
15036
|
+
name,
|
|
15037
|
+
handlerOps: handlerList,
|
|
15038
|
+
handlerFnName: null,
|
|
15039
|
+
sourceSpan
|
|
15040
|
+
}, NEW_OP);
|
|
15041
|
+
}
|
|
14917
15042
|
function createPipeOp(xref, slot, name) {
|
|
14918
15043
|
return __spreadValues(__spreadValues({
|
|
14919
15044
|
kind: OpKind.Pipe,
|
|
@@ -14961,7 +15086,7 @@ function createExtractedAttributeOp(target, bindingKind, namespace, name, expres
|
|
|
14961
15086
|
trustedValueFn: null
|
|
14962
15087
|
}, NEW_OP);
|
|
14963
15088
|
}
|
|
14964
|
-
function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
|
|
15089
|
+
function createDeferOp(xref, main, mainSlot, metadata, resolverFn, sourceSpan) {
|
|
14965
15090
|
return __spreadProps(__spreadValues(__spreadValues({
|
|
14966
15091
|
kind: OpKind.Defer,
|
|
14967
15092
|
xref,
|
|
@@ -14980,7 +15105,7 @@ function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
|
|
|
14980
15105
|
errorView: null,
|
|
14981
15106
|
errorSlot: null,
|
|
14982
15107
|
metadata,
|
|
14983
|
-
resolverFn
|
|
15108
|
+
resolverFn,
|
|
14984
15109
|
sourceSpan
|
|
14985
15110
|
}, NEW_OP), TRAIT_CONSUMES_SLOT), {
|
|
14986
15111
|
numSlotsUsed: 2
|
|
@@ -15110,11 +15235,12 @@ var CompilationJob = class {
|
|
|
15110
15235
|
}
|
|
15111
15236
|
};
|
|
15112
15237
|
var ComponentCompilationJob = class extends CompilationJob {
|
|
15113
|
-
constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
|
|
15238
|
+
constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta, allDeferrableDepsFn) {
|
|
15114
15239
|
super(componentName, pool, compatibility);
|
|
15115
15240
|
this.relativeContextFilePath = relativeContextFilePath;
|
|
15116
15241
|
this.i18nUseExternalIds = i18nUseExternalIds;
|
|
15117
15242
|
this.deferBlocksMeta = deferBlocksMeta;
|
|
15243
|
+
this.allDeferrableDepsFn = allDeferrableDepsFn;
|
|
15118
15244
|
this.kind = CompilationJobKind.Tmpl;
|
|
15119
15245
|
this.fnSuffix = "Template";
|
|
15120
15246
|
this.views = /* @__PURE__ */ new Map();
|
|
@@ -15157,7 +15283,7 @@ var CompilationUnit = class {
|
|
|
15157
15283
|
*ops() {
|
|
15158
15284
|
for (const op of this.create) {
|
|
15159
15285
|
yield op;
|
|
15160
|
-
if (op.kind === OpKind.Listener) {
|
|
15286
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
15161
15287
|
for (const listenerOp of op.handlerOps) {
|
|
15162
15288
|
yield listenerOp;
|
|
15163
15289
|
}
|
|
@@ -15342,6 +15468,18 @@ function extractAttributes(job) {
|
|
|
15342
15468
|
);
|
|
15343
15469
|
}
|
|
15344
15470
|
break;
|
|
15471
|
+
case OpKind.TwoWayProperty:
|
|
15472
|
+
OpList.insertBefore(createExtractedAttributeOp(
|
|
15473
|
+
op.target,
|
|
15474
|
+
BindingKind.TwoWayProperty,
|
|
15475
|
+
null,
|
|
15476
|
+
op.name,
|
|
15477
|
+
null,
|
|
15478
|
+
null,
|
|
15479
|
+
null,
|
|
15480
|
+
op.securityContext
|
|
15481
|
+
), lookupElement$2(elements, op.target));
|
|
15482
|
+
break;
|
|
15345
15483
|
case OpKind.StyleProp:
|
|
15346
15484
|
case OpKind.ClassProp:
|
|
15347
15485
|
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr) {
|
|
@@ -15379,6 +15517,21 @@ function extractAttributes(job) {
|
|
|
15379
15517
|
}
|
|
15380
15518
|
}
|
|
15381
15519
|
break;
|
|
15520
|
+
case OpKind.TwoWayListener:
|
|
15521
|
+
if (job.kind !== CompilationJobKind.Host) {
|
|
15522
|
+
const extractedAttributeOp = createExtractedAttributeOp(
|
|
15523
|
+
op.target,
|
|
15524
|
+
BindingKind.Property,
|
|
15525
|
+
null,
|
|
15526
|
+
op.name,
|
|
15527
|
+
null,
|
|
15528
|
+
null,
|
|
15529
|
+
null,
|
|
15530
|
+
SecurityContext.NONE
|
|
15531
|
+
);
|
|
15532
|
+
OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target));
|
|
15533
|
+
}
|
|
15534
|
+
break;
|
|
15382
15535
|
}
|
|
15383
15536
|
}
|
|
15384
15537
|
}
|
|
@@ -15450,6 +15603,12 @@ function specializeBindings(job) {
|
|
|
15450
15603
|
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
|
|
15451
15604
|
}
|
|
15452
15605
|
break;
|
|
15606
|
+
case BindingKind.TwoWayProperty:
|
|
15607
|
+
if (!(op.expression instanceof Expression)) {
|
|
15608
|
+
throw new Error(`Expected value of two-way property binding "${op.name}" to be an expression`);
|
|
15609
|
+
}
|
|
15610
|
+
OpList.replace(op, createTwoWayPropertyOp(op.target, op.name, op.expression, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
|
|
15611
|
+
break;
|
|
15453
15612
|
case BindingKind.I18n:
|
|
15454
15613
|
case BindingKind.ClassName:
|
|
15455
15614
|
case BindingKind.StyleProperty:
|
|
@@ -15484,7 +15643,9 @@ var CHAINABLE = /* @__PURE__ */ new Set([
|
|
|
15484
15643
|
Identifiers.stylePropInterpolateV,
|
|
15485
15644
|
Identifiers.syntheticHostListener,
|
|
15486
15645
|
Identifiers.syntheticHostProperty,
|
|
15487
|
-
Identifiers.templateCreate
|
|
15646
|
+
Identifiers.templateCreate,
|
|
15647
|
+
Identifiers.twoWayProperty,
|
|
15648
|
+
Identifiers.twoWayListener
|
|
15488
15649
|
]);
|
|
15489
15650
|
function chain(job) {
|
|
15490
15651
|
for (const unit of job.units) {
|
|
@@ -15685,7 +15846,7 @@ var ElementAttributes = class {
|
|
|
15685
15846
|
}
|
|
15686
15847
|
get bindings() {
|
|
15687
15848
|
var _a2;
|
|
15688
|
-
return (_a2 = this.
|
|
15849
|
+
return (_a2 = this.propertyBindings) != null ? _a2 : FLYWEIGHT_ARRAY;
|
|
15689
15850
|
}
|
|
15690
15851
|
get template() {
|
|
15691
15852
|
var _a2;
|
|
@@ -15699,6 +15860,7 @@ var ElementAttributes = class {
|
|
|
15699
15860
|
this.compatibility = compatibility;
|
|
15700
15861
|
this.known = /* @__PURE__ */ new Map();
|
|
15701
15862
|
this.byKind = /* @__PURE__ */ new Map();
|
|
15863
|
+
this.propertyBindings = null;
|
|
15702
15864
|
this.projectAs = null;
|
|
15703
15865
|
}
|
|
15704
15866
|
isKnown(kind, name, value) {
|
|
@@ -15740,10 +15902,16 @@ var ElementAttributes = class {
|
|
|
15740
15902
|
}
|
|
15741
15903
|
}
|
|
15742
15904
|
arrayFor(kind) {
|
|
15743
|
-
|
|
15744
|
-
|
|
15905
|
+
var _a2;
|
|
15906
|
+
if (kind === BindingKind.Property || kind === BindingKind.TwoWayProperty) {
|
|
15907
|
+
(_a2 = this.propertyBindings) != null ? _a2 : this.propertyBindings = [];
|
|
15908
|
+
return this.propertyBindings;
|
|
15909
|
+
} else {
|
|
15910
|
+
if (!this.byKind.has(kind)) {
|
|
15911
|
+
this.byKind.set(kind, []);
|
|
15912
|
+
}
|
|
15913
|
+
return this.byKind.get(kind);
|
|
15745
15914
|
}
|
|
15746
|
-
return this.byKind.get(kind);
|
|
15747
15915
|
}
|
|
15748
15916
|
};
|
|
15749
15917
|
function getAttributeNameLiterals$1(namespace, name) {
|
|
@@ -15816,16 +15984,23 @@ function convertI18nBindings(job) {
|
|
|
15816
15984
|
}
|
|
15817
15985
|
}
|
|
15818
15986
|
function createDeferDepsFns(job) {
|
|
15987
|
+
var _a2;
|
|
15819
15988
|
for (const unit of job.units) {
|
|
15820
15989
|
for (const op of unit.create) {
|
|
15821
15990
|
if (op.kind === OpKind.Defer) {
|
|
15822
15991
|
if (op.metadata.deps.length === 0) {
|
|
15823
15992
|
continue;
|
|
15824
15993
|
}
|
|
15994
|
+
if (op.resolverFn !== null) {
|
|
15995
|
+
continue;
|
|
15996
|
+
}
|
|
15825
15997
|
const dependencies = [];
|
|
15826
15998
|
for (const dep of op.metadata.deps) {
|
|
15827
15999
|
if (dep.isDeferrable) {
|
|
15828
|
-
const innerFn = arrowFn(
|
|
16000
|
+
const innerFn = arrowFn(
|
|
16001
|
+
[new FnParam("m", DYNAMIC_TYPE)],
|
|
16002
|
+
variable("m").prop(dep.isDefaultImport ? "default" : dep.symbolName)
|
|
16003
|
+
);
|
|
15829
16004
|
const importExpr2 = new DynamicImportExpr(dep.importPath).prop("then").callFn([innerFn]);
|
|
15830
16005
|
dependencies.push(importExpr2);
|
|
15831
16006
|
} else {
|
|
@@ -15836,9 +16011,10 @@ function createDeferDepsFns(job) {
|
|
|
15836
16011
|
if (op.handle.slot === null) {
|
|
15837
16012
|
throw new Error("AssertionError: slot must be assigned bfore extracting defer deps functions");
|
|
15838
16013
|
}
|
|
16014
|
+
const fullPathName = (_a2 = unit.fnName) == null ? void 0 : _a2.replace(`_Template`, ``);
|
|
15839
16015
|
op.resolverFn = job.pool.getSharedFunctionReference(
|
|
15840
16016
|
depsFnExpr,
|
|
15841
|
-
`${
|
|
16017
|
+
`${fullPathName}_Defer_${op.handle.slot}_DepsFn`,
|
|
15842
16018
|
false
|
|
15843
16019
|
);
|
|
15844
16020
|
}
|
|
@@ -16410,6 +16586,7 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
16410
16586
|
}
|
|
16411
16587
|
break;
|
|
16412
16588
|
case OpKind.Listener:
|
|
16589
|
+
case OpKind.TwoWayListener:
|
|
16413
16590
|
op.handlerOps.prepend(generateVariablesInScopeForView(view, scope));
|
|
16414
16591
|
break;
|
|
16415
16592
|
}
|
|
@@ -16969,15 +17146,11 @@ var Parser$1 = class {
|
|
|
16969
17146
|
this._lexer = _lexer;
|
|
16970
17147
|
this.errors = [];
|
|
16971
17148
|
}
|
|
16972
|
-
parseAction(input,
|
|
17149
|
+
parseAction(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
16973
17150
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
16974
17151
|
const sourceToLex = this._stripComments(input);
|
|
16975
17152
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
16976
|
-
|
|
16977
|
-
if (isAssignmentEvent) {
|
|
16978
|
-
flags |= 2;
|
|
16979
|
-
}
|
|
16980
|
-
const ast = new _ParseAST(input, location, absoluteOffset, tokens, flags, this.errors, 0).parseChain();
|
|
17153
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 1, this.errors, 0).parseChain();
|
|
16981
17154
|
return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);
|
|
16982
17155
|
}
|
|
16983
17156
|
parseBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
@@ -17330,7 +17503,7 @@ var _ParseAST = class {
|
|
|
17330
17503
|
let result = this.parseExpression();
|
|
17331
17504
|
if (this.consumeOptionalOperator("|")) {
|
|
17332
17505
|
if (this.parseFlags & 1) {
|
|
17333
|
-
this.error(
|
|
17506
|
+
this.error(`Cannot have a pipe in an action expression`);
|
|
17334
17507
|
}
|
|
17335
17508
|
do {
|
|
17336
17509
|
const nameStart = this.inputIndex;
|
|
@@ -17624,14 +17797,14 @@ var _ParseAST = class {
|
|
|
17624
17797
|
const nameSpan = this.sourceSpan(nameStart);
|
|
17625
17798
|
let receiver;
|
|
17626
17799
|
if (isSafe) {
|
|
17627
|
-
if (this.
|
|
17800
|
+
if (this.consumeOptionalOperator("=")) {
|
|
17628
17801
|
this.error("The '?.' operator cannot be used in the assignment");
|
|
17629
17802
|
receiver = new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
17630
17803
|
} else {
|
|
17631
17804
|
receiver = new SafePropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
|
|
17632
17805
|
}
|
|
17633
17806
|
} else {
|
|
17634
|
-
if (this.
|
|
17807
|
+
if (this.consumeOptionalOperator("=")) {
|
|
17635
17808
|
if (!(this.parseFlags & 1)) {
|
|
17636
17809
|
this.error("Bindings cannot contain assignments");
|
|
17637
17810
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
@@ -17655,14 +17828,6 @@ var _ParseAST = class {
|
|
|
17655
17828
|
const sourceSpan = this.sourceSpan(start);
|
|
17656
17829
|
return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) : new Call(span, sourceSpan, receiver, args, argumentSpan);
|
|
17657
17830
|
}
|
|
17658
|
-
consumeOptionalAssignment() {
|
|
17659
|
-
if (this.parseFlags & 2 && this.next.isOperator("!") && this.peek(1).isOperator("=")) {
|
|
17660
|
-
this.advance();
|
|
17661
|
-
this.advance();
|
|
17662
|
-
return true;
|
|
17663
|
-
}
|
|
17664
|
-
return this.consumeOptionalOperator("=");
|
|
17665
|
-
}
|
|
17666
17831
|
parseCallArguments() {
|
|
17667
17832
|
if (this.next.isCharacter($RPAREN))
|
|
17668
17833
|
return [];
|
|
@@ -22789,7 +22954,7 @@ function nameFunctionsAndVariables(job) {
|
|
|
22789
22954
|
}
|
|
22790
22955
|
function addNamesToView(unit, baseName, state, compatibility) {
|
|
22791
22956
|
if (unit.fnName === null) {
|
|
22792
|
-
unit.fnName = sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`);
|
|
22957
|
+
unit.fnName = unit.job.pool.uniqueName(sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`), false);
|
|
22793
22958
|
}
|
|
22794
22959
|
const varNames = /* @__PURE__ */ new Map();
|
|
22795
22960
|
for (const op of unit.ops()) {
|
|
@@ -22819,6 +22984,15 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
22819
22984
|
}
|
|
22820
22985
|
op.handlerFnName = sanitizeIdentifier(op.handlerFnName);
|
|
22821
22986
|
break;
|
|
22987
|
+
case OpKind.TwoWayListener:
|
|
22988
|
+
if (op.handlerFnName !== null) {
|
|
22989
|
+
break;
|
|
22990
|
+
}
|
|
22991
|
+
if (op.targetSlot.slot === null) {
|
|
22992
|
+
throw new Error(`Expected a slot to be assigned`);
|
|
22993
|
+
}
|
|
22994
|
+
op.handlerFnName = sanitizeIdentifier(`${unit.fnName}_${op.tag.replace("-", "_")}_${op.name}_${op.targetSlot.slot}_listener`);
|
|
22995
|
+
break;
|
|
22822
22996
|
case OpKind.Variable:
|
|
22823
22997
|
varNames.set(op.xref, getVariableName(unit, op.variable, state));
|
|
22824
22998
|
break;
|
|
@@ -22905,7 +23079,7 @@ function stripImportant(name) {
|
|
|
22905
23079
|
function mergeNextContextExpressions(job) {
|
|
22906
23080
|
for (const unit of job.units) {
|
|
22907
23081
|
for (const op of unit.create) {
|
|
22908
|
-
if (op.kind === OpKind.Listener) {
|
|
23082
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
22909
23083
|
mergeNextContextsInOps(op.handlerOps);
|
|
22910
23084
|
}
|
|
22911
23085
|
}
|
|
@@ -23011,9 +23185,15 @@ function kindWithInterpolationTest(kind, interpolation) {
|
|
|
23011
23185
|
return op.kind === kind && interpolation === op.expression instanceof Interpolation;
|
|
23012
23186
|
};
|
|
23013
23187
|
}
|
|
23188
|
+
function basicListenerKindTest(op) {
|
|
23189
|
+
return op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) || op.kind === OpKind.TwoWayListener;
|
|
23190
|
+
}
|
|
23191
|
+
function nonInterpolationPropertyKindTest(op) {
|
|
23192
|
+
return (op.kind === OpKind.Property || op.kind === OpKind.TwoWayProperty) && !(op.expression instanceof Interpolation);
|
|
23193
|
+
}
|
|
23014
23194
|
var CREATE_ORDERING = [
|
|
23015
23195
|
{ test: (op) => op.kind === OpKind.Listener && op.hostListener && op.isAnimationListener },
|
|
23016
|
-
{ test:
|
|
23196
|
+
{ test: basicListenerKindTest }
|
|
23017
23197
|
];
|
|
23018
23198
|
var UPDATE_ORDERING = [
|
|
23019
23199
|
{ test: kindTest(OpKind.StyleMap), transform: keepLast },
|
|
@@ -23022,7 +23202,7 @@ var UPDATE_ORDERING = [
|
|
|
23022
23202
|
{ test: kindTest(OpKind.ClassProp) },
|
|
23023
23203
|
{ test: kindWithInterpolationTest(OpKind.Attribute, true) },
|
|
23024
23204
|
{ test: kindWithInterpolationTest(OpKind.Property, true) },
|
|
23025
|
-
{ test:
|
|
23205
|
+
{ test: nonInterpolationPropertyKindTest },
|
|
23026
23206
|
{ test: kindWithInterpolationTest(OpKind.Attribute, false) }
|
|
23027
23207
|
];
|
|
23028
23208
|
var UPDATE_HOST_ORDERING = [
|
|
@@ -23036,11 +23216,13 @@ var UPDATE_HOST_ORDERING = [
|
|
|
23036
23216
|
];
|
|
23037
23217
|
var handledOpKinds = /* @__PURE__ */ new Set([
|
|
23038
23218
|
OpKind.Listener,
|
|
23219
|
+
OpKind.TwoWayListener,
|
|
23039
23220
|
OpKind.StyleMap,
|
|
23040
23221
|
OpKind.ClassMap,
|
|
23041
23222
|
OpKind.StyleProp,
|
|
23042
23223
|
OpKind.ClassProp,
|
|
23043
23224
|
OpKind.Property,
|
|
23225
|
+
OpKind.TwoWayProperty,
|
|
23044
23226
|
OpKind.HostProperty,
|
|
23045
23227
|
OpKind.Attribute
|
|
23046
23228
|
]);
|
|
@@ -23404,6 +23586,12 @@ function listener(name, handlerFn, eventTargetResolver, syntheticHost, sourceSpa
|
|
|
23404
23586
|
}
|
|
23405
23587
|
return call(syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener, args, sourceSpan);
|
|
23406
23588
|
}
|
|
23589
|
+
function twoWayBindingSet(target, value) {
|
|
23590
|
+
return importExpr(Identifiers.twoWayBindingSet).callFn([target, value]);
|
|
23591
|
+
}
|
|
23592
|
+
function twoWayListener(name, handlerFn, sourceSpan) {
|
|
23593
|
+
return call(Identifiers.twoWayListener, [literal(name), handlerFn], sourceSpan);
|
|
23594
|
+
}
|
|
23407
23595
|
function pipe(slot, name) {
|
|
23408
23596
|
return call(Identifiers.pipe, [
|
|
23409
23597
|
literal(slot),
|
|
@@ -23564,6 +23752,13 @@ function property(name, expression, sanitizer, sourceSpan) {
|
|
|
23564
23752
|
}
|
|
23565
23753
|
return call(Identifiers.property, args, sourceSpan);
|
|
23566
23754
|
}
|
|
23755
|
+
function twoWayProperty(name, expression, sanitizer, sourceSpan) {
|
|
23756
|
+
const args = [literal(name), expression];
|
|
23757
|
+
if (sanitizer !== null) {
|
|
23758
|
+
args.push(sanitizer);
|
|
23759
|
+
}
|
|
23760
|
+
return call(Identifiers.twoWayProperty, args, sourceSpan);
|
|
23761
|
+
}
|
|
23567
23762
|
function attribute(name, expression, sanitizer, namespace) {
|
|
23568
23763
|
const args = [literal(name), expression];
|
|
23569
23764
|
if (sanitizer !== null || namespace !== null) {
|
|
@@ -23938,6 +24133,9 @@ function reifyCreateOperations(unit, ops) {
|
|
|
23938
24133
|
}
|
|
23939
24134
|
OpList.replace(op, listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isAnimationListener, op.sourceSpan));
|
|
23940
24135
|
break;
|
|
24136
|
+
case OpKind.TwoWayListener:
|
|
24137
|
+
OpList.replace(op, twoWayListener(op.name, reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, true), op.sourceSpan));
|
|
24138
|
+
break;
|
|
23941
24139
|
case OpKind.Variable:
|
|
23942
24140
|
if (op.variable.name === null) {
|
|
23943
24141
|
throw new Error(`AssertionError: unnamed variable ${op.xref}`);
|
|
@@ -24044,6 +24242,9 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
24044
24242
|
OpList.replace(op, property(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
24045
24243
|
}
|
|
24046
24244
|
break;
|
|
24245
|
+
case OpKind.TwoWayProperty:
|
|
24246
|
+
OpList.replace(op, twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
24247
|
+
break;
|
|
24047
24248
|
case OpKind.StyleProp:
|
|
24048
24249
|
if (op.expression instanceof Interpolation) {
|
|
24049
24250
|
OpList.replace(op, stylePropInterpolate(op.name, op.expression.strings, op.expression.expressions, op.unit, op.sourceSpan));
|
|
@@ -24134,6 +24335,8 @@ function reifyIrExpression(expr) {
|
|
|
24134
24335
|
return reference(expr.targetSlot.slot + 1 + expr.offset);
|
|
24135
24336
|
case ExpressionKind.LexicalRead:
|
|
24136
24337
|
throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);
|
|
24338
|
+
case ExpressionKind.TwoWayBindingSet:
|
|
24339
|
+
throw new Error(`AssertionError: unresolved TwoWayBindingSet`);
|
|
24137
24340
|
case ExpressionKind.RestoreView:
|
|
24138
24341
|
if (typeof expr.view === "number") {
|
|
24139
24342
|
throw new Error(`AssertionError: unresolved RestoreView`);
|
|
@@ -24262,6 +24465,7 @@ function processLexicalScope$1(view, ops) {
|
|
|
24262
24465
|
}
|
|
24263
24466
|
break;
|
|
24264
24467
|
case OpKind.Listener:
|
|
24468
|
+
case OpKind.TwoWayListener:
|
|
24265
24469
|
processLexicalScope$1(view, op.handlerOps);
|
|
24266
24470
|
break;
|
|
24267
24471
|
}
|
|
@@ -24290,10 +24494,12 @@ function resolveDollarEvent(job) {
|
|
|
24290
24494
|
}
|
|
24291
24495
|
function transformDollarEvent(unit, ops) {
|
|
24292
24496
|
for (const op of ops) {
|
|
24293
|
-
if (op.kind === OpKind.Listener) {
|
|
24497
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
24294
24498
|
transformExpressionsInOp(op, (expr) => {
|
|
24295
24499
|
if (expr instanceof LexicalReadExpr && expr.name === "$event") {
|
|
24296
|
-
op.
|
|
24500
|
+
if (op.kind === OpKind.Listener) {
|
|
24501
|
+
op.consumesDollarEvent = true;
|
|
24502
|
+
}
|
|
24297
24503
|
return new ReadVarExpr(expr.name);
|
|
24298
24504
|
}
|
|
24299
24505
|
return expr;
|
|
@@ -24557,12 +24763,13 @@ function processLexicalScope(unit, ops, savedView) {
|
|
|
24557
24763
|
}
|
|
24558
24764
|
break;
|
|
24559
24765
|
case OpKind.Listener:
|
|
24766
|
+
case OpKind.TwoWayListener:
|
|
24560
24767
|
processLexicalScope(unit, op.handlerOps, savedView);
|
|
24561
24768
|
break;
|
|
24562
24769
|
}
|
|
24563
24770
|
}
|
|
24564
24771
|
for (const op of ops) {
|
|
24565
|
-
if (op.kind == OpKind.Listener) {
|
|
24772
|
+
if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
24566
24773
|
continue;
|
|
24567
24774
|
}
|
|
24568
24775
|
transformExpressionsInOp(op, (expr, flags) => {
|
|
@@ -24659,6 +24866,51 @@ function getOnlySecurityContext(securityContext) {
|
|
|
24659
24866
|
}
|
|
24660
24867
|
return securityContext;
|
|
24661
24868
|
}
|
|
24869
|
+
function transformTwoWayBindingSet(job) {
|
|
24870
|
+
for (const unit of job.units) {
|
|
24871
|
+
for (const op of unit.create) {
|
|
24872
|
+
if (op.kind === OpKind.TwoWayListener) {
|
|
24873
|
+
transformExpressionsInOp(op, (expr) => {
|
|
24874
|
+
if (expr instanceof TwoWayBindingSetExpr) {
|
|
24875
|
+
return wrapAction(expr.target, expr.value);
|
|
24876
|
+
}
|
|
24877
|
+
return expr;
|
|
24878
|
+
}, VisitorContextFlag.InChildOperation);
|
|
24879
|
+
}
|
|
24880
|
+
}
|
|
24881
|
+
}
|
|
24882
|
+
}
|
|
24883
|
+
function wrapSetOperation(target, value) {
|
|
24884
|
+
return twoWayBindingSet(target, value).or(target.set(value));
|
|
24885
|
+
}
|
|
24886
|
+
function isReadExpression(value) {
|
|
24887
|
+
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr;
|
|
24888
|
+
}
|
|
24889
|
+
function wrapAction(target, value) {
|
|
24890
|
+
if (isReadExpression(target)) {
|
|
24891
|
+
return wrapSetOperation(target, value);
|
|
24892
|
+
}
|
|
24893
|
+
if (target instanceof BinaryOperatorExpr && isReadExpression(target.rhs)) {
|
|
24894
|
+
return new BinaryOperatorExpr(target.operator, target.lhs, wrapSetOperation(target.rhs, value));
|
|
24895
|
+
}
|
|
24896
|
+
if (target instanceof ConditionalExpr && isReadExpression(target.falseCase)) {
|
|
24897
|
+
return new ConditionalExpr(target.condition, target.trueCase, wrapSetOperation(target.falseCase, value));
|
|
24898
|
+
}
|
|
24899
|
+
if (target instanceof NotExpr) {
|
|
24900
|
+
let expr = target.condition;
|
|
24901
|
+
while (true) {
|
|
24902
|
+
if (expr instanceof NotExpr) {
|
|
24903
|
+
expr = expr.condition;
|
|
24904
|
+
} else {
|
|
24905
|
+
if (isReadExpression(expr)) {
|
|
24906
|
+
return wrapSetOperation(expr, value);
|
|
24907
|
+
}
|
|
24908
|
+
break;
|
|
24909
|
+
}
|
|
24910
|
+
}
|
|
24911
|
+
}
|
|
24912
|
+
throw new Error(`Unsupported expression in two-way action binding.`);
|
|
24913
|
+
}
|
|
24662
24914
|
function saveAndRestoreView(job) {
|
|
24663
24915
|
for (const unit of job.units) {
|
|
24664
24916
|
unit.create.prepend([
|
|
@@ -24669,7 +24921,7 @@ function saveAndRestoreView(job) {
|
|
|
24669
24921
|
}, new GetCurrentViewExpr(), VariableFlags.None)
|
|
24670
24922
|
]);
|
|
24671
24923
|
for (const op of unit.create) {
|
|
24672
|
-
if (op.kind !== OpKind.Listener) {
|
|
24924
|
+
if (op.kind !== OpKind.Listener && op.kind !== OpKind.TwoWayListener) {
|
|
24673
24925
|
continue;
|
|
24674
24926
|
}
|
|
24675
24927
|
let needsRestoreView = unit !== job.root;
|
|
@@ -24796,7 +25048,7 @@ function generateTemporaries(ops) {
|
|
|
24796
25048
|
});
|
|
24797
25049
|
generatedStatements.push(...Array.from(new Set(defs.values())).map((name) => createStatementOp(new DeclareVarStmt(name))));
|
|
24798
25050
|
opCount++;
|
|
24799
|
-
if (op.kind === OpKind.Listener) {
|
|
25051
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
24800
25052
|
op.handlerOps.prepend(generateTemporaries(op.handlerOps));
|
|
24801
25053
|
}
|
|
24802
25054
|
}
|
|
@@ -24968,6 +25220,8 @@ function varsUsedByOp(op) {
|
|
|
24968
25220
|
slots += op.expression.expressions.length;
|
|
24969
25221
|
}
|
|
24970
25222
|
return slots;
|
|
25223
|
+
case OpKind.TwoWayProperty:
|
|
25224
|
+
return 1;
|
|
24971
25225
|
case OpKind.StyleProp:
|
|
24972
25226
|
case OpKind.ClassProp:
|
|
24973
25227
|
case OpKind.StyleMap:
|
|
@@ -25015,14 +25269,14 @@ function optimizeVariables(job) {
|
|
|
25015
25269
|
inlineAlwaysInlineVariables(unit.create);
|
|
25016
25270
|
inlineAlwaysInlineVariables(unit.update);
|
|
25017
25271
|
for (const op of unit.create) {
|
|
25018
|
-
if (op.kind === OpKind.Listener) {
|
|
25272
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
25019
25273
|
inlineAlwaysInlineVariables(op.handlerOps);
|
|
25020
25274
|
}
|
|
25021
25275
|
}
|
|
25022
25276
|
optimizeVariablesInOpList(unit.create, job.compatibility);
|
|
25023
25277
|
optimizeVariablesInOpList(unit.update, job.compatibility);
|
|
25024
25278
|
for (const op of unit.create) {
|
|
25025
|
-
if (op.kind === OpKind.Listener) {
|
|
25279
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
25026
25280
|
optimizeVariablesInOpList(op.handlerOps, job.compatibility);
|
|
25027
25281
|
}
|
|
25028
25282
|
}
|
|
@@ -25319,6 +25573,7 @@ var phases = [
|
|
|
25319
25573
|
{ kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
|
|
25320
25574
|
{ kind: CompilationJobKind.Both, fn: resolveNames },
|
|
25321
25575
|
{ kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
|
|
25576
|
+
{ kind: CompilationJobKind.Tmpl, fn: transformTwoWayBindingSet },
|
|
25322
25577
|
{ kind: CompilationJobKind.Tmpl, fn: optimizeTrackFns },
|
|
25323
25578
|
{ kind: CompilationJobKind.Both, fn: resolveContexts },
|
|
25324
25579
|
{ kind: CompilationJobKind.Both, fn: resolveSanitizers },
|
|
@@ -25327,7 +25582,6 @@ var phases = [
|
|
|
25327
25582
|
{ kind: CompilationJobKind.Both, fn: expandSafeReads },
|
|
25328
25583
|
{ kind: CompilationJobKind.Both, fn: generateTemporaryVariables },
|
|
25329
25584
|
{ kind: CompilationJobKind.Tmpl, fn: allocateSlots },
|
|
25330
|
-
{ kind: CompilationJobKind.Tmpl, fn: createDeferDepsFns },
|
|
25331
25585
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
25332
25586
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
25333
25587
|
{ kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
|
|
@@ -25340,6 +25594,7 @@ var phases = [
|
|
|
25340
25594
|
{ kind: CompilationJobKind.Tmpl, fn: generateAdvance },
|
|
25341
25595
|
{ kind: CompilationJobKind.Both, fn: optimizeVariables },
|
|
25342
25596
|
{ kind: CompilationJobKind.Both, fn: nameFunctionsAndVariables },
|
|
25597
|
+
{ kind: CompilationJobKind.Tmpl, fn: createDeferDepsFns },
|
|
25343
25598
|
{ kind: CompilationJobKind.Tmpl, fn: mergeNextContextExpressions },
|
|
25344
25599
|
{ kind: CompilationJobKind.Tmpl, fn: generateNgContainerOps },
|
|
25345
25600
|
{ kind: CompilationJobKind.Tmpl, fn: collapseEmptyInstructions },
|
|
@@ -25452,8 +25707,8 @@ function emitHostBindingFunction(job) {
|
|
|
25452
25707
|
var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
|
|
25453
25708
|
var domSchema = new DomElementSchemaRegistry();
|
|
25454
25709
|
var NG_TEMPLATE_TAG_NAME$1 = "ng-template";
|
|
25455
|
-
function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
|
|
25456
|
-
const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
|
|
25710
|
+
function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta, allDeferrableDepsFn) {
|
|
25711
|
+
const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta, allDeferrableDepsFn);
|
|
25457
25712
|
ingestNodes(job.root, template2);
|
|
25458
25713
|
return job;
|
|
25459
25714
|
}
|
|
@@ -25508,7 +25763,7 @@ function ingestHostAttribute(job, name, value, securityContexts) {
|
|
|
25508
25763
|
job.root.update.push(attrBinding);
|
|
25509
25764
|
}
|
|
25510
25765
|
function ingestHostEvent(job, event) {
|
|
25511
|
-
const [phase, target] = event.type
|
|
25766
|
+
const [phase, target] = event.type !== 1 ? [null, event.targetOrPhase] : [event.targetOrPhase, null];
|
|
25512
25767
|
const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
|
|
25513
25768
|
job.root.create.push(eventBinding);
|
|
25514
25769
|
}
|
|
@@ -25717,7 +25972,7 @@ function ingestDeferBlock(unit, deferBlock) {
|
|
|
25717
25972
|
const placeholder = ingestDeferView(unit, "Placeholder", (_d2 = deferBlock.placeholder) == null ? void 0 : _d2.i18n, (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.children, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.sourceSpan);
|
|
25718
25973
|
const error2 = ingestDeferView(unit, "Error", (_g = deferBlock.error) == null ? void 0 : _g.i18n, (_h = deferBlock.error) == null ? void 0 : _h.children, (_i = deferBlock.error) == null ? void 0 : _i.sourceSpan);
|
|
25719
25974
|
const deferXref = unit.job.allocateXrefId();
|
|
25720
|
-
const deferOp = createDeferOp(deferXref, main.xref, main.handle, blockMeta, deferBlock.sourceSpan);
|
|
25975
|
+
const deferOp = createDeferOp(deferXref, main.xref, main.handle, blockMeta, unit.job.allDeferrableDepsFn, deferBlock.sourceSpan);
|
|
25721
25976
|
deferOp.placeholderView = (_j = placeholder == null ? void 0 : placeholder.xref) != null ? _j : null;
|
|
25722
25977
|
deferOp.placeholderSlot = (_k = placeholder == null ? void 0 : placeholder.handle) != null ? _k : null;
|
|
25723
25978
|
deferOp.loadingSlot = (_l = loading == null ? void 0 : loading.handle) != null ? _l : null;
|
|
@@ -25975,6 +26230,7 @@ function convertAstWithInterpolation(job, value, i18nMeta, sourceSpan) {
|
|
|
25975
26230
|
}
|
|
25976
26231
|
var BINDING_KINDS = /* @__PURE__ */ new Map([
|
|
25977
26232
|
[0, BindingKind.Property],
|
|
26233
|
+
[5, BindingKind.TwoWayProperty],
|
|
25978
26234
|
[1, BindingKind.Attribute],
|
|
25979
26235
|
[2, BindingKind.ClassName],
|
|
25980
26236
|
[3, BindingKind.StyleProperty],
|
|
@@ -25996,11 +26252,18 @@ function asMessage(i18nMeta) {
|
|
|
25996
26252
|
function ingestElementBindings(unit, op, element2) {
|
|
25997
26253
|
var _a2;
|
|
25998
26254
|
let bindings = new Array();
|
|
26255
|
+
let i18nAttributeBindingNames = /* @__PURE__ */ new Set();
|
|
25999
26256
|
for (const attr of element2.attributes) {
|
|
26000
26257
|
const securityContext = domSchema.securityContext(element2.name, attr.name, true);
|
|
26001
26258
|
bindings.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, convertAstWithInterpolation(unit.job, attr.value, attr.i18n), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
26259
|
+
if (attr.i18n) {
|
|
26260
|
+
i18nAttributeBindingNames.add(attr.name);
|
|
26261
|
+
}
|
|
26002
26262
|
}
|
|
26003
26263
|
for (const input of element2.inputs) {
|
|
26264
|
+
if (i18nAttributeBindingNames.has(input.name)) {
|
|
26265
|
+
console.error(`On component ${unit.job.componentName}, the binding ${input.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`);
|
|
26266
|
+
}
|
|
26004
26267
|
bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, (_a2 = asMessage(input.i18n)) != null ? _a2 : null, input.sourceSpan));
|
|
26005
26268
|
}
|
|
26006
26269
|
unit.create.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.ExtractedAttribute));
|
|
@@ -26009,7 +26272,11 @@ function ingestElementBindings(unit, op, element2) {
|
|
|
26009
26272
|
if (output.type === 1 && output.phase === null) {
|
|
26010
26273
|
throw Error("Animation listener should have a phase");
|
|
26011
26274
|
}
|
|
26012
|
-
|
|
26275
|
+
if (output.type === 2) {
|
|
26276
|
+
unit.create.push(createTwoWayListenerOp(op.xref, op.handle, output.name, op.tag, makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan), output.sourceSpan));
|
|
26277
|
+
} else {
|
|
26278
|
+
unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
|
|
26279
|
+
}
|
|
26013
26280
|
}
|
|
26014
26281
|
if (bindings.some((b) => b == null ? void 0 : b.i18nMessage) !== null) {
|
|
26015
26282
|
unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
|
|
@@ -26039,7 +26306,11 @@ function ingestTemplateBindings(unit, op, template2, templateKind) {
|
|
|
26039
26306
|
throw Error("Animation listener should have a phase");
|
|
26040
26307
|
}
|
|
26041
26308
|
if (templateKind === TemplateKind.NgTemplate) {
|
|
26042
|
-
|
|
26309
|
+
if (output.type === 2) {
|
|
26310
|
+
unit.create.push(createTwoWayListenerOp(op.xref, op.handle, output.name, op.tag, makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan), output.sourceSpan));
|
|
26311
|
+
} else {
|
|
26312
|
+
unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
|
|
26313
|
+
}
|
|
26043
26314
|
}
|
|
26044
26315
|
if (templateKind === TemplateKind.Structural && output.type !== 1) {
|
|
26045
26316
|
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME$1, output.name, false);
|
|
@@ -26053,8 +26324,15 @@ function ingestTemplateBindings(unit, op, template2, templateKind) {
|
|
|
26053
26324
|
function createTemplateBinding(view, xref, type, name, value, unit, securityContext, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
|
|
26054
26325
|
const isTextBinding = typeof value === "string";
|
|
26055
26326
|
if (templateKind === TemplateKind.Structural) {
|
|
26056
|
-
if (!isStructuralTemplateAttribute
|
|
26057
|
-
|
|
26327
|
+
if (!isStructuralTemplateAttribute) {
|
|
26328
|
+
switch (type) {
|
|
26329
|
+
case 0:
|
|
26330
|
+
case 2:
|
|
26331
|
+
case 3:
|
|
26332
|
+
return createExtractedAttributeOp(xref, BindingKind.Property, null, name, null, null, i18nMessage, securityContext);
|
|
26333
|
+
case 5:
|
|
26334
|
+
return createExtractedAttributeOp(xref, BindingKind.TwoWayProperty, null, name, null, null, i18nMessage, securityContext);
|
|
26335
|
+
}
|
|
26058
26336
|
}
|
|
26059
26337
|
if (!isTextBinding && (type === 1 || type === 4)) {
|
|
26060
26338
|
return null;
|
|
@@ -26081,6 +26359,23 @@ function makeListenerHandlerOps(unit, handler, handlerSpan) {
|
|
|
26081
26359
|
handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
|
|
26082
26360
|
return handlerOps;
|
|
26083
26361
|
}
|
|
26362
|
+
function makeTwoWayListenerHandlerOps(unit, handler, handlerSpan) {
|
|
26363
|
+
handler = astOf(handler);
|
|
26364
|
+
const handlerOps = new Array();
|
|
26365
|
+
if (handler instanceof Chain) {
|
|
26366
|
+
if (handler.expressions.length === 1) {
|
|
26367
|
+
handler = handler.expressions[0];
|
|
26368
|
+
} else {
|
|
26369
|
+
throw new Error("Expected two-way listener to have a single expression.");
|
|
26370
|
+
}
|
|
26371
|
+
}
|
|
26372
|
+
const handlerExpr = convertAst(handler, unit.job, handlerSpan);
|
|
26373
|
+
const eventReference = new LexicalReadExpr("$event");
|
|
26374
|
+
const twoWaySetExpr = new TwoWayBindingSetExpr(handlerExpr, eventReference);
|
|
26375
|
+
handlerOps.push(createStatementOp(new ExpressionStatement(twoWaySetExpr)));
|
|
26376
|
+
handlerOps.push(createStatementOp(new ReturnStatement(eventReference)));
|
|
26377
|
+
return handlerOps;
|
|
26378
|
+
}
|
|
26084
26379
|
function astOf(ast) {
|
|
26085
26380
|
return ast instanceof ASTWithSource ? ast.ast : ast;
|
|
26086
26381
|
}
|
|
@@ -26131,340 +26426,9 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
26131
26426
|
return null;
|
|
26132
26427
|
}
|
|
26133
26428
|
var USE_TEMPLATE_PIPELINE = false;
|
|
26134
|
-
var
|
|
26135
|
-
|
|
26136
|
-
|
|
26137
|
-
constructor(_directiveExpr) {
|
|
26138
|
-
this._directiveExpr = _directiveExpr;
|
|
26139
|
-
this._hasInitialValues = false;
|
|
26140
|
-
this.hasBindings = false;
|
|
26141
|
-
this.hasBindingsWithPipes = false;
|
|
26142
|
-
this._classMapInput = null;
|
|
26143
|
-
this._styleMapInput = null;
|
|
26144
|
-
this._singleStyleInputs = null;
|
|
26145
|
-
this._singleClassInputs = null;
|
|
26146
|
-
this._lastStylingInput = null;
|
|
26147
|
-
this._firstStylingInput = null;
|
|
26148
|
-
this._stylesIndex = /* @__PURE__ */ new Map();
|
|
26149
|
-
this._classesIndex = /* @__PURE__ */ new Map();
|
|
26150
|
-
this._initialStyleValues = [];
|
|
26151
|
-
this._initialClassValues = [];
|
|
26152
|
-
}
|
|
26153
|
-
registerBoundInput(input) {
|
|
26154
|
-
let binding = null;
|
|
26155
|
-
let name = input.name;
|
|
26156
|
-
switch (input.type) {
|
|
26157
|
-
case 0:
|
|
26158
|
-
binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
|
|
26159
|
-
break;
|
|
26160
|
-
case 3:
|
|
26161
|
-
binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
|
|
26162
|
-
break;
|
|
26163
|
-
case 2:
|
|
26164
|
-
binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
|
|
26165
|
-
break;
|
|
26166
|
-
}
|
|
26167
|
-
return binding ? true : false;
|
|
26168
|
-
}
|
|
26169
|
-
registerInputBasedOnName(name, expression, sourceSpan) {
|
|
26170
|
-
let binding = null;
|
|
26171
|
-
const prefix = name.substring(0, 6);
|
|
26172
|
-
const isStyle = name === "style" || prefix === "style." || prefix === "style!";
|
|
26173
|
-
const isClass = !isStyle && (name === "class" || prefix === "class." || prefix === "class!");
|
|
26174
|
-
if (isStyle || isClass) {
|
|
26175
|
-
const isMapBased = name.charAt(5) !== ".";
|
|
26176
|
-
const property2 = name.slice(isMapBased ? 5 : 6);
|
|
26177
|
-
if (isStyle) {
|
|
26178
|
-
binding = this.registerStyleInput(property2, isMapBased, expression, sourceSpan);
|
|
26179
|
-
} else {
|
|
26180
|
-
binding = this.registerClassInput(property2, isMapBased, expression, sourceSpan);
|
|
26181
|
-
}
|
|
26182
|
-
}
|
|
26183
|
-
return binding;
|
|
26184
|
-
}
|
|
26185
|
-
registerStyleInput(name, isMapBased, value, sourceSpan, suffix) {
|
|
26186
|
-
if (isEmptyExpression(value)) {
|
|
26187
|
-
return null;
|
|
26188
|
-
}
|
|
26189
|
-
if (!isCssCustomProperty(name)) {
|
|
26190
|
-
name = hyphenate(name);
|
|
26191
|
-
}
|
|
26192
|
-
const { property: property2, hasOverrideFlag, suffix: bindingSuffix } = parseProperty(name);
|
|
26193
|
-
suffix = typeof suffix === "string" && suffix.length !== 0 ? suffix : bindingSuffix;
|
|
26194
|
-
const entry = { name: property2, suffix, value, sourceSpan, hasOverrideFlag };
|
|
26195
|
-
if (isMapBased) {
|
|
26196
|
-
this._styleMapInput = entry;
|
|
26197
|
-
} else {
|
|
26198
|
-
(this._singleStyleInputs = this._singleStyleInputs || []).push(entry);
|
|
26199
|
-
registerIntoMap(this._stylesIndex, property2);
|
|
26200
|
-
}
|
|
26201
|
-
this._lastStylingInput = entry;
|
|
26202
|
-
this._firstStylingInput = this._firstStylingInput || entry;
|
|
26203
|
-
this._checkForPipes(value);
|
|
26204
|
-
this.hasBindings = true;
|
|
26205
|
-
return entry;
|
|
26206
|
-
}
|
|
26207
|
-
registerClassInput(name, isMapBased, value, sourceSpan) {
|
|
26208
|
-
if (isEmptyExpression(value)) {
|
|
26209
|
-
return null;
|
|
26210
|
-
}
|
|
26211
|
-
const { property: property2, hasOverrideFlag } = parseProperty(name);
|
|
26212
|
-
const entry = { name: property2, value, sourceSpan, hasOverrideFlag, suffix: null };
|
|
26213
|
-
if (isMapBased) {
|
|
26214
|
-
this._classMapInput = entry;
|
|
26215
|
-
} else {
|
|
26216
|
-
(this._singleClassInputs = this._singleClassInputs || []).push(entry);
|
|
26217
|
-
registerIntoMap(this._classesIndex, property2);
|
|
26218
|
-
}
|
|
26219
|
-
this._lastStylingInput = entry;
|
|
26220
|
-
this._firstStylingInput = this._firstStylingInput || entry;
|
|
26221
|
-
this._checkForPipes(value);
|
|
26222
|
-
this.hasBindings = true;
|
|
26223
|
-
return entry;
|
|
26224
|
-
}
|
|
26225
|
-
_checkForPipes(value) {
|
|
26226
|
-
if (value instanceof ASTWithSource && value.ast instanceof BindingPipe) {
|
|
26227
|
-
this.hasBindingsWithPipes = true;
|
|
26228
|
-
}
|
|
26229
|
-
}
|
|
26230
|
-
registerStyleAttr(value) {
|
|
26231
|
-
this._initialStyleValues = parse(value);
|
|
26232
|
-
this._hasInitialValues = true;
|
|
26233
|
-
}
|
|
26234
|
-
registerClassAttr(value) {
|
|
26235
|
-
this._initialClassValues = value.trim().split(/\s+/g);
|
|
26236
|
-
this._hasInitialValues = true;
|
|
26237
|
-
}
|
|
26238
|
-
populateInitialStylingAttrs(attrs) {
|
|
26239
|
-
if (this._initialClassValues.length) {
|
|
26240
|
-
attrs.push(literal(1));
|
|
26241
|
-
for (let i = 0; i < this._initialClassValues.length; i++) {
|
|
26242
|
-
attrs.push(literal(this._initialClassValues[i]));
|
|
26243
|
-
}
|
|
26244
|
-
}
|
|
26245
|
-
if (this._initialStyleValues.length) {
|
|
26246
|
-
attrs.push(literal(2));
|
|
26247
|
-
for (let i = 0; i < this._initialStyleValues.length; i += 2) {
|
|
26248
|
-
attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
|
|
26249
|
-
}
|
|
26250
|
-
}
|
|
26251
|
-
}
|
|
26252
|
-
assignHostAttrs(attrs, definitionMap) {
|
|
26253
|
-
if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
|
|
26254
|
-
this.populateInitialStylingAttrs(attrs);
|
|
26255
|
-
definitionMap.set("hostAttrs", literalArr(attrs));
|
|
26256
|
-
}
|
|
26257
|
-
}
|
|
26258
|
-
buildClassMapInstruction(valueConverter) {
|
|
26259
|
-
if (this._classMapInput) {
|
|
26260
|
-
return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
|
|
26261
|
-
}
|
|
26262
|
-
return null;
|
|
26263
|
-
}
|
|
26264
|
-
buildStyleMapInstruction(valueConverter) {
|
|
26265
|
-
if (this._styleMapInput) {
|
|
26266
|
-
return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);
|
|
26267
|
-
}
|
|
26268
|
-
return null;
|
|
26269
|
-
}
|
|
26270
|
-
_buildMapBasedInstruction(valueConverter, isClassBased, stylingInput) {
|
|
26271
|
-
let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
|
|
26272
|
-
const mapValue = stylingInput.value.visit(valueConverter);
|
|
26273
|
-
let reference2;
|
|
26274
|
-
if (mapValue instanceof Interpolation$1) {
|
|
26275
|
-
totalBindingSlotsRequired += mapValue.expressions.length;
|
|
26276
|
-
reference2 = isClassBased ? getClassMapInterpolationExpression(mapValue) : getStyleMapInterpolationExpression(mapValue);
|
|
26277
|
-
} else {
|
|
26278
|
-
reference2 = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
|
|
26279
|
-
}
|
|
26280
|
-
return {
|
|
26281
|
-
reference: reference2,
|
|
26282
|
-
calls: [{
|
|
26283
|
-
supportsInterpolation: true,
|
|
26284
|
-
sourceSpan: stylingInput.sourceSpan,
|
|
26285
|
-
allocateBindingSlots: totalBindingSlotsRequired,
|
|
26286
|
-
params: (convertFn) => {
|
|
26287
|
-
const convertResult = convertFn(mapValue);
|
|
26288
|
-
const params = Array.isArray(convertResult) ? convertResult : [convertResult];
|
|
26289
|
-
return params;
|
|
26290
|
-
}
|
|
26291
|
-
}]
|
|
26292
|
-
};
|
|
26293
|
-
}
|
|
26294
|
-
_buildSingleInputs(reference2, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {
|
|
26295
|
-
const instructions = [];
|
|
26296
|
-
inputs.forEach((input) => {
|
|
26297
|
-
const previousInstruction = instructions[instructions.length - 1];
|
|
26298
|
-
const value = input.value.visit(valueConverter);
|
|
26299
|
-
let referenceForCall = reference2;
|
|
26300
|
-
let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
|
|
26301
|
-
if (value instanceof Interpolation$1) {
|
|
26302
|
-
totalBindingSlotsRequired += value.expressions.length;
|
|
26303
|
-
if (getInterpolationExpressionFn) {
|
|
26304
|
-
referenceForCall = getInterpolationExpressionFn(value);
|
|
26305
|
-
}
|
|
26306
|
-
}
|
|
26307
|
-
const call2 = {
|
|
26308
|
-
sourceSpan: input.sourceSpan,
|
|
26309
|
-
allocateBindingSlots: totalBindingSlotsRequired,
|
|
26310
|
-
supportsInterpolation: !!getInterpolationExpressionFn,
|
|
26311
|
-
params: (convertFn) => {
|
|
26312
|
-
const params = [];
|
|
26313
|
-
params.push(literal(input.name));
|
|
26314
|
-
const convertResult = convertFn(value);
|
|
26315
|
-
if (Array.isArray(convertResult)) {
|
|
26316
|
-
params.push(...convertResult);
|
|
26317
|
-
} else {
|
|
26318
|
-
params.push(convertResult);
|
|
26319
|
-
}
|
|
26320
|
-
if (!isClassBased && input.suffix !== null) {
|
|
26321
|
-
params.push(literal(input.suffix));
|
|
26322
|
-
}
|
|
26323
|
-
return params;
|
|
26324
|
-
}
|
|
26325
|
-
};
|
|
26326
|
-
if (previousInstruction && previousInstruction.reference === referenceForCall) {
|
|
26327
|
-
previousInstruction.calls.push(call2);
|
|
26328
|
-
} else {
|
|
26329
|
-
instructions.push({ reference: referenceForCall, calls: [call2] });
|
|
26330
|
-
}
|
|
26331
|
-
});
|
|
26332
|
-
return instructions;
|
|
26333
|
-
}
|
|
26334
|
-
_buildClassInputs(valueConverter) {
|
|
26335
|
-
if (this._singleClassInputs) {
|
|
26336
|
-
return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
|
|
26337
|
-
}
|
|
26338
|
-
return [];
|
|
26339
|
-
}
|
|
26340
|
-
_buildStyleInputs(valueConverter) {
|
|
26341
|
-
if (this._singleStyleInputs) {
|
|
26342
|
-
return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
|
|
26343
|
-
}
|
|
26344
|
-
return [];
|
|
26345
|
-
}
|
|
26346
|
-
buildUpdateLevelInstructions(valueConverter) {
|
|
26347
|
-
const instructions = [];
|
|
26348
|
-
if (this.hasBindings) {
|
|
26349
|
-
const styleMapInstruction = this.buildStyleMapInstruction(valueConverter);
|
|
26350
|
-
if (styleMapInstruction) {
|
|
26351
|
-
instructions.push(styleMapInstruction);
|
|
26352
|
-
}
|
|
26353
|
-
const classMapInstruction = this.buildClassMapInstruction(valueConverter);
|
|
26354
|
-
if (classMapInstruction) {
|
|
26355
|
-
instructions.push(classMapInstruction);
|
|
26356
|
-
}
|
|
26357
|
-
instructions.push(...this._buildStyleInputs(valueConverter));
|
|
26358
|
-
instructions.push(...this._buildClassInputs(valueConverter));
|
|
26359
|
-
}
|
|
26360
|
-
return instructions;
|
|
26361
|
-
}
|
|
26362
|
-
};
|
|
26363
|
-
function registerIntoMap(map, key) {
|
|
26364
|
-
if (!map.has(key)) {
|
|
26365
|
-
map.set(key, map.size);
|
|
26366
|
-
}
|
|
26367
|
-
}
|
|
26368
|
-
function parseProperty(name) {
|
|
26369
|
-
let hasOverrideFlag = false;
|
|
26370
|
-
const overrideIndex = name.indexOf(IMPORTANT_FLAG);
|
|
26371
|
-
if (overrideIndex !== -1) {
|
|
26372
|
-
name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
|
|
26373
|
-
hasOverrideFlag = true;
|
|
26374
|
-
}
|
|
26375
|
-
let suffix = null;
|
|
26376
|
-
let property2 = name;
|
|
26377
|
-
const unitIndex = name.lastIndexOf(".");
|
|
26378
|
-
if (unitIndex > 0) {
|
|
26379
|
-
suffix = name.slice(unitIndex + 1);
|
|
26380
|
-
property2 = name.substring(0, unitIndex);
|
|
26381
|
-
}
|
|
26382
|
-
return { property: property2, suffix, hasOverrideFlag };
|
|
26383
|
-
}
|
|
26384
|
-
function getClassMapInterpolationExpression(interpolation) {
|
|
26385
|
-
switch (getInterpolationArgsLength(interpolation)) {
|
|
26386
|
-
case 1:
|
|
26387
|
-
return Identifiers.classMap;
|
|
26388
|
-
case 3:
|
|
26389
|
-
return Identifiers.classMapInterpolate1;
|
|
26390
|
-
case 5:
|
|
26391
|
-
return Identifiers.classMapInterpolate2;
|
|
26392
|
-
case 7:
|
|
26393
|
-
return Identifiers.classMapInterpolate3;
|
|
26394
|
-
case 9:
|
|
26395
|
-
return Identifiers.classMapInterpolate4;
|
|
26396
|
-
case 11:
|
|
26397
|
-
return Identifiers.classMapInterpolate5;
|
|
26398
|
-
case 13:
|
|
26399
|
-
return Identifiers.classMapInterpolate6;
|
|
26400
|
-
case 15:
|
|
26401
|
-
return Identifiers.classMapInterpolate7;
|
|
26402
|
-
case 17:
|
|
26403
|
-
return Identifiers.classMapInterpolate8;
|
|
26404
|
-
default:
|
|
26405
|
-
return Identifiers.classMapInterpolateV;
|
|
26406
|
-
}
|
|
26407
|
-
}
|
|
26408
|
-
function getStyleMapInterpolationExpression(interpolation) {
|
|
26409
|
-
switch (getInterpolationArgsLength(interpolation)) {
|
|
26410
|
-
case 1:
|
|
26411
|
-
return Identifiers.styleMap;
|
|
26412
|
-
case 3:
|
|
26413
|
-
return Identifiers.styleMapInterpolate1;
|
|
26414
|
-
case 5:
|
|
26415
|
-
return Identifiers.styleMapInterpolate2;
|
|
26416
|
-
case 7:
|
|
26417
|
-
return Identifiers.styleMapInterpolate3;
|
|
26418
|
-
case 9:
|
|
26419
|
-
return Identifiers.styleMapInterpolate4;
|
|
26420
|
-
case 11:
|
|
26421
|
-
return Identifiers.styleMapInterpolate5;
|
|
26422
|
-
case 13:
|
|
26423
|
-
return Identifiers.styleMapInterpolate6;
|
|
26424
|
-
case 15:
|
|
26425
|
-
return Identifiers.styleMapInterpolate7;
|
|
26426
|
-
case 17:
|
|
26427
|
-
return Identifiers.styleMapInterpolate8;
|
|
26428
|
-
default:
|
|
26429
|
-
return Identifiers.styleMapInterpolateV;
|
|
26430
|
-
}
|
|
26431
|
-
}
|
|
26432
|
-
function getStylePropInterpolationExpression(interpolation) {
|
|
26433
|
-
switch (getInterpolationArgsLength(interpolation)) {
|
|
26434
|
-
case 1:
|
|
26435
|
-
return Identifiers.styleProp;
|
|
26436
|
-
case 3:
|
|
26437
|
-
return Identifiers.stylePropInterpolate1;
|
|
26438
|
-
case 5:
|
|
26439
|
-
return Identifiers.stylePropInterpolate2;
|
|
26440
|
-
case 7:
|
|
26441
|
-
return Identifiers.stylePropInterpolate3;
|
|
26442
|
-
case 9:
|
|
26443
|
-
return Identifiers.stylePropInterpolate4;
|
|
26444
|
-
case 11:
|
|
26445
|
-
return Identifiers.stylePropInterpolate5;
|
|
26446
|
-
case 13:
|
|
26447
|
-
return Identifiers.stylePropInterpolate6;
|
|
26448
|
-
case 15:
|
|
26449
|
-
return Identifiers.stylePropInterpolate7;
|
|
26450
|
-
case 17:
|
|
26451
|
-
return Identifiers.stylePropInterpolate8;
|
|
26452
|
-
default:
|
|
26453
|
-
return Identifiers.stylePropInterpolateV;
|
|
26454
|
-
}
|
|
26455
|
-
}
|
|
26456
|
-
function isCssCustomProperty(name) {
|
|
26457
|
-
return name.startsWith("--");
|
|
26458
|
-
}
|
|
26459
|
-
function isEmptyExpression(ast) {
|
|
26460
|
-
if (ast instanceof ASTWithSource) {
|
|
26461
|
-
ast = ast.ast;
|
|
26462
|
-
}
|
|
26463
|
-
return ast instanceof EmptyExpr$1;
|
|
26464
|
-
}
|
|
26465
|
-
var HtmlParser = class extends Parser {
|
|
26466
|
-
constructor() {
|
|
26467
|
-
super(getHtmlTagDefinition);
|
|
26429
|
+
var HtmlParser = class extends Parser {
|
|
26430
|
+
constructor() {
|
|
26431
|
+
super(getHtmlTagDefinition);
|
|
26468
26432
|
}
|
|
26469
26433
|
parse(source, url, options) {
|
|
26470
26434
|
return super.parse(source, url, options);
|
|
@@ -26559,6 +26523,7 @@ var BindingParser = class {
|
|
|
26559
26523
|
propName,
|
|
26560
26524
|
expression,
|
|
26561
26525
|
true,
|
|
26526
|
+
false,
|
|
26562
26527
|
sourceSpan,
|
|
26563
26528
|
sourceSpan.start.offset,
|
|
26564
26529
|
void 0,
|
|
@@ -26624,7 +26589,7 @@ var BindingParser = class {
|
|
|
26624
26589
|
} else if (binding.value) {
|
|
26625
26590
|
const srcSpan = isIvyAst ? bindingSpan : sourceSpan;
|
|
26626
26591
|
const valueSpan = moveParseSourceSpan(sourceSpan, binding.value.ast.sourceSpan);
|
|
26627
|
-
this._parsePropertyAst(key, binding.value, srcSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26592
|
+
this._parsePropertyAst(key, binding.value, false, srcSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26628
26593
|
} else {
|
|
26629
26594
|
targetMatchableAttrs.push([key, ""]);
|
|
26630
26595
|
this.parseLiteralAttr(key, null, keySpan, absoluteValueOffset, void 0, targetMatchableAttrs, targetProps, keySpan);
|
|
@@ -26659,7 +26624,7 @@ var BindingParser = class {
|
|
|
26659
26624
|
targetProps.push(new ParsedProperty(name, this._exprParser.wrapLiteralPrimitive(value, "", absoluteOffset), ParsedPropertyType.LITERAL_ATTR, sourceSpan, keySpan, valueSpan));
|
|
26660
26625
|
}
|
|
26661
26626
|
}
|
|
26662
|
-
parsePropertyBinding(name, expression, isHost, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, targetProps, keySpan) {
|
|
26627
|
+
parsePropertyBinding(name, expression, isHost, isPartOfAssignmentBinding, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, targetProps, keySpan) {
|
|
26663
26628
|
if (name.length === 0) {
|
|
26664
26629
|
this._reportError(`Property name is missing in binding`, sourceSpan);
|
|
26665
26630
|
}
|
|
@@ -26680,20 +26645,20 @@ var BindingParser = class {
|
|
|
26680
26645
|
if (isAnimationProp) {
|
|
26681
26646
|
this._parseAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26682
26647
|
} else {
|
|
26683
|
-
this._parsePropertyAst(name, this.parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset), sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26648
|
+
this._parsePropertyAst(name, this.parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset), isPartOfAssignmentBinding, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26684
26649
|
}
|
|
26685
26650
|
}
|
|
26686
26651
|
parsePropertyInterpolation(name, value, sourceSpan, valueSpan, targetMatchableAttrs, targetProps, keySpan, interpolatedTokens) {
|
|
26687
26652
|
const expr = this.parseInterpolation(value, valueSpan || sourceSpan, interpolatedTokens);
|
|
26688
26653
|
if (expr) {
|
|
26689
|
-
this._parsePropertyAst(name, expr, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26654
|
+
this._parsePropertyAst(name, expr, false, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
26690
26655
|
return true;
|
|
26691
26656
|
}
|
|
26692
26657
|
return false;
|
|
26693
26658
|
}
|
|
26694
|
-
_parsePropertyAst(name, ast, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps) {
|
|
26659
|
+
_parsePropertyAst(name, ast, isPartOfAssignmentBinding, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps) {
|
|
26695
26660
|
targetMatchableAttrs.push([name, ast.source]);
|
|
26696
|
-
targetProps.push(new ParsedProperty(name, ast, ParsedPropertyType.DEFAULT, sourceSpan, keySpan, valueSpan));
|
|
26661
|
+
targetProps.push(new ParsedProperty(name, ast, isPartOfAssignmentBinding ? ParsedPropertyType.TWO_WAY : ParsedPropertyType.DEFAULT, sourceSpan, keySpan, valueSpan));
|
|
26697
26662
|
}
|
|
26698
26663
|
_parseAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps) {
|
|
26699
26664
|
if (name.length === 0) {
|
|
@@ -26753,7 +26718,7 @@ var BindingParser = class {
|
|
|
26753
26718
|
const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);
|
|
26754
26719
|
boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;
|
|
26755
26720
|
securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false);
|
|
26756
|
-
bindingType = 0;
|
|
26721
|
+
bindingType = boundProp.type === ParsedPropertyType.TWO_WAY ? 5 : 0;
|
|
26757
26722
|
if (!skipValidation) {
|
|
26758
26723
|
this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);
|
|
26759
26724
|
}
|
|
@@ -26769,7 +26734,7 @@ var BindingParser = class {
|
|
|
26769
26734
|
if (keySpan !== void 0) {
|
|
26770
26735
|
keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
|
|
26771
26736
|
}
|
|
26772
|
-
this._parseAnimationEvent(name, expression,
|
|
26737
|
+
this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);
|
|
26773
26738
|
} else {
|
|
26774
26739
|
this._parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);
|
|
26775
26740
|
}
|
|
@@ -26778,11 +26743,11 @@ var BindingParser = class {
|
|
|
26778
26743
|
const prop = this._schemaRegistry.getMappedPropName(propName);
|
|
26779
26744
|
return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);
|
|
26780
26745
|
}
|
|
26781
|
-
_parseAnimationEvent(name, expression,
|
|
26746
|
+
_parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) {
|
|
26782
26747
|
const matches = splitAtPeriod(name, [name, ""]);
|
|
26783
26748
|
const eventName = matches[0];
|
|
26784
26749
|
const phase = matches[1].toLowerCase();
|
|
26785
|
-
const ast = this._parseAction(expression,
|
|
26750
|
+
const ast = this._parseAction(expression, handlerSpan);
|
|
26786
26751
|
targetEvents.push(new ParsedEvent(eventName, phase, 1, ast, sourceSpan, handlerSpan, keySpan));
|
|
26787
26752
|
if (eventName.length === 0) {
|
|
26788
26753
|
this._reportError(`Animation event name is missing in binding`, sourceSpan);
|
|
@@ -26797,15 +26762,20 @@ var BindingParser = class {
|
|
|
26797
26762
|
}
|
|
26798
26763
|
_parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
26799
26764
|
const [target, eventName] = splitAtColon(name, [null, name]);
|
|
26800
|
-
const
|
|
26765
|
+
const prevErrorCount = this.errors.length;
|
|
26766
|
+
const ast = this._parseAction(expression, handlerSpan);
|
|
26767
|
+
const isValid = this.errors.length === prevErrorCount;
|
|
26801
26768
|
targetMatchableAttrs.push([name, ast.source]);
|
|
26802
|
-
|
|
26769
|
+
if (isAssignmentEvent && isValid && !this._isAllowedAssignmentEvent(ast)) {
|
|
26770
|
+
this._reportError("Unsupported expression in a two-way binding", sourceSpan);
|
|
26771
|
+
}
|
|
26772
|
+
targetEvents.push(new ParsedEvent(eventName, target, isAssignmentEvent ? 2 : 0, ast, sourceSpan, handlerSpan, keySpan));
|
|
26803
26773
|
}
|
|
26804
|
-
_parseAction(value,
|
|
26774
|
+
_parseAction(value, sourceSpan) {
|
|
26805
26775
|
const sourceInfo = (sourceSpan && sourceSpan.start || "(unknown").toString();
|
|
26806
26776
|
const absoluteOffset = sourceSpan && sourceSpan.start ? sourceSpan.start.offset : 0;
|
|
26807
26777
|
try {
|
|
26808
|
-
const ast = this._exprParser.parseAction(value,
|
|
26778
|
+
const ast = this._exprParser.parseAction(value, sourceInfo, absoluteOffset, this._interpolationConfig);
|
|
26809
26779
|
if (ast) {
|
|
26810
26780
|
this._reportExpressionParserErrors(ast.errors, sourceSpan);
|
|
26811
26781
|
}
|
|
@@ -26833,6 +26803,21 @@ var BindingParser = class {
|
|
|
26833
26803
|
this._reportError(report.msg, sourceSpan, ParseErrorLevel.ERROR);
|
|
26834
26804
|
}
|
|
26835
26805
|
}
|
|
26806
|
+
_isAllowedAssignmentEvent(ast) {
|
|
26807
|
+
if (ast instanceof ASTWithSource) {
|
|
26808
|
+
return this._isAllowedAssignmentEvent(ast.ast);
|
|
26809
|
+
}
|
|
26810
|
+
if (ast instanceof NonNullAssert) {
|
|
26811
|
+
return this._isAllowedAssignmentEvent(ast.expression);
|
|
26812
|
+
}
|
|
26813
|
+
if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
|
|
26814
|
+
return true;
|
|
26815
|
+
}
|
|
26816
|
+
if (ast instanceof Binary) {
|
|
26817
|
+
return (ast.operation === "&&" || ast.operation === "||" || ast.operation === "??") && (ast.right instanceof PropertyRead || ast.right instanceof KeyedRead);
|
|
26818
|
+
}
|
|
26819
|
+
return ast instanceof Conditional || ast instanceof PrefixNot;
|
|
26820
|
+
}
|
|
26836
26821
|
};
|
|
26837
26822
|
function isAnimationLabel(name) {
|
|
26838
26823
|
return name[0] == "@";
|
|
@@ -26929,9 +26914,10 @@ function normalizeNgContentSelect(selectAttr) {
|
|
|
26929
26914
|
}
|
|
26930
26915
|
var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
|
|
26931
26916
|
var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
|
|
26932
|
-
var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
|
|
26917
|
+
var CONDITIONAL_ALIAS_PATTERN = /^(as\s)+(.*)/;
|
|
26933
26918
|
var ELSE_IF_PATTERN = /^else[^\S\r\n]+if/;
|
|
26934
26919
|
var FOR_LOOP_LET_PATTERN = /^let\s+([\S\s]*)/;
|
|
26920
|
+
var CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN = /(\s*)(\S+)(\s*)/;
|
|
26935
26921
|
var ALLOWED_FOR_LOOP_LET_VARIABLES = /* @__PURE__ */ new Set(["$index", "$first", "$last", "$even", "$odd", "$count"]);
|
|
26936
26922
|
function isConnectedForLoopBlock(name) {
|
|
26937
26923
|
return name === "empty";
|
|
@@ -27043,8 +27029,10 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
27043
27029
|
return null;
|
|
27044
27030
|
}
|
|
27045
27031
|
const [, itemName, rawExpression] = match;
|
|
27032
|
+
const variableName = expressionParam.expression.split(" ")[0];
|
|
27033
|
+
const variableSpan = new ParseSourceSpan(expressionParam.sourceSpan.start, expressionParam.sourceSpan.start.moveBy(variableName.length));
|
|
27046
27034
|
const result = {
|
|
27047
|
-
itemName: new Variable(itemName, "$implicit",
|
|
27035
|
+
itemName: new Variable(itemName, "$implicit", variableSpan, variableSpan),
|
|
27048
27036
|
trackBy: null,
|
|
27049
27037
|
expression: parseBlockParameterToBinding(expressionParam, bindingParser, rawExpression),
|
|
27050
27038
|
context: {}
|
|
@@ -27052,7 +27040,8 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
27052
27040
|
for (const param of secondaryParams) {
|
|
27053
27041
|
const letMatch = param.expression.match(FOR_LOOP_LET_PATTERN);
|
|
27054
27042
|
if (letMatch !== null) {
|
|
27055
|
-
|
|
27043
|
+
const variablesSpan = new ParseSourceSpan(param.sourceSpan.start.moveBy(letMatch[0].length - letMatch[1].length), param.sourceSpan.end);
|
|
27044
|
+
parseLetParameter(param.sourceSpan, letMatch[1], variablesSpan, result.context, errors);
|
|
27056
27045
|
continue;
|
|
27057
27046
|
}
|
|
27058
27047
|
const trackMatch = param.expression.match(FOR_LOOP_TRACK_PATTERN);
|
|
@@ -27068,16 +27057,18 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
27068
27057
|
}
|
|
27069
27058
|
errors.push(new ParseError(param.sourceSpan, `Unrecognized @for loop paramater "${param.expression}"`));
|
|
27070
27059
|
}
|
|
27071
|
-
for (const
|
|
27072
|
-
if (!result.context.hasOwnProperty(
|
|
27060
|
+
for (const variableName2 of ALLOWED_FOR_LOOP_LET_VARIABLES) {
|
|
27061
|
+
if (!result.context.hasOwnProperty(variableName2)) {
|
|
27073
27062
|
const emptySpanAfterForBlockStart = new ParseSourceSpan(block.startSourceSpan.end, block.startSourceSpan.end);
|
|
27074
|
-
result.context[
|
|
27063
|
+
result.context[variableName2] = new Variable(variableName2, variableName2, emptySpanAfterForBlockStart, emptySpanAfterForBlockStart);
|
|
27075
27064
|
}
|
|
27076
27065
|
}
|
|
27077
27066
|
return result;
|
|
27078
27067
|
}
|
|
27079
27068
|
function parseLetParameter(sourceSpan, expression, span, context, errors) {
|
|
27069
|
+
var _a2, _b2, _c2;
|
|
27080
27070
|
const parts = expression.split(",");
|
|
27071
|
+
let startSpan = span.start;
|
|
27081
27072
|
for (const part of parts) {
|
|
27082
27073
|
const expressionParts = part.split("=");
|
|
27083
27074
|
const name = expressionParts.length === 2 ? expressionParts[0].trim() : "";
|
|
@@ -27089,8 +27080,20 @@ function parseLetParameter(sourceSpan, expression, span, context, errors) {
|
|
|
27089
27080
|
} else if (context.hasOwnProperty(variableName)) {
|
|
27090
27081
|
errors.push(new ParseError(sourceSpan, `Duplicate "let" parameter variable "${variableName}"`));
|
|
27091
27082
|
} else {
|
|
27092
|
-
|
|
27083
|
+
const [, keyLeadingWhitespace, keyName] = (_a2 = expressionParts[0].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN)) != null ? _a2 : [];
|
|
27084
|
+
const keySpan = keyLeadingWhitespace !== void 0 && expressionParts.length === 2 ? new ParseSourceSpan(
|
|
27085
|
+
startSpan.moveBy(keyLeadingWhitespace.length),
|
|
27086
|
+
startSpan.moveBy(keyLeadingWhitespace.length + keyName.length)
|
|
27087
|
+
) : span;
|
|
27088
|
+
let valueSpan = void 0;
|
|
27089
|
+
if (expressionParts.length === 2) {
|
|
27090
|
+
const [, valueLeadingWhitespace, implicit] = (_b2 = expressionParts[1].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN)) != null ? _b2 : [];
|
|
27091
|
+
valueSpan = valueLeadingWhitespace !== void 0 ? new ParseSourceSpan(startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length), startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length + implicit.length)) : void 0;
|
|
27092
|
+
}
|
|
27093
|
+
const sourceSpan2 = new ParseSourceSpan(keySpan.start, (_c2 = valueSpan == null ? void 0 : valueSpan.end) != null ? _c2 : keySpan.end);
|
|
27094
|
+
context[variableName] = new Variable(name, variableName, sourceSpan2, keySpan, valueSpan);
|
|
27093
27095
|
}
|
|
27096
|
+
startSpan = startSpan.moveBy(part.length + 1);
|
|
27094
27097
|
}
|
|
27095
27098
|
}
|
|
27096
27099
|
function validateIfConnectedBlocks(connectedBlocks) {
|
|
@@ -27170,8 +27173,10 @@ function parseConditionalBlockParameters(block, errors, bindingParser) {
|
|
|
27170
27173
|
} else if (expressionAlias !== null) {
|
|
27171
27174
|
errors.push(new ParseError(param.sourceSpan, 'Conditional can only have one "as" expression'));
|
|
27172
27175
|
} else {
|
|
27173
|
-
const name = aliasMatch[
|
|
27174
|
-
|
|
27176
|
+
const name = aliasMatch[2].trim();
|
|
27177
|
+
const variableStart = param.sourceSpan.start.moveBy(aliasMatch[1].length);
|
|
27178
|
+
const variableSpan = new ParseSourceSpan(variableStart, variableStart.moveBy(name.length));
|
|
27179
|
+
expressionAlias = new Variable(name, name, variableSpan, variableSpan);
|
|
27175
27180
|
}
|
|
27176
27181
|
}
|
|
27177
27182
|
return { expression, expressionAlias };
|
|
@@ -27883,7 +27888,7 @@ var HtmlAstToIvyAst = class {
|
|
|
27883
27888
|
if (bindParts[KW_BIND_IDX] != null) {
|
|
27884
27889
|
const identifier = bindParts[IDENT_KW_IDX];
|
|
27885
27890
|
const keySpan2 = createKeySpan(srcSpan, bindParts[KW_BIND_IDX], identifier);
|
|
27886
|
-
this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27891
|
+
this.bindingParser.parsePropertyBinding(identifier, value, false, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27887
27892
|
} else if (bindParts[KW_LET_IDX]) {
|
|
27888
27893
|
if (isTemplateElement) {
|
|
27889
27894
|
const identifier = bindParts[IDENT_KW_IDX];
|
|
@@ -27905,7 +27910,7 @@ var HtmlAstToIvyAst = class {
|
|
|
27905
27910
|
} else if (bindParts[KW_BINDON_IDX]) {
|
|
27906
27911
|
const identifier = bindParts[IDENT_KW_IDX];
|
|
27907
27912
|
const keySpan2 = createKeySpan(srcSpan, bindParts[KW_BINDON_IDX], identifier);
|
|
27908
|
-
this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27913
|
+
this.bindingParser.parsePropertyBinding(identifier, value, false, true, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27909
27914
|
this.parseAssignmentEvent(identifier, value, srcSpan, attribute2.valueSpan, matchableAttributes, boundEvents, keySpan2);
|
|
27910
27915
|
} else if (bindParts[KW_AT_IDX]) {
|
|
27911
27916
|
const keySpan2 = createKeySpan(srcSpan, "", name);
|
|
@@ -27925,10 +27930,10 @@ var HtmlAstToIvyAst = class {
|
|
|
27925
27930
|
const identifier = name.substring(delims.start.length, name.length - delims.end.length);
|
|
27926
27931
|
const keySpan2 = createKeySpan(srcSpan, delims.start, identifier);
|
|
27927
27932
|
if (delims.start === BINDING_DELIMS.BANANA_BOX.start) {
|
|
27928
|
-
this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27933
|
+
this.bindingParser.parsePropertyBinding(identifier, value, false, true, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27929
27934
|
this.parseAssignmentEvent(identifier, value, srcSpan, attribute2.valueSpan, matchableAttributes, boundEvents, keySpan2);
|
|
27930
27935
|
} else if (delims.start === BINDING_DELIMS.PROPERTY.start) {
|
|
27931
|
-
this.bindingParser.parsePropertyBinding(identifier, value, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27936
|
+
this.bindingParser.parsePropertyBinding(identifier, value, false, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
|
|
27932
27937
|
} else {
|
|
27933
27938
|
const events = [];
|
|
27934
27939
|
this.bindingParser.parseEvent(identifier, value, false, srcSpan, attribute2.valueSpan || srcSpan, matchableAttributes, events, keySpan2);
|
|
@@ -27965,7 +27970,7 @@ var HtmlAstToIvyAst = class {
|
|
|
27965
27970
|
}
|
|
27966
27971
|
parseAssignmentEvent(name, expression, sourceSpan, valueSpan, targetMatchableAttrs, boundEvents, keySpan) {
|
|
27967
27972
|
const events = [];
|
|
27968
|
-
this.bindingParser.parseEvent(`${name}Change`,
|
|
27973
|
+
this.bindingParser.parseEvent(`${name}Change`, expression, true, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);
|
|
27969
27974
|
addEvents(events, boundEvents);
|
|
27970
27975
|
}
|
|
27971
27976
|
reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
|
|
@@ -28150,38 +28155,369 @@ var I18nContext = class {
|
|
|
28150
28155
|
} else {
|
|
28151
28156
|
phs.push(...values);
|
|
28152
28157
|
}
|
|
28153
|
-
this.placeholders.set(key, phs);
|
|
28154
|
-
});
|
|
28155
|
-
this._unresolvedCtxCount--;
|
|
28158
|
+
this.placeholders.set(key, phs);
|
|
28159
|
+
});
|
|
28160
|
+
this._unresolvedCtxCount--;
|
|
28161
|
+
}
|
|
28162
|
+
};
|
|
28163
|
+
function wrap(symbol, index2, contextId, closed) {
|
|
28164
|
+
const state = closed ? "/" : "";
|
|
28165
|
+
return wrapI18nPlaceholder(`${state}${symbol}${index2}`, contextId);
|
|
28166
|
+
}
|
|
28167
|
+
function wrapTag(symbol, { index: index2, ctx, isVoid }, closed) {
|
|
28168
|
+
return isVoid ? wrap(symbol, index2, ctx) + wrap(symbol, index2, ctx, true) : wrap(symbol, index2, ctx, closed);
|
|
28169
|
+
}
|
|
28170
|
+
function findTemplateFn(ctx, templateIndex) {
|
|
28171
|
+
return (token) => typeof token === "object" && token.type === TagType.TEMPLATE && token.index === templateIndex && token.ctx === ctx;
|
|
28172
|
+
}
|
|
28173
|
+
function serializePlaceholderValue(value) {
|
|
28174
|
+
const element2 = (data, closed) => wrapTag("#", data, closed);
|
|
28175
|
+
const template2 = (data, closed) => wrapTag("*", data, closed);
|
|
28176
|
+
switch (value.type) {
|
|
28177
|
+
case TagType.ELEMENT:
|
|
28178
|
+
if (value.closed) {
|
|
28179
|
+
return element2(value, true) + (value.tmpl ? template2(value.tmpl, true) : "");
|
|
28180
|
+
}
|
|
28181
|
+
if (value.tmpl) {
|
|
28182
|
+
return template2(value.tmpl) + element2(value) + (value.isVoid ? template2(value.tmpl, true) : "");
|
|
28183
|
+
}
|
|
28184
|
+
return element2(value);
|
|
28185
|
+
case TagType.TEMPLATE:
|
|
28186
|
+
return template2(value, value.closed);
|
|
28187
|
+
default:
|
|
28188
|
+
return value;
|
|
28189
|
+
}
|
|
28190
|
+
}
|
|
28191
|
+
var IMPORTANT_FLAG = "!important";
|
|
28192
|
+
var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
|
|
28193
|
+
var StylingBuilder = class {
|
|
28194
|
+
constructor(_directiveExpr) {
|
|
28195
|
+
this._directiveExpr = _directiveExpr;
|
|
28196
|
+
this._hasInitialValues = false;
|
|
28197
|
+
this.hasBindings = false;
|
|
28198
|
+
this.hasBindingsWithPipes = false;
|
|
28199
|
+
this._classMapInput = null;
|
|
28200
|
+
this._styleMapInput = null;
|
|
28201
|
+
this._singleStyleInputs = null;
|
|
28202
|
+
this._singleClassInputs = null;
|
|
28203
|
+
this._lastStylingInput = null;
|
|
28204
|
+
this._firstStylingInput = null;
|
|
28205
|
+
this._stylesIndex = /* @__PURE__ */ new Map();
|
|
28206
|
+
this._classesIndex = /* @__PURE__ */ new Map();
|
|
28207
|
+
this._initialStyleValues = [];
|
|
28208
|
+
this._initialClassValues = [];
|
|
28209
|
+
}
|
|
28210
|
+
registerBoundInput(input) {
|
|
28211
|
+
let binding = null;
|
|
28212
|
+
let name = input.name;
|
|
28213
|
+
switch (input.type) {
|
|
28214
|
+
case 0:
|
|
28215
|
+
binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
|
|
28216
|
+
break;
|
|
28217
|
+
case 3:
|
|
28218
|
+
binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
|
|
28219
|
+
break;
|
|
28220
|
+
case 2:
|
|
28221
|
+
binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
|
|
28222
|
+
break;
|
|
28223
|
+
}
|
|
28224
|
+
return binding ? true : false;
|
|
28225
|
+
}
|
|
28226
|
+
registerInputBasedOnName(name, expression, sourceSpan) {
|
|
28227
|
+
let binding = null;
|
|
28228
|
+
const prefix = name.substring(0, 6);
|
|
28229
|
+
const isStyle = name === "style" || prefix === "style." || prefix === "style!";
|
|
28230
|
+
const isClass = !isStyle && (name === "class" || prefix === "class." || prefix === "class!");
|
|
28231
|
+
if (isStyle || isClass) {
|
|
28232
|
+
const isMapBased = name.charAt(5) !== ".";
|
|
28233
|
+
const property2 = name.slice(isMapBased ? 5 : 6);
|
|
28234
|
+
if (isStyle) {
|
|
28235
|
+
binding = this.registerStyleInput(property2, isMapBased, expression, sourceSpan);
|
|
28236
|
+
} else {
|
|
28237
|
+
binding = this.registerClassInput(property2, isMapBased, expression, sourceSpan);
|
|
28238
|
+
}
|
|
28239
|
+
}
|
|
28240
|
+
return binding;
|
|
28241
|
+
}
|
|
28242
|
+
registerStyleInput(name, isMapBased, value, sourceSpan, suffix) {
|
|
28243
|
+
if (isEmptyExpression(value)) {
|
|
28244
|
+
return null;
|
|
28245
|
+
}
|
|
28246
|
+
if (!isCssCustomProperty(name)) {
|
|
28247
|
+
name = hyphenate(name);
|
|
28248
|
+
}
|
|
28249
|
+
const { property: property2, hasOverrideFlag, suffix: bindingSuffix } = parseProperty(name);
|
|
28250
|
+
suffix = typeof suffix === "string" && suffix.length !== 0 ? suffix : bindingSuffix;
|
|
28251
|
+
const entry = { name: property2, suffix, value, sourceSpan, hasOverrideFlag };
|
|
28252
|
+
if (isMapBased) {
|
|
28253
|
+
this._styleMapInput = entry;
|
|
28254
|
+
} else {
|
|
28255
|
+
(this._singleStyleInputs = this._singleStyleInputs || []).push(entry);
|
|
28256
|
+
registerIntoMap(this._stylesIndex, property2);
|
|
28257
|
+
}
|
|
28258
|
+
this._lastStylingInput = entry;
|
|
28259
|
+
this._firstStylingInput = this._firstStylingInput || entry;
|
|
28260
|
+
this._checkForPipes(value);
|
|
28261
|
+
this.hasBindings = true;
|
|
28262
|
+
return entry;
|
|
28263
|
+
}
|
|
28264
|
+
registerClassInput(name, isMapBased, value, sourceSpan) {
|
|
28265
|
+
if (isEmptyExpression(value)) {
|
|
28266
|
+
return null;
|
|
28267
|
+
}
|
|
28268
|
+
const { property: property2, hasOverrideFlag } = parseProperty(name);
|
|
28269
|
+
const entry = { name: property2, value, sourceSpan, hasOverrideFlag, suffix: null };
|
|
28270
|
+
if (isMapBased) {
|
|
28271
|
+
this._classMapInput = entry;
|
|
28272
|
+
} else {
|
|
28273
|
+
(this._singleClassInputs = this._singleClassInputs || []).push(entry);
|
|
28274
|
+
registerIntoMap(this._classesIndex, property2);
|
|
28275
|
+
}
|
|
28276
|
+
this._lastStylingInput = entry;
|
|
28277
|
+
this._firstStylingInput = this._firstStylingInput || entry;
|
|
28278
|
+
this._checkForPipes(value);
|
|
28279
|
+
this.hasBindings = true;
|
|
28280
|
+
return entry;
|
|
28281
|
+
}
|
|
28282
|
+
_checkForPipes(value) {
|
|
28283
|
+
if (value instanceof ASTWithSource && value.ast instanceof BindingPipe) {
|
|
28284
|
+
this.hasBindingsWithPipes = true;
|
|
28285
|
+
}
|
|
28286
|
+
}
|
|
28287
|
+
registerStyleAttr(value) {
|
|
28288
|
+
this._initialStyleValues = parse(value);
|
|
28289
|
+
this._hasInitialValues = true;
|
|
28290
|
+
}
|
|
28291
|
+
registerClassAttr(value) {
|
|
28292
|
+
this._initialClassValues = value.trim().split(/\s+/g);
|
|
28293
|
+
this._hasInitialValues = true;
|
|
28294
|
+
}
|
|
28295
|
+
populateInitialStylingAttrs(attrs) {
|
|
28296
|
+
if (this._initialClassValues.length) {
|
|
28297
|
+
attrs.push(literal(1));
|
|
28298
|
+
for (let i = 0; i < this._initialClassValues.length; i++) {
|
|
28299
|
+
attrs.push(literal(this._initialClassValues[i]));
|
|
28300
|
+
}
|
|
28301
|
+
}
|
|
28302
|
+
if (this._initialStyleValues.length) {
|
|
28303
|
+
attrs.push(literal(2));
|
|
28304
|
+
for (let i = 0; i < this._initialStyleValues.length; i += 2) {
|
|
28305
|
+
attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
|
|
28306
|
+
}
|
|
28307
|
+
}
|
|
28308
|
+
}
|
|
28309
|
+
assignHostAttrs(attrs, definitionMap) {
|
|
28310
|
+
if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
|
|
28311
|
+
this.populateInitialStylingAttrs(attrs);
|
|
28312
|
+
definitionMap.set("hostAttrs", literalArr(attrs));
|
|
28313
|
+
}
|
|
28314
|
+
}
|
|
28315
|
+
buildClassMapInstruction(valueConverter) {
|
|
28316
|
+
if (this._classMapInput) {
|
|
28317
|
+
return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
|
|
28318
|
+
}
|
|
28319
|
+
return null;
|
|
28320
|
+
}
|
|
28321
|
+
buildStyleMapInstruction(valueConverter) {
|
|
28322
|
+
if (this._styleMapInput) {
|
|
28323
|
+
return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);
|
|
28324
|
+
}
|
|
28325
|
+
return null;
|
|
28326
|
+
}
|
|
28327
|
+
_buildMapBasedInstruction(valueConverter, isClassBased, stylingInput) {
|
|
28328
|
+
let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
|
|
28329
|
+
const mapValue = stylingInput.value.visit(valueConverter);
|
|
28330
|
+
let reference2;
|
|
28331
|
+
if (mapValue instanceof Interpolation$1) {
|
|
28332
|
+
totalBindingSlotsRequired += mapValue.expressions.length;
|
|
28333
|
+
reference2 = isClassBased ? getClassMapInterpolationExpression(mapValue) : getStyleMapInterpolationExpression(mapValue);
|
|
28334
|
+
} else {
|
|
28335
|
+
reference2 = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
|
|
28336
|
+
}
|
|
28337
|
+
return {
|
|
28338
|
+
reference: reference2,
|
|
28339
|
+
calls: [{
|
|
28340
|
+
supportsInterpolation: true,
|
|
28341
|
+
sourceSpan: stylingInput.sourceSpan,
|
|
28342
|
+
allocateBindingSlots: totalBindingSlotsRequired,
|
|
28343
|
+
params: (convertFn) => {
|
|
28344
|
+
const convertResult = convertFn(mapValue);
|
|
28345
|
+
const params = Array.isArray(convertResult) ? convertResult : [convertResult];
|
|
28346
|
+
return params;
|
|
28347
|
+
}
|
|
28348
|
+
}]
|
|
28349
|
+
};
|
|
28350
|
+
}
|
|
28351
|
+
_buildSingleInputs(reference2, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {
|
|
28352
|
+
const instructions = [];
|
|
28353
|
+
inputs.forEach((input) => {
|
|
28354
|
+
const previousInstruction = instructions[instructions.length - 1];
|
|
28355
|
+
const value = input.value.visit(valueConverter);
|
|
28356
|
+
let referenceForCall = reference2;
|
|
28357
|
+
let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
|
|
28358
|
+
if (value instanceof Interpolation$1) {
|
|
28359
|
+
totalBindingSlotsRequired += value.expressions.length;
|
|
28360
|
+
if (getInterpolationExpressionFn) {
|
|
28361
|
+
referenceForCall = getInterpolationExpressionFn(value);
|
|
28362
|
+
}
|
|
28363
|
+
}
|
|
28364
|
+
const call2 = {
|
|
28365
|
+
sourceSpan: input.sourceSpan,
|
|
28366
|
+
allocateBindingSlots: totalBindingSlotsRequired,
|
|
28367
|
+
supportsInterpolation: !!getInterpolationExpressionFn,
|
|
28368
|
+
params: (convertFn) => {
|
|
28369
|
+
const params = [];
|
|
28370
|
+
params.push(literal(input.name));
|
|
28371
|
+
const convertResult = convertFn(value);
|
|
28372
|
+
if (Array.isArray(convertResult)) {
|
|
28373
|
+
params.push(...convertResult);
|
|
28374
|
+
} else {
|
|
28375
|
+
params.push(convertResult);
|
|
28376
|
+
}
|
|
28377
|
+
if (!isClassBased && input.suffix !== null) {
|
|
28378
|
+
params.push(literal(input.suffix));
|
|
28379
|
+
}
|
|
28380
|
+
return params;
|
|
28381
|
+
}
|
|
28382
|
+
};
|
|
28383
|
+
if (previousInstruction && previousInstruction.reference === referenceForCall) {
|
|
28384
|
+
previousInstruction.calls.push(call2);
|
|
28385
|
+
} else {
|
|
28386
|
+
instructions.push({ reference: referenceForCall, calls: [call2] });
|
|
28387
|
+
}
|
|
28388
|
+
});
|
|
28389
|
+
return instructions;
|
|
28390
|
+
}
|
|
28391
|
+
_buildClassInputs(valueConverter) {
|
|
28392
|
+
if (this._singleClassInputs) {
|
|
28393
|
+
return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
|
|
28394
|
+
}
|
|
28395
|
+
return [];
|
|
28396
|
+
}
|
|
28397
|
+
_buildStyleInputs(valueConverter) {
|
|
28398
|
+
if (this._singleStyleInputs) {
|
|
28399
|
+
return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
|
|
28400
|
+
}
|
|
28401
|
+
return [];
|
|
28402
|
+
}
|
|
28403
|
+
buildUpdateLevelInstructions(valueConverter) {
|
|
28404
|
+
const instructions = [];
|
|
28405
|
+
if (this.hasBindings) {
|
|
28406
|
+
const styleMapInstruction = this.buildStyleMapInstruction(valueConverter);
|
|
28407
|
+
if (styleMapInstruction) {
|
|
28408
|
+
instructions.push(styleMapInstruction);
|
|
28409
|
+
}
|
|
28410
|
+
const classMapInstruction = this.buildClassMapInstruction(valueConverter);
|
|
28411
|
+
if (classMapInstruction) {
|
|
28412
|
+
instructions.push(classMapInstruction);
|
|
28413
|
+
}
|
|
28414
|
+
instructions.push(...this._buildStyleInputs(valueConverter));
|
|
28415
|
+
instructions.push(...this._buildClassInputs(valueConverter));
|
|
28416
|
+
}
|
|
28417
|
+
return instructions;
|
|
28156
28418
|
}
|
|
28157
28419
|
};
|
|
28158
|
-
function
|
|
28159
|
-
|
|
28160
|
-
|
|
28420
|
+
function registerIntoMap(map, key) {
|
|
28421
|
+
if (!map.has(key)) {
|
|
28422
|
+
map.set(key, map.size);
|
|
28423
|
+
}
|
|
28161
28424
|
}
|
|
28162
|
-
function
|
|
28163
|
-
|
|
28425
|
+
function parseProperty(name) {
|
|
28426
|
+
let hasOverrideFlag = false;
|
|
28427
|
+
const overrideIndex = name.indexOf(IMPORTANT_FLAG);
|
|
28428
|
+
if (overrideIndex !== -1) {
|
|
28429
|
+
name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
|
|
28430
|
+
hasOverrideFlag = true;
|
|
28431
|
+
}
|
|
28432
|
+
let suffix = null;
|
|
28433
|
+
let property2 = name;
|
|
28434
|
+
const unitIndex = name.lastIndexOf(".");
|
|
28435
|
+
if (unitIndex > 0) {
|
|
28436
|
+
suffix = name.slice(unitIndex + 1);
|
|
28437
|
+
property2 = name.substring(0, unitIndex);
|
|
28438
|
+
}
|
|
28439
|
+
return { property: property2, suffix, hasOverrideFlag };
|
|
28164
28440
|
}
|
|
28165
|
-
function
|
|
28166
|
-
|
|
28441
|
+
function getClassMapInterpolationExpression(interpolation) {
|
|
28442
|
+
switch (getInterpolationArgsLength(interpolation)) {
|
|
28443
|
+
case 1:
|
|
28444
|
+
return Identifiers.classMap;
|
|
28445
|
+
case 3:
|
|
28446
|
+
return Identifiers.classMapInterpolate1;
|
|
28447
|
+
case 5:
|
|
28448
|
+
return Identifiers.classMapInterpolate2;
|
|
28449
|
+
case 7:
|
|
28450
|
+
return Identifiers.classMapInterpolate3;
|
|
28451
|
+
case 9:
|
|
28452
|
+
return Identifiers.classMapInterpolate4;
|
|
28453
|
+
case 11:
|
|
28454
|
+
return Identifiers.classMapInterpolate5;
|
|
28455
|
+
case 13:
|
|
28456
|
+
return Identifiers.classMapInterpolate6;
|
|
28457
|
+
case 15:
|
|
28458
|
+
return Identifiers.classMapInterpolate7;
|
|
28459
|
+
case 17:
|
|
28460
|
+
return Identifiers.classMapInterpolate8;
|
|
28461
|
+
default:
|
|
28462
|
+
return Identifiers.classMapInterpolateV;
|
|
28463
|
+
}
|
|
28167
28464
|
}
|
|
28168
|
-
function
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28172
|
-
case
|
|
28173
|
-
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
return
|
|
28180
|
-
case
|
|
28181
|
-
return
|
|
28465
|
+
function getStyleMapInterpolationExpression(interpolation) {
|
|
28466
|
+
switch (getInterpolationArgsLength(interpolation)) {
|
|
28467
|
+
case 1:
|
|
28468
|
+
return Identifiers.styleMap;
|
|
28469
|
+
case 3:
|
|
28470
|
+
return Identifiers.styleMapInterpolate1;
|
|
28471
|
+
case 5:
|
|
28472
|
+
return Identifiers.styleMapInterpolate2;
|
|
28473
|
+
case 7:
|
|
28474
|
+
return Identifiers.styleMapInterpolate3;
|
|
28475
|
+
case 9:
|
|
28476
|
+
return Identifiers.styleMapInterpolate4;
|
|
28477
|
+
case 11:
|
|
28478
|
+
return Identifiers.styleMapInterpolate5;
|
|
28479
|
+
case 13:
|
|
28480
|
+
return Identifiers.styleMapInterpolate6;
|
|
28481
|
+
case 15:
|
|
28482
|
+
return Identifiers.styleMapInterpolate7;
|
|
28483
|
+
case 17:
|
|
28484
|
+
return Identifiers.styleMapInterpolate8;
|
|
28182
28485
|
default:
|
|
28183
|
-
return
|
|
28486
|
+
return Identifiers.styleMapInterpolateV;
|
|
28487
|
+
}
|
|
28488
|
+
}
|
|
28489
|
+
function getStylePropInterpolationExpression(interpolation) {
|
|
28490
|
+
switch (getInterpolationArgsLength(interpolation)) {
|
|
28491
|
+
case 1:
|
|
28492
|
+
return Identifiers.styleProp;
|
|
28493
|
+
case 3:
|
|
28494
|
+
return Identifiers.stylePropInterpolate1;
|
|
28495
|
+
case 5:
|
|
28496
|
+
return Identifiers.stylePropInterpolate2;
|
|
28497
|
+
case 7:
|
|
28498
|
+
return Identifiers.stylePropInterpolate3;
|
|
28499
|
+
case 9:
|
|
28500
|
+
return Identifiers.stylePropInterpolate4;
|
|
28501
|
+
case 11:
|
|
28502
|
+
return Identifiers.stylePropInterpolate5;
|
|
28503
|
+
case 13:
|
|
28504
|
+
return Identifiers.stylePropInterpolate6;
|
|
28505
|
+
case 15:
|
|
28506
|
+
return Identifiers.stylePropInterpolate7;
|
|
28507
|
+
case 17:
|
|
28508
|
+
return Identifiers.stylePropInterpolate8;
|
|
28509
|
+
default:
|
|
28510
|
+
return Identifiers.stylePropInterpolateV;
|
|
28511
|
+
}
|
|
28512
|
+
}
|
|
28513
|
+
function isCssCustomProperty(name) {
|
|
28514
|
+
return name.startsWith("--");
|
|
28515
|
+
}
|
|
28516
|
+
function isEmptyExpression(ast) {
|
|
28517
|
+
if (ast instanceof ASTWithSource) {
|
|
28518
|
+
ast = ast.ast;
|
|
28184
28519
|
}
|
|
28520
|
+
return ast instanceof EmptyExpr$1;
|
|
28185
28521
|
}
|
|
28186
28522
|
var NG_CONTENT_SELECT_ATTR = "select";
|
|
28187
28523
|
var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
|
|
@@ -28201,7 +28537,7 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
|
|
|
28201
28537
|
const eventArgumentName = "$event";
|
|
28202
28538
|
const implicitReceiverAccesses = /* @__PURE__ */ new Set();
|
|
28203
28539
|
const implicitReceiverExpr = scope === null || scope.bindingLevel === 0 ? variable(CONTEXT_NAME) : scope.getOrCreateSharedContextVar(0);
|
|
28204
|
-
const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, "b", eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
|
|
28540
|
+
const bindingStatements = eventAst.type === 2 ? convertAssignmentActionBinding(scope, implicitReceiverExpr, handler, "b", eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS) : convertActionBinding(scope, implicitReceiverExpr, handler, "b", eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
|
|
28205
28541
|
const statements = [];
|
|
28206
28542
|
const variableDeclarations = scope == null ? void 0 : scope.variableDeclarations();
|
|
28207
28543
|
const restoreViewStatement = scope == null ? void 0 : scope.restoreViewStatement();
|
|
@@ -28593,7 +28929,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
28593
28929
|
element2.inputs.forEach((input) => {
|
|
28594
28930
|
const stylingInputWasSet = stylingBuilder.registerBoundInput(input);
|
|
28595
28931
|
if (!stylingInputWasSet) {
|
|
28596
|
-
if (input.type === 0 && input.i18n) {
|
|
28932
|
+
if ((input.type === 0 || input.type === 5) && input.i18n) {
|
|
28597
28933
|
boundI18nAttrs.push(input);
|
|
28598
28934
|
} else {
|
|
28599
28935
|
allOtherInputs.push(input);
|
|
@@ -28627,7 +28963,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
28627
28963
|
}
|
|
28628
28964
|
if (element2.outputs.length > 0) {
|
|
28629
28965
|
for (const outputAst of element2.outputs) {
|
|
28630
|
-
this.creationInstruction(outputAst.sourceSpan, Identifiers.listener, this.prepareListenerParameter(element2.name, outputAst, elementIndex));
|
|
28966
|
+
this.creationInstruction(outputAst.sourceSpan, outputAst.type === 2 ? Identifiers.twoWayListener : Identifiers.listener, this.prepareListenerParameter(element2.name, outputAst, elementIndex));
|
|
28631
28967
|
}
|
|
28632
28968
|
}
|
|
28633
28969
|
if (isI18nRootElement) {
|
|
@@ -28651,6 +28987,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
28651
28987
|
this.allocateBindingSlots(value);
|
|
28652
28988
|
propertyBindings.push({
|
|
28653
28989
|
span: input.sourceSpan,
|
|
28990
|
+
reference: Identifiers.property,
|
|
28654
28991
|
paramsOrFn: getBindingFunctionParams(() => hasValue ? this.convertPropertyBinding(value) : emptyValueBindInstruction, prepareSyntheticPropertyName(input.name))
|
|
28655
28992
|
});
|
|
28656
28993
|
} else {
|
|
@@ -28679,12 +29016,13 @@ var TemplateDefinitionBuilder = class {
|
|
|
28679
29016
|
}
|
|
28680
29017
|
}
|
|
28681
29018
|
this.allocateBindingSlots(value);
|
|
28682
|
-
if (inputType === 0) {
|
|
29019
|
+
if (inputType === 0 || inputType === 5) {
|
|
28683
29020
|
if (value instanceof Interpolation$1) {
|
|
28684
29021
|
this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value), elementIndex, attrName, input, value, params);
|
|
28685
29022
|
} else {
|
|
28686
29023
|
propertyBindings.push({
|
|
28687
29024
|
span: input.sourceSpan,
|
|
29025
|
+
reference: inputType === 5 ? Identifiers.twoWayProperty : Identifiers.property,
|
|
28688
29026
|
paramsOrFn: getBindingFunctionParams(() => this.convertPropertyBinding(value), attrName, params)
|
|
28689
29027
|
});
|
|
28690
29028
|
}
|
|
@@ -28712,7 +29050,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
28712
29050
|
}
|
|
28713
29051
|
});
|
|
28714
29052
|
for (const propertyBinding of propertyBindings) {
|
|
28715
|
-
this.updateInstructionWithAdvance(elementIndex, propertyBinding.span,
|
|
29053
|
+
this.updateInstructionWithAdvance(elementIndex, propertyBinding.span, propertyBinding.reference, propertyBinding.paramsOrFn);
|
|
28716
29054
|
}
|
|
28717
29055
|
for (const attributeBinding of attributeBindings) {
|
|
28718
29056
|
this.updateInstructionWithAdvance(elementIndex, attributeBinding.span, Identifiers.attribute, attributeBinding.paramsOrFn);
|
|
@@ -28742,7 +29080,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
28742
29080
|
}
|
|
28743
29081
|
}
|
|
28744
29082
|
const contextName = `${this.contextName}${contextNameSuffix}_${index2}`;
|
|
28745
|
-
const name = `${contextName}_Template
|
|
29083
|
+
const name = this.constantPool.uniqueName(`${contextName}_Template`, false);
|
|
28746
29084
|
const visitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, index2, name, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this.deferBlocks, this.elementLocations, this.allDeferrableDepsFn, this._constants);
|
|
28747
29085
|
this._nestedTemplateFns.push(() => {
|
|
28748
29086
|
const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset, i18nMeta, variableAliases);
|
|
@@ -28788,7 +29126,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
28788
29126
|
this.templatePropertyBindings(templateIndex, inputs);
|
|
28789
29127
|
}
|
|
28790
29128
|
for (const outputAst of template2.outputs) {
|
|
28791
|
-
this.creationInstruction(outputAst.sourceSpan, Identifiers.listener, this.prepareListenerParameter("ng_template", outputAst, templateIndex));
|
|
29129
|
+
this.creationInstruction(outputAst.sourceSpan, outputAst.type === 2 ? Identifiers.twoWayListener : Identifiers.listener, this.prepareListenerParameter("ng_template", outputAst, templateIndex));
|
|
28792
29130
|
}
|
|
28793
29131
|
}
|
|
28794
29132
|
}
|
|
@@ -28951,7 +29289,10 @@ var TemplateDefinitionBuilder = class {
|
|
|
28951
29289
|
const dependencyExp = [];
|
|
28952
29290
|
for (const deferredDep of metadata.deps) {
|
|
28953
29291
|
if (deferredDep.isDeferrable) {
|
|
28954
|
-
const innerFn = arrowFn(
|
|
29292
|
+
const innerFn = arrowFn(
|
|
29293
|
+
[new FnParam("m", DYNAMIC_TYPE)],
|
|
29294
|
+
variable("m").prop(deferredDep.isDefaultImport ? "default" : deferredDep.symbolName)
|
|
29295
|
+
);
|
|
28955
29296
|
const importExpr2 = new DynamicImportExpr(deferredDep.importPath).prop("then").callFn([innerFn]);
|
|
28956
29297
|
dependencyExp.push(importExpr2);
|
|
28957
29298
|
} else {
|
|
@@ -29868,6 +30209,121 @@ function getTranslationDeclStmts(message, variable2, closureVar, params = {}, tr
|
|
|
29868
30209
|
function createClosureModeGuard() {
|
|
29869
30210
|
return typeofExpr(variable(NG_I18N_CLOSURE_MODE)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE));
|
|
29870
30211
|
}
|
|
30212
|
+
function toQueryFlags(query) {
|
|
30213
|
+
return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
|
|
30214
|
+
}
|
|
30215
|
+
function getQueryPredicate(query, constantPool) {
|
|
30216
|
+
if (Array.isArray(query.predicate)) {
|
|
30217
|
+
let predicate = [];
|
|
30218
|
+
query.predicate.forEach((selector) => {
|
|
30219
|
+
const selectors = selector.split(",").map((token) => literal(token.trim()));
|
|
30220
|
+
predicate.push(...selectors);
|
|
30221
|
+
});
|
|
30222
|
+
return constantPool.getConstLiteral(literalArr(predicate), true);
|
|
30223
|
+
} else {
|
|
30224
|
+
switch (query.predicate.forwardRef) {
|
|
30225
|
+
case 0:
|
|
30226
|
+
case 2:
|
|
30227
|
+
return query.predicate.expression;
|
|
30228
|
+
case 1:
|
|
30229
|
+
return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
|
|
30230
|
+
}
|
|
30231
|
+
}
|
|
30232
|
+
}
|
|
30233
|
+
function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams) {
|
|
30234
|
+
const parameters = [];
|
|
30235
|
+
if (prependParams !== void 0) {
|
|
30236
|
+
parameters.push(...prependParams);
|
|
30237
|
+
}
|
|
30238
|
+
if (query.isSignal) {
|
|
30239
|
+
parameters.push(new ReadPropExpr(variable(CONTEXT_NAME), query.propertyName));
|
|
30240
|
+
}
|
|
30241
|
+
parameters.push(getQueryPredicate(query, constantPool), literal(toQueryFlags(query)));
|
|
30242
|
+
if (query.read) {
|
|
30243
|
+
parameters.push(query.read);
|
|
30244
|
+
}
|
|
30245
|
+
const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal;
|
|
30246
|
+
return importExpr(queryCreateFn).callFn(parameters);
|
|
30247
|
+
}
|
|
30248
|
+
var queryAdvancePlaceholder = Symbol("queryAdvancePlaceholder");
|
|
30249
|
+
function collapseAdvanceStatements(statements) {
|
|
30250
|
+
const result = [];
|
|
30251
|
+
let advanceCollapseCount = 0;
|
|
30252
|
+
const flushAdvanceCount = () => {
|
|
30253
|
+
if (advanceCollapseCount > 0) {
|
|
30254
|
+
result.unshift(importExpr(Identifiers.queryAdvance).callFn(advanceCollapseCount === 1 ? [] : [literal(advanceCollapseCount)]).toStmt());
|
|
30255
|
+
advanceCollapseCount = 0;
|
|
30256
|
+
}
|
|
30257
|
+
};
|
|
30258
|
+
for (let i = statements.length - 1; i >= 0; i--) {
|
|
30259
|
+
const st = statements[i];
|
|
30260
|
+
if (st === queryAdvancePlaceholder) {
|
|
30261
|
+
advanceCollapseCount++;
|
|
30262
|
+
} else {
|
|
30263
|
+
flushAdvanceCount();
|
|
30264
|
+
result.unshift(st);
|
|
30265
|
+
}
|
|
30266
|
+
}
|
|
30267
|
+
flushAdvanceCount();
|
|
30268
|
+
return result;
|
|
30269
|
+
}
|
|
30270
|
+
function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
30271
|
+
const createStatements = [];
|
|
30272
|
+
const updateStatements = [];
|
|
30273
|
+
const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
|
|
30274
|
+
viewQueries.forEach((query) => {
|
|
30275
|
+
const queryDefinitionCall = createQueryCreateCall(query, constantPool, {
|
|
30276
|
+
signalBased: Identifiers.viewQuerySignal,
|
|
30277
|
+
nonSignal: Identifiers.viewQuery
|
|
30278
|
+
});
|
|
30279
|
+
createStatements.push(queryDefinitionCall.toStmt());
|
|
30280
|
+
if (query.isSignal) {
|
|
30281
|
+
updateStatements.push(queryAdvancePlaceholder);
|
|
30282
|
+
return;
|
|
30283
|
+
}
|
|
30284
|
+
const temporary = tempAllocator();
|
|
30285
|
+
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
30286
|
+
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
30287
|
+
const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
|
|
30288
|
+
updateStatements.push(refresh.and(updateDirective).toStmt());
|
|
30289
|
+
});
|
|
30290
|
+
const viewQueryFnName = name ? `${name}_Query` : null;
|
|
30291
|
+
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
|
|
30292
|
+
renderFlagCheckIfStmt(1, createStatements),
|
|
30293
|
+
renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
|
|
30294
|
+
], INFERRED_TYPE, null, viewQueryFnName);
|
|
30295
|
+
}
|
|
30296
|
+
function createContentQueriesFunction(queries, constantPool, name) {
|
|
30297
|
+
const createStatements = [];
|
|
30298
|
+
const updateStatements = [];
|
|
30299
|
+
const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
|
|
30300
|
+
for (const query of queries) {
|
|
30301
|
+
createStatements.push(createQueryCreateCall(
|
|
30302
|
+
query,
|
|
30303
|
+
constantPool,
|
|
30304
|
+
{ nonSignal: Identifiers.contentQuery, signalBased: Identifiers.contentQuerySignal },
|
|
30305
|
+
[variable("dirIndex")]
|
|
30306
|
+
).toStmt());
|
|
30307
|
+
if (query.isSignal) {
|
|
30308
|
+
updateStatements.push(queryAdvancePlaceholder);
|
|
30309
|
+
continue;
|
|
30310
|
+
}
|
|
30311
|
+
const temporary = tempAllocator();
|
|
30312
|
+
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
30313
|
+
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
30314
|
+
const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
|
|
30315
|
+
updateStatements.push(refresh.and(updateDirective).toStmt());
|
|
30316
|
+
}
|
|
30317
|
+
const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
|
|
30318
|
+
return fn([
|
|
30319
|
+
new FnParam(RENDER_FLAGS, NUMBER_TYPE),
|
|
30320
|
+
new FnParam(CONTEXT_NAME, null),
|
|
30321
|
+
new FnParam("dirIndex", null)
|
|
30322
|
+
], [
|
|
30323
|
+
renderFlagCheckIfStmt(1, createStatements),
|
|
30324
|
+
renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
|
|
30325
|
+
], INFERRED_TYPE, null, contentQueriesFnName);
|
|
30326
|
+
}
|
|
29871
30327
|
var ATTR_REGEX = /attr\.([^\]]+)/;
|
|
29872
30328
|
var COMPONENT_VARIABLE = "%COMP%";
|
|
29873
30329
|
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
|
@@ -29946,8 +30402,8 @@ function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
|
|
|
29946
30402
|
}
|
|
29947
30403
|
function createDeferredDepsFunction(constantPool, name, deps) {
|
|
29948
30404
|
const dependencyExp = [];
|
|
29949
|
-
for (const [symbolName, importPath] of deps) {
|
|
29950
|
-
const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(symbolName));
|
|
30405
|
+
for (const [symbolName, { importPath, isDefaultImport }] of deps) {
|
|
30406
|
+
const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(isDefaultImport ? "default" : symbolName));
|
|
29951
30407
|
const importExpr2 = new DynamicImportExpr(importPath).prop("then").callFn([innerFn]);
|
|
29952
30408
|
dependencyExp.push(importExpr2);
|
|
29953
30409
|
}
|
|
@@ -29971,12 +30427,12 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
29971
30427
|
}
|
|
29972
30428
|
const templateTypeName = meta.name;
|
|
29973
30429
|
const templateName = templateTypeName ? `${templateTypeName}_Template` : null;
|
|
29974
|
-
|
|
29975
|
-
|
|
29976
|
-
|
|
29977
|
-
|
|
29978
|
-
|
|
29979
|
-
|
|
30430
|
+
let allDeferrableDepsFn = null;
|
|
30431
|
+
if (meta.deferBlocks.size > 0 && meta.deferrableTypes.size > 0 && meta.deferBlockDepsEmitMode === 1) {
|
|
30432
|
+
const fnName = `${templateTypeName}_DeferFn`;
|
|
30433
|
+
allDeferrableDepsFn = createDeferredDepsFunction(constantPool, fnName, meta.deferrableTypes);
|
|
30434
|
+
}
|
|
30435
|
+
if (!USE_TEMPLATE_PIPELINE && !meta.useTemplatePipeline) {
|
|
29980
30436
|
const template2 = meta.template;
|
|
29981
30437
|
const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks, /* @__PURE__ */ new Map(), allDeferrableDepsFn);
|
|
29982
30438
|
const templateFunctionExpression = templateBuilder.buildTemplateFunction(template2.nodes, []);
|
|
@@ -29996,7 +30452,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
29996
30452
|
}
|
|
29997
30453
|
definitionMap.set("template", templateFunctionExpression);
|
|
29998
30454
|
} else {
|
|
29999
|
-
const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks);
|
|
30455
|
+
const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks, allDeferrableDepsFn);
|
|
30000
30456
|
transform(tpl, CompilationJobKind.Tmpl);
|
|
30001
30457
|
const templateFn = emitTemplateFn(tpl, constantPool);
|
|
30002
30458
|
if (tpl.contentSelectors !== null) {
|
|
@@ -30082,16 +30538,6 @@ function compileDeclarationList(list2, mode) {
|
|
|
30082
30538
|
throw new Error(`Unsupported with an array of pre-resolved dependencies`);
|
|
30083
30539
|
}
|
|
30084
30540
|
}
|
|
30085
|
-
function prepareQueryParams(query, constantPool) {
|
|
30086
|
-
const parameters = [getQueryPredicate(query, constantPool), literal(toQueryFlags(query))];
|
|
30087
|
-
if (query.read) {
|
|
30088
|
-
parameters.push(query.read);
|
|
30089
|
-
}
|
|
30090
|
-
return parameters;
|
|
30091
|
-
}
|
|
30092
|
-
function toQueryFlags(query) {
|
|
30093
|
-
return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
|
|
30094
|
-
}
|
|
30095
30541
|
function convertAttributesToExpressions(attributes) {
|
|
30096
30542
|
const values = [];
|
|
30097
30543
|
for (let key of Object.getOwnPropertyNames(attributes)) {
|
|
@@ -30100,28 +30546,6 @@ function convertAttributesToExpressions(attributes) {
|
|
|
30100
30546
|
}
|
|
30101
30547
|
return values;
|
|
30102
30548
|
}
|
|
30103
|
-
function createContentQueriesFunction(queries, constantPool, name) {
|
|
30104
|
-
const createStatements = [];
|
|
30105
|
-
const updateStatements = [];
|
|
30106
|
-
const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
|
|
30107
|
-
for (const query of queries) {
|
|
30108
|
-
createStatements.push(importExpr(Identifiers.contentQuery).callFn([variable("dirIndex"), ...prepareQueryParams(query, constantPool)]).toStmt());
|
|
30109
|
-
const temporary = tempAllocator();
|
|
30110
|
-
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
30111
|
-
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
30112
|
-
const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
|
|
30113
|
-
updateStatements.push(refresh.and(updateDirective).toStmt());
|
|
30114
|
-
}
|
|
30115
|
-
const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
|
|
30116
|
-
return fn([
|
|
30117
|
-
new FnParam(RENDER_FLAGS, NUMBER_TYPE),
|
|
30118
|
-
new FnParam(CONTEXT_NAME, null),
|
|
30119
|
-
new FnParam("dirIndex", null)
|
|
30120
|
-
], [
|
|
30121
|
-
renderFlagCheckIfStmt(1, createStatements),
|
|
30122
|
-
renderFlagCheckIfStmt(2, updateStatements)
|
|
30123
|
-
], INFERRED_TYPE, null, contentQueriesFnName);
|
|
30124
|
-
}
|
|
30125
30549
|
function stringAsType(str) {
|
|
30126
30550
|
return expressionType(literal(str));
|
|
30127
30551
|
}
|
|
@@ -30173,29 +30597,10 @@ function createDirectiveType(meta) {
|
|
|
30173
30597
|
}
|
|
30174
30598
|
return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
|
|
30175
30599
|
}
|
|
30176
|
-
function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
30177
|
-
const createStatements = [];
|
|
30178
|
-
const updateStatements = [];
|
|
30179
|
-
const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
|
|
30180
|
-
viewQueries.forEach((query) => {
|
|
30181
|
-
const queryDefinition = importExpr(Identifiers.viewQuery).callFn(prepareQueryParams(query, constantPool));
|
|
30182
|
-
createStatements.push(queryDefinition.toStmt());
|
|
30183
|
-
const temporary = tempAllocator();
|
|
30184
|
-
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
30185
|
-
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
30186
|
-
const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
|
|
30187
|
-
updateStatements.push(refresh.and(updateDirective).toStmt());
|
|
30188
|
-
});
|
|
30189
|
-
const viewQueryFnName = name ? `${name}_Query` : null;
|
|
30190
|
-
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
|
|
30191
|
-
renderFlagCheckIfStmt(1, createStatements),
|
|
30192
|
-
renderFlagCheckIfStmt(2, updateStatements)
|
|
30193
|
-
], INFERRED_TYPE, null, viewQueryFnName);
|
|
30194
|
-
}
|
|
30195
30600
|
function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindingParser, constantPool, selector, name, definitionMap) {
|
|
30196
30601
|
const bindings = bindingParser.createBoundHostProperties(hostBindingsMetadata.properties, typeSourceSpan);
|
|
30197
30602
|
const eventBindings = bindingParser.createDirectiveHostEventAsts(hostBindingsMetadata.listeners, typeSourceSpan);
|
|
30198
|
-
if (USE_TEMPLATE_PIPELINE) {
|
|
30603
|
+
if (USE_TEMPLATE_PIPELINE || hostBindingsMetadata.useTemplatePipeline) {
|
|
30199
30604
|
if (hostBindingsMetadata.specialAttributes.styleAttr) {
|
|
30200
30605
|
hostBindingsMetadata.attributes["style"] = literal(hostBindingsMetadata.specialAttributes.styleAttr);
|
|
30201
30606
|
}
|
|
@@ -31114,6 +31519,7 @@ function extractScopedNodeEntities(rootScope) {
|
|
|
31114
31519
|
}
|
|
31115
31520
|
var ResourceLoader = class {
|
|
31116
31521
|
};
|
|
31522
|
+
var SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT = false;
|
|
31117
31523
|
var CompilerFacadeImpl = class {
|
|
31118
31524
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
31119
31525
|
this.jitEvaluator = jitEvaluator;
|
|
@@ -31246,7 +31652,8 @@ var CompilerFacadeImpl = class {
|
|
|
31246
31652
|
animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
|
|
31247
31653
|
viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
|
|
31248
31654
|
relativeContextFilePath: "",
|
|
31249
|
-
i18nUseExternalIds: true
|
|
31655
|
+
i18nUseExternalIds: true,
|
|
31656
|
+
useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
|
|
31250
31657
|
});
|
|
31251
31658
|
const jitExpressionSourceMap = `ng:///${facade.name}.js`;
|
|
31252
31659
|
return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
|
|
@@ -31296,6 +31703,7 @@ var CompilerFacadeImpl = class {
|
|
|
31296
31703
|
};
|
|
31297
31704
|
function convertToR3QueryMetadata(facade) {
|
|
31298
31705
|
return __spreadProps(__spreadValues({}, facade), {
|
|
31706
|
+
isSignal: facade.isSignal,
|
|
31299
31707
|
predicate: convertQueryPredicate(facade.predicate),
|
|
31300
31708
|
read: facade.read ? new WrappedNodeExpr(facade.read) : null,
|
|
31301
31709
|
static: facade.static,
|
|
@@ -31311,7 +31719,8 @@ function convertQueryDeclarationToMetadata(declaration) {
|
|
|
31311
31719
|
descendants: (_b2 = declaration.descendants) != null ? _b2 : false,
|
|
31312
31720
|
read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,
|
|
31313
31721
|
static: (_c2 = declaration.static) != null ? _c2 : false,
|
|
31314
|
-
emitDistinctChangesOnly: (_d2 = declaration.emitDistinctChangesOnly) != null ? _d2 : true
|
|
31722
|
+
emitDistinctChangesOnly: (_d2 = declaration.emitDistinctChangesOnly) != null ? _d2 : true,
|
|
31723
|
+
isSignal: !!declaration.isSignal
|
|
31315
31724
|
};
|
|
31316
31725
|
}
|
|
31317
31726
|
function convertQueryPredicate(predicate) {
|
|
@@ -31345,7 +31754,9 @@ function convertDirectiveFacadeToMetadata(facade) {
|
|
|
31345
31754
|
typeSourceSpan: facade.typeSourceSpan,
|
|
31346
31755
|
type: wrapReference(facade.type),
|
|
31347
31756
|
deps: null,
|
|
31348
|
-
host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host),
|
|
31757
|
+
host: __spreadProps(__spreadValues({}, extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host)), {
|
|
31758
|
+
useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
|
|
31759
|
+
}),
|
|
31349
31760
|
inputs: __spreadValues(__spreadValues({}, inputsFromMetadata), inputsFromType),
|
|
31350
31761
|
outputs: __spreadValues(__spreadValues({}, outputsFromMetadata), outputsFromType),
|
|
31351
31762
|
queries: facade.queries.map(convertToR3QueryMetadata),
|
|
@@ -31388,7 +31799,8 @@ function convertHostDeclarationToMetadata(host = {}) {
|
|
|
31388
31799
|
specialAttributes: {
|
|
31389
31800
|
classAttr: host.classAttribute,
|
|
31390
31801
|
styleAttr: host.styleAttribute
|
|
31391
|
-
}
|
|
31802
|
+
},
|
|
31803
|
+
useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
|
|
31392
31804
|
};
|
|
31393
31805
|
}
|
|
31394
31806
|
function convertHostDirectivesToMetadata(metadata) {
|
|
@@ -31453,7 +31865,8 @@ function convertDeclareComponentFacadeToMetadata(decl2, typeSourceSpan, sourceMa
|
|
|
31453
31865
|
interpolation,
|
|
31454
31866
|
declarationListEmitMode: 2,
|
|
31455
31867
|
relativeContextFilePath: "",
|
|
31456
|
-
i18nUseExternalIds: true
|
|
31868
|
+
i18nUseExternalIds: true,
|
|
31869
|
+
useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
|
|
31457
31870
|
});
|
|
31458
31871
|
}
|
|
31459
31872
|
function convertDeclarationFacadeToMetadata(declaration) {
|
|
@@ -31685,7 +32098,7 @@ function publishFacade(global) {
|
|
|
31685
32098
|
const ng = global.ng || (global.ng = {});
|
|
31686
32099
|
ng.\u0275compilerFacade = new CompilerFacadeImpl();
|
|
31687
32100
|
}
|
|
31688
|
-
var VERSION = new Version("17.
|
|
32101
|
+
var VERSION = new Version("17.2.0");
|
|
31689
32102
|
var _VisitorMode;
|
|
31690
32103
|
(function(_VisitorMode2) {
|
|
31691
32104
|
_VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
|
|
@@ -33639,7 +34052,7 @@ ${[...componentsToMigrate].join("\n")}`);
|
|
|
33639
34052
|
* found in the LICENSE file at https://angular.io/license
|
|
33640
34053
|
*/
|
|
33641
34054
|
/**
|
|
33642
|
-
* @license Angular v17.
|
|
34055
|
+
* @license Angular v17.2.0
|
|
33643
34056
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
33644
34057
|
* License: MIT
|
|
33645
34058
|
*/
|