@coreui/angular 5.5.23 → 5.5.24

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.
@@ -5180,6 +5180,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.13", ngImpo
5180
5180
  }] });
5181
5181
 
5182
5182
  class ModalComponent {
5183
+ static ngAcceptInputType_ariaModalInput;
5184
+ static ngAcceptInputType_scrollable;
5185
+ static ngAcceptInputType_visibleInput;
5183
5186
  #document = inject(DOCUMENT);
5184
5187
  #renderer = inject(Renderer2);
5185
5188
  #hostElement = inject(ElementRef);
@@ -5238,7 +5241,7 @@ class ModalComponent {
5238
5241
  */
5239
5242
  ariaModalInput = input(false, ...(ngDevMode ? [{ debugName: "ariaModalInput", transform: booleanAttribute, alias: 'ariaModal' }] : [{ transform: booleanAttribute, alias: 'ariaModal' }]));
5240
5243
  ariaModal = computed(() => {
5241
- return this.visible || this.ariaModalInput() ? true : null;
5244
+ return this.visible() || this.ariaModalInput() ? true : null;
5242
5245
  }, ...(ngDevMode ? [{ debugName: "ariaModal" }] : []));
5243
5246
  /**
5244
5247
  * Create a scrollable modal that allows scrolling the modal body.
@@ -5252,27 +5255,18 @@ class ModalComponent {
5252
5255
  * @default false
5253
5256
  */
5254
5257
  visibleInput = input(false, ...(ngDevMode ? [{ debugName: "visibleInput", transform: booleanAttribute, alias: 'visible' }] : [{ transform: booleanAttribute, alias: 'visible' }]));
5258
+ visible = linkedSignal(this.visibleInput, ...(ngDevMode ? [{ debugName: "visible" }] : []));
5255
5259
  #visibleInputEffect = effect(() => {
5256
- const visible = this.visibleInput();
5260
+ const visible = this.visible();
5257
5261
  untracked(() => {
5258
- this.visible = visible;
5262
+ this.setBodyStyles(visible);
5263
+ this.setBackdrop(this.backdrop() !== false && visible);
5264
+ this.visibleChange?.emit(visible);
5259
5265
  });
5260
5266
  }, ...(ngDevMode ? [{ debugName: "#visibleInputEffect" }] : []));
5261
- set visible(value) {
5262
- if (this.#visible() !== value) {
5263
- this.#visible.set(value);
5264
- this.setBodyStyles(value);
5265
- this.setBackdrop(this.backdrop() !== false && value);
5266
- this.visibleChange?.emit(value);
5267
- }
5268
- }
5269
- get visible() {
5270
- return this.#visible();
5271
- }
5272
- #visible = signal(false, ...(ngDevMode ? [{ debugName: "#visible" }] : []));
5273
5267
  #activeElement = signal(null, ...(ngDevMode ? [{ debugName: "#activeElement" }] : []));
5274
5268
  #visibleEffect = effect(() => {
5275
- const visible = this.#visible();
5269
+ const visible = this.visible();
5276
5270
  const afterViewInit = this.#afterViewInit();
5277
5271
  untracked(() => {
5278
5272
  if (visible && afterViewInit) {
@@ -5316,13 +5310,13 @@ class ModalComponent {
5316
5310
  };
5317
5311
  }, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
5318
5312
  get ariaHidden() {
5319
- return this.visible ? null : true;
5313
+ return this.visible() ? null : true;
5320
5314
  }
5321
5315
  animateTrigger = computed(() => {
5322
- return this.visible ? 'visible' : 'hidden';
5316
+ return this.visible() ? 'visible' : 'hidden';
5323
5317
  }, ...(ngDevMode ? [{ debugName: "animateTrigger" }] : []));
5324
5318
  get show() {
5325
- return this.visible && this.#show();
5319
+ return this.visible() && this.#show();
5326
5320
  }
5327
5321
  set show(value) {
5328
5322
  this.#show.set(value);
@@ -5346,10 +5340,10 @@ class ModalComponent {
5346
5340
  this.#backdropService.resetScrollbar();
5347
5341
  }
5348
5342
  });
5349
- this.show = this.visible;
5343
+ this.show = this.visible();
5350
5344
  }
