@ngstarter-ui/components 21.0.30 → 21.0.32
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/ai/component-registry.json +58 -14
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-CKrOhA7h.mjs → ngstarter-ui-components-content-editor-code-block.component-BZniTqu-.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-CKrOhA7h.mjs.map → ngstarter-ui-components-content-editor-code-block.component-BZniTqu-.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-zSApBzF3.mjs → ngstarter-ui-components-content-editor-embed-block-QzDMzd3u.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-zSApBzF3.mjs.map → ngstarter-ui-components-content-editor-embed-block-QzDMzd3u.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-Dv8d0nCy.mjs → ngstarter-ui-components-content-editor-heading-block.component-CnYRnDBY.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-Dv8d0nCy.mjs.map → ngstarter-ui-components-content-editor-heading-block.component-CnYRnDBY.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-g-H7a5Z_.mjs → ngstarter-ui-components-content-editor-image-block.component-IP_eRCQ2.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-g-H7a5Z_.mjs.map → ngstarter-ui-components-content-editor-image-block.component-IP_eRCQ2.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-PgqisgxY.mjs → ngstarter-ui-components-content-editor-list-block.component-amyfzXOW.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-PgqisgxY.mjs.map → ngstarter-ui-components-content-editor-list-block.component-amyfzXOW.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BuMm25ea.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DA-VnRa_.mjs} +453 -36
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DA-VnRa_.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-DS_6CzuA.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-DtophI4_.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-DS_6CzuA.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-DtophI4_.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-Df92Nqvp.mjs → ngstarter-ui-components-content-editor-quote-block.component-B20eHQdw.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-Df92Nqvp.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-B20eHQdw.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-D4rdPkGz.mjs → ngstarter-ui-components-content-editor-table-block.component-hJ4OxKRX.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-D4rdPkGz.mjs.map → ngstarter-ui-components-content-editor-table-block.component-hJ4OxKRX.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-DqS9Lhp_.mjs → ngstarter-ui-components-content-editor-video-block.component-Cs7L1wwX.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-DqS9Lhp_.mjs.map → ngstarter-ui-components-content-editor-video-block.component-Cs7L1wwX.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +65 -4
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +65 -4
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +10 -6
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +113 -29
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_global.scss +11 -0
- package/types/ngstarter-ui-components-content-editor.d.ts +226 -7
- package/types/ngstarter-ui-components-country-select.d.ts +12 -0
- package/types/ngstarter-ui-components-currency-select.d.ts +12 -0
- package/types/ngstarter-ui-components-menu.d.ts +3 -3
- package/types/ngstarter-ui-components-phone-input.d.ts +19 -2
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BuMm25ea.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, DestroyRef, viewChild, input, signal, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { C as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs';
|
|
4
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-
|
|
4
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DA-VnRa_.mjs';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { C as CursorController } from './ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs';
|
|
7
7
|
|
|
@@ -107,4 +107,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
107
107
|
}], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
108
108
|
|
|
109
109
|
export { ParagraphBlockComponent };
|
|
110
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-paragraph-block.component-
|
|
110
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-paragraph-block.component-DtophI4_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-paragraph-block.component-DS_6CzuA.mjs","sources":["../../../projects/components/content-editor/src/_builder/paragraph-block/paragraph-block.component.ts","../../../projects/components/content-editor/src/_builder/paragraph-block/paragraph-block.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component, DestroyRef,\n ElementRef, forwardRef,\n inject,\n input,\n OnInit, signal,\n viewChild\n} from '@angular/core';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty\n} from '../../types';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CursorController } from '../../utils/cursor-controller';\n\n@Component({\n selector: 'ngs-paragraph-block',\n imports: [\n ContentEditorContentEditableDirective\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => ParagraphBlockComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './paragraph-block.component.html',\n styleUrl: './paragraph-block.component.scss',\n host: {\n 'class': 'ngs-paragraph-block',\n '[class.is-empty]': '_isEmpty()'\n }\n})\nexport class ParagraphBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<string>();\n settings = input.required<any>();\n props = input<ContentEditorItemProperty[]>([]);\n index = input.required<number>();\n placeholder = input('Enter text here');\n\n protected _content = signal<string>('');\n protected _props = signal<ContentEditorItemProperty[]>([]);\n protected _isEmpty = signal<boolean>(true);\n readonly initialized = signal(false);\n\n ngOnInit() {\n this._content.set(this.content());\n this._props.set(this.props());\n this._isEmpty.set(this.content().length === 0);\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const cursorController = new CursorController(element);\n cursorController.setToEnd();\n }\n\n getData(): any {\n return {\n content: this._content(),\n props: this._props(),\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return this.getData().content.trim().length === 0;\n }\n\n protected onContentChanged(content: string) {\n if (!this.initialized()) {\n return;\n }\n\n this._content.set(content);\n this._isEmpty.set(content.trim().length === 0);\n\n this.update();\n }\n\n protected onPropsChanged(props: ContentEditorItemProperty[]) {\n this._contentBuilder.setBlockProps(this.id(), props);\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n protected _onKeyDown(event: KeyboardEvent) {\n if (event.key === 'Backspace' && !this._content()) {\n this._contentBuilder.deleteBlock(this.id());\n }\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<p #contentRef\n class=\"content\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [settings]=\"settings()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></p>\n"],"names":[],"mappings":";;;;;;;MAyCa,uBAAuB,CAAA;AAC1B,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAClE,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhC,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmC,YAAY,CAAC;AAExF,IAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,wEAAU;AAC7B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAU;AAClC,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAO;AAChC,IAAA,KAAK,GAAG,KAAK,CAA8B,EAAE,4EAAC;AAC9C,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;AAChC,IAAA,WAAW,GAAG,KAAK,CAAC,iBAAiB,kFAAC;AAE5B,IAAA,QAAQ,GAAG,MAAM,CAAS,EAAE,+EAAC;AAC7B,IAAA,MAAM,GAAG,MAAM,CAA8B,EAAE,6EAAC;AAChD,IAAA,QAAQ,GAAG,MAAM,CAAU,IAAI,+EAAC;AACjC,IAAA,WAAW,GAAG,MAAM,CAAC,KAAK,kFAAC;IAEpC,QAAQ,GAAA;QACN,I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A,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-paragraph-block.component-DtophI4_.mjs","sources":["../../../projects/components/content-editor/src/_builder/paragraph-block/paragraph-block.component.ts","../../../projects/components/content-editor/src/_builder/paragraph-block/paragraph-block.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component, DestroyRef,\n ElementRef, forwardRef,\n inject,\n input,\n OnInit, signal,\n viewChild\n} from '@angular/core';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty\n} from '../../types';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CursorController } from '../../utils/cursor-controller';\n\n@Component({\n selector: 'ngs-paragraph-block',\n imports: [\n ContentEditorContentEditableDirective\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => ParagraphBlockComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './paragraph-block.component.html',\n styleUrl: './paragraph-block.component.scss',\n host: {\n 'class': 'ngs-paragraph-block',\n '[class.is-empty]': '_isEmpty()'\n }\n})\nexport class ParagraphBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<string>();\n settings = input.required<any>();\n props = input<ContentEditorItemProperty[]>([]);\n index = input.required<number>();\n placeholder = input('Enter text here');\n\n protected _content = signal<string>('');\n protected _props = signal<ContentEditorItemProperty[]>([]);\n protected _isEmpty = signal<boolean>(true);\n readonly initialized = signal(false);\n\n ngOnInit() {\n this._content.set(this.content());\n this._props.set(this.props());\n this._isEmpty.set(this.content().length === 0);\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const cursorController = new CursorController(element);\n cursorController.setToEnd();\n }\n\n getData(): any {\n return {\n content: this._content(),\n props: this._props(),\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return this.getData().content.trim().length === 0;\n }\n\n protected onContentChanged(content: string) {\n if (!this.initialized()) {\n return;\n }\n\n this._content.set(content);\n this._isEmpty.set(content.trim().length === 0);\n\n this.update();\n }\n\n protected onPropsChanged(props: ContentEditorItemProperty[]) {\n this._contentBuilder.setBlockProps(this.id(), props);\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n protected _onKeyDown(event: KeyboardEvent) {\n if (event.key === 'Backspace' && !this._content()) {\n this._contentBuilder.deleteBlock(this.id());\n }\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<p #contentRef\n class=\"content\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [settings]=\"settings()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></p>\n"],"names":[],"mappings":";;;;;;;MAyCa,uBAAuB,CAAA;AAC1B,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAClE,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhC,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmC,YAAY,CAAC;AAExF,IAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,wEAAU;AAC7B,IAAA,OAAO,GAAG,KAAK,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A,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, DestroyRef, viewChild, input, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-
|
|
3
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DA-VnRa_.mjs';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { C as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs';
|
|
6
6
|
|
|
@@ -138,4 +138,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
138
138
|
}], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], captionPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionPlaceholder", required: false }] }] } });
|
|
139
139
|
|
|
140
140
|
export { QuoteBlockComponent };
|
|
141
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-quote-block.component-
|
|
141
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-quote-block.component-B20eHQdw.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-quote-block.component-Df92Nqvp.mjs","sources":["../../../projects/components/content-editor/src/_builder/quote-block/quote-block.component.ts","../../../projects/components/content-editor/src/_builder/quote-block/quote-block.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component, computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty\n} from '../../types';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\n\nexport interface ContentEditorQuoteBlockContent {\n cite: {\n content: string;\n props: ContentEditorItemProperty[];\n };\n caption?: {\n content: string;\n props: ContentEditorItemProperty[];\n }\n}\n\nexport interface ContentEditorQuoteBlock {\n content: ContentEditorQuoteBlockContent,\n settings: any\n}\n\n@Component({\n selector: 'ngs-quote-block',\n exportAs: 'ngsQuoteBlock',\n imports: [\n ContentEditorContentEditableDirective,\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: QuoteBlockComponent,\n multi: true\n }\n ],\n templateUrl: './quote-block.component.html',\n styleUrl: './quote-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class QuoteBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<ContentEditorQuoteBlockContent>();\n settings = input.required<any>();\n index = input.required<number>();\n placeholder = input('Enter quote here');\n captionPlaceholder = input('Enter caption here');\n\n protected _citeContent = signal<string>('');\n protected _citeProps = signal<ContentEditorItemProperty[]>([]);\n protected _captionContent = signal<string>('');\n protected _captionProps = signal<ContentEditorItemProperty[]>([]);\n protected _isEmpty = signal<boolean>(true);\n readonly initialized = signal(false);\n\n citeOriginalContent = computed(() => {\n return this.content().cite.content || '';\n });\n citeOriginalProps = computed(() => {\n return this.content().cite.props || [];\n });\n captionOriginalContent = computed(() => {\n return this.content().caption?.content || '';\n });\n captionOriginalProps = computed(() => {\n return this.content().caption?.props || [];\n });\n\n ngOnInit() {\n this._citeContent.set(this.citeOriginalContent());\n this._citeProps.set(this.citeOriginalProps());\n this._captionContent.set(this.captionOriginalContent());\n this._captionProps.set(this.captionOriginalProps());\n this._isEmpty.set(this._citeContent().length === 0);\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const range = window.document.createRange();\n range.setStart(element, 0);\n range.setEnd(element, 0);\n const selection = window.getSelection() as Selection;\n selection.removeAllRanges();\n selection.addRange(range);\n }\n\n getData(): any {\n return {\n content: {\n cite: {\n content: this._citeContent(),\n props: this._citeProps(),\n },\n caption: {\n content: this._captionContent(),\n props: this._captionProps(),\n }\n },\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return this.getData().content.cite.content.trim().length === 0;\n }\n\n protected onCiteContentChanged(content: string) {\n if (!this.initialized()) {\n return;\n }\n\n this._isEmpty.set(content.trim().length === 0);\n this._citeContent.set(content.trim());\n this.update();\n }\n\n protected onCaptionContentChanged(content: string) {\n if (!this.initialized()) {\n return;\n }\n\n this._captionContent.set(content.trim());\n this.update();\n }\n\n protected onCitePropsChanged(props: ContentEditorItemProperty[]) {\n this._citeProps.set(props);\n this.update();\n }\n\n protected onCaptionPropsChanged(props: ContentEditorItemProperty[]) {\n this._captionProps.set(props);\n this.update();\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n"],"names":[],"mappings":";;;;;;MAuDa,mBAAmB,CAAA;AACtB,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAClE,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhC,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmC,YAAY,CAAC;AAExF,IAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,wEAAU;A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,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-quote-block.component-B20eHQdw.mjs","sources":["../../../projects/components/content-editor/src/_builder/quote-block/quote-block.component.ts","../../../projects/components/content-editor/src/_builder/quote-block/quote-block.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component, computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty\n} from '../../types';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\n\nexport interface ContentEditorQuoteBlockContent {\n cite: {\n content: string;\n props: ContentEditorItemProperty[];\n };\n caption?: {\n content: string;\n props: ContentEditorItemProperty[];\n }\n}\n\nexport interface ContentEditorQuoteBlock {\n content: ContentEditorQuoteBlockContent,\n settings: any\n}\n\n@Component({\n selector: 'ngs-quote-block',\n exportAs: 'ngsQuoteBlock',\n imports: [\n ContentEditorContentEditableDirective,\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: QuoteBlockComponent,\n multi: true\n }\n ],\n templateUrl: './quote-block.component.html',\n styleUrl: './quote-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class QuoteBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<ContentEditorQuoteBlockContent>();\n settings = input.required<any>();\n index = input.required<number>();\n placeholder = input('Enter quote here');\n captionPlaceholder = input('Enter caption here');\n\n protected _citeContent = signal<string>('');\n protected _citeProps = signal<ContentEditorItemProperty[]>([]);\n protected _captionContent = signal<string>('');\n protected _captionProps = signal<ContentEditorItemProperty[]>([]);\n protected _isEmpty = signal<boolean>(true);\n readonly initialized = signal(false);\n\n citeOriginalContent = computed(() => {\n return this.content().cite.content || '';\n });\n citeOriginalProps = computed(() => {\n return this.content().cite.props || [];\n });\n captionOriginalContent = computed(() => {\n return this.content().caption?.content || '';\n });\n captionOriginalProps = computed(() => {\n return this.content().caption?.props || [];\n });\n\n ngOnInit() {\n this._citeContent.set(this.citeOriginalContent());\n this._citeProps.set(this.citeOriginalProps());\n this._captionContent.set(this.captionOriginalContent());\n this._captionProps.set(this.captionOriginalProps());\n this._isEmpty.set(this._citeContent().length === 0);\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const range = window.document.createRange();\n range.setStart(element, 0);\n range.setEnd(element, 0);\n const selection = window.getSelection() as Selection;\n selection.removeAllRanges();\n selection.addRange(range);\n }\n\n getData(): any {\n return {\n content: {\n cite: {\n content: this._citeContent(),\n props: this._citeProps(),\n },\n caption: {\n content: this._captionContent(),\n props: this._captionProps(),\n }\n },\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return this.getData().content.cite.content.trim().length === 0;\n }\n\n protected onCiteContentChanged(content: string) {\n if (!this.initialized()) {\n return;\n }\n\n this._isEmpty.set(content.trim().length === 0);\n this._citeContent.set(content.trim());\n this.update();\n }\n\n protected onCaptionContentChanged(content: string) {\n if (!this.initialized()) {\n return;\n }\n\n this._captionContent.set(content.trim());\n this.update();\n }\n\n protected onCitePropsChanged(props: ContentEditorItemProperty[]) {\n this._citeProps.set(props);\n this.update();\n }\n\n protected onCaptionPropsChanged(props: ContentEditorItemProperty[]) {\n this._captionProps.set(props);\n this.update();\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n"],"names":[],"mappings":";;;;;;MAuDa,mBAAmB,CAAA;AACtB,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAClE,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhC,IAAA,WAAW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A,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, DestroyRef, output, afterNextRender, Directive, PLATFORM_ID, Input, Renderer2, NgZone, input, booleanAttribute, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal } from '@angular/core';
|
|
3
3
|
import { DOCUMENT, isPlatformServer, isPlatformBrowser } from '@angular/common';
|
|
4
|
-
import { a as CONTENT_BUILDER, C as ContentBuilderStore, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-
|
|
4
|
+
import { a as CONTENT_BUILDER, C as ContentBuilderStore, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DA-VnRa_.mjs';
|
|
5
5
|
import { C as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs';
|
|
6
6
|
import SelectionArea from '@viselect/vanilla';
|
|
7
7
|
import { Icon } from '@ngstarter-ui/components/icon';
|
|
@@ -1576,7 +1576,7 @@ class TableBlockComponent {
|
|
|
1576
1576
|
useExisting: TableBlockComponent,
|
|
1577
1577
|
multi: true
|
|
1578
1578
|
}
|
|
1579
|
-
], viewQueries: [{ propertyName: "_tableRef", first: true, predicate: ["table"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td #cell\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"cell.content = $event\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;width:var(--ngs-content-builder-content-width)}:host .table-container{position:relative;width:max-content}:host table{width:auto!important;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-color-neutral-200)}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props"], outputs: ["contentChanged", "pressedEnter", "initialized", "propsChanged"], exportAs: ["ngsContentEditorContentEditable"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "directive", type: TableColumnsManagerDirective, selector: "[ngsTableColumnsManager]", outputs: ["columnAdded", "columnDeleted", "columnManagingStart", "columnManagingEnd"] }, { kind: "directive", type: TableRowsManagerDirective, selector: "[ngsTableRowsManager]", outputs: ["rowManagingStart", "rowManagingEnd", "rowAdded", "rowDeleted"] }, { kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: ResizableTableDirective, selector: "table[ngsResizableTable]", inputs: ["minColumnWidth", "resizeHandleWidth", "mutationObserverDebounceTime"], outputs: ["columnWidthChange", "columnWidthChangeStart", "columnWidthChangeEnd"] }, { kind: "component", type: DraggableTableComponent, selector: "ngs-draggable-table", inputs: ["disabled"], outputs: ["columnMoved", "rowMoved", "moveStart", "moveEnd"], exportAs: ["ngsDraggableTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1579
|
+
], viewQueries: [{ propertyName: "_tableRef", first: true, predicate: ["table"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td #cell\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"cell.content = $event\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;width:var(--ngs-content-editor-builder-content-width)}:host .table-container{position:relative;width:max-content}:host table{width:auto!important;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-color-neutral-200)}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props"], outputs: ["contentChanged", "pressedEnter", "initialized", "propsChanged"], exportAs: ["ngsContentEditorContentEditable"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "directive", type: TableColumnsManagerDirective, selector: "[ngsTableColumnsManager]", outputs: ["columnAdded", "columnDeleted", "columnManagingStart", "columnManagingEnd"] }, { kind: "directive", type: TableRowsManagerDirective, selector: "[ngsTableRowsManager]", outputs: ["rowManagingStart", "rowManagingEnd", "rowAdded", "rowDeleted"] }, { kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: ResizableTableDirective, selector: "table[ngsResizableTable]", inputs: ["minColumnWidth", "resizeHandleWidth", "mutationObserverDebounceTime"], outputs: ["columnWidthChange", "columnWidthChangeStart", "columnWidthChangeEnd"] }, { kind: "component", type: DraggableTableComponent, selector: "ngs-draggable-table", inputs: ["disabled"], outputs: ["columnMoved", "rowMoved", "moveStart", "moveEnd"], exportAs: ["ngsDraggableTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1580
1580
|
}
|
|
1581
1581
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: TableBlockComponent, decorators: [{
|
|
1582
1582
|
type: Component,
|
|
@@ -1597,8 +1597,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1597
1597
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1598
1598
|
'[class.is-column-managing]': '_columnManaging()',
|
|
1599
1599
|
'[class.is-row-managing]': '_rowManaging()',
|
|
1600
|
-
}, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td #cell\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"cell.content = $event\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;width:var(--ngs-content-builder-content-width)}:host .table-container{position:relative;width:max-content}:host table{width:auto!important;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-color-neutral-200)}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1600
|
+
}, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td #cell\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"cell.content = $event\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;width:var(--ngs-content-editor-builder-content-width)}:host .table-container{position:relative;width:max-content}:host table{width:auto!important;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-color-neutral-200)}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:calc(var(--spacing, .25rem) * 1);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1601
1601
|
}], propDecorators: { _tableRef: [{ type: i0.ViewChild, args: ['table', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }] } });
|
|
1602
1602
|
|
|
1603
1603
|
export { TableBlockComponent };
|
|
1604
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-
|
|
1604
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-hJ4OxKRX.mjs.map
|