5351
5345
  onKeyUpHandler(event) {
5352
- if (event.key === 'Escape' && this.keyboard() && this.visible) {
5346
+ if (event.key === 'Escape' && this.keyboard() && this.visible()) {
5353
5347
  if (this.backdrop() === 'static') {
5354
5348
  this.setStaticBackdrop();
5355
5349
  }
@@ -5391,12 +5385,12 @@ class ModalComponent {
5391
5385
  this.#modalService.modalState$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((action) => {
5392
5386
  if (this === action.modal || this.id === action.id) {
5393
5387
  if ('show' in action) {
5394
- this.visible = action?.show === 'toggle' ? !this.visible : action.show;
5388
+ this.visible.update((visible) => (action?.show === 'toggle' ? !visible : action.show));
5395
5389
  }
5396
5390
  }
5397
5391
  else {
5398
- if (this.visible) {
5399
- this.visible = false;
5392
+ if (this.visible()) {
5393
+ this.visible.set(false);
5400
5394
  }
5401
5395
  }
5402
5396
  });
@@ -5427,7 +5421,7 @@ class ModalComponent {
5427
5421
  }
5428
5422
  }
5429
5423
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5430
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.13", type: ModalComponent, isStandalone: true, selector: "c-modal", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, attrId: { classPropertyName: "attrId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModalInput: { classPropertyName: "ariaModalInput", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "@showHide.start": "animateStart($event)", "@showHide.done": "animateDone($event)", "mousedown": "onMouseDownHandler($event)", "click": "onClickHandler($event)", "document:keyup": "onKeyUpHandler($event)" }, properties: { "class": "hostClasses()", "attr.role": "role()", "attr.inert": "ariaHidden", "attr.id": "id", "attr.aria-modal": "ariaModal()", "attr.tabindex": "-1", "@showHide": "animateTrigger()" }, classAttribute: "modal" }, viewQueries: [{ propertyName: "modalContentRef", first: true, predicate: ["modalContentRef"], descendants: true, read: ElementRef, isSignal: true }], exportAs: ["cModal"], ngImport: i0, template: "<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div [cdkTrapFocus]=\"visible\" [cdkTrapFocusAutoCapture]=\"visible\" style=\"display: contents;\" #modalContentRef>\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n", dependencies: [{ kind: "component", type: ModalDialogComponent, selector: "c-modal-dialog", inputs: ["alignment", "fullscreen", "scrollable", "size"] }, { kind: "component", type: ModalContentComponent, selector: "c-modal-content" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
5424
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.13", type: ModalComponent, isStandalone: true, selector: "c-modal", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, attrId: { classPropertyName: "attrId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModalInput: { classPropertyName: "ariaModalInput", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "@showHide.start": "animateStart($event)", "@showHide.done": "animateDone($event)", "mousedown": "onMouseDownHandler($event)", "click": "onClickHandler($event)", "document:keyup": "onKeyUpHandler($event)" }, properties: { "class": "hostClasses()", "attr.role": "role()", "attr.inert": "ariaHidden", "attr.id": "id", "attr.aria-modal": "ariaModal()", "attr.tabindex": "-1", "@showHide": "animateTrigger()" }, classAttribute: "modal" }, viewQueries: [{ propertyName: "modalContentRef", first: true, predicate: ["modalContentRef"], descendants: true, read: ElementRef, isSignal: true }], exportAs: ["cModal"], ngImport: i0, template: "<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n @let isVisible = visible();\n <div [cdkTrapFocus]=\"isVisible\" [cdkTrapFocusAutoCapture]=\"isVisible\" style=\"display: contents;\" #modalContentRef>\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n", dependencies: [{ kind: "component", type: ModalDialogComponent, selector: "c-modal-dialog", inputs: ["alignment", "fullscreen", "scrollable", "size"] }, { kind: "component", type: ModalContentComponent, selector: "c-modal-content" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
5431
5425
  trigger('showHide', [
5432
5426
  state('visible', style({
5433
5427
  // display: 'block'
@@ -5465,7 +5459,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.13", ngImpo
5465
5459
  '(mousedown)': 'onMouseDownHandler($event)',
5466
5460
  '(click)': 'onClickHandler($event)',
5467
5461
  '(document:keyup)': 'onKeyUpHandler($event)'
5468
- }, template: "<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div [cdkTrapFocus]=\"visible\" [cdkTrapFocusAutoCapture]=\"visible\" style=\"display: contents;\" #modalContentRef>\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n" }]
5462
+ }, template: "<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n @let isVisible = visible();\n <div [cdkTrapFocus]=\"isVisible\" [cdkTrapFocusAutoCapture]=\"isVisible\" style=\"display: contents;\" #modalContentRef>\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n" }]
5469
5463
  }], propDecorators: { alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], attrId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], transition: [{ type: i0.Input, args: [{ isSignal: true, alias: "transition", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaModalInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaModal", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], modalContentRef: [{ type: i0.ViewChild, args: ['modalContentRef', { ...{ read: ElementRef }, isSignal: true }] }] } });
5470
5464
 
5471
5465
  class ModalModule {