@indigina/ui-kit 1.1.330 → 1.1.331
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/fesm2022/indigina-ui-kit.mjs +61 -64
- package/fesm2022/indigina-ui-kit.mjs.map +1 -1
- package/index.d.ts +10 -6
- package/package.json +1 -1
|
@@ -10031,6 +10031,7 @@ class KitCardDetailsComponent {
|
|
|
10031
10031
|
this.kitTextboxComponent = viewChild.required(KitTextboxComponent);
|
|
10032
10032
|
this.cardElement = contentChild('cardElement', ...(ngDevMode ? [{ debugName: "cardElement" }] : []));
|
|
10033
10033
|
this.headerActions = contentChild('headerActions', ...(ngDevMode ? [{ debugName: "headerActions" }] : []));
|
|
10034
|
+
this.details = contentChild('details', ...(ngDevMode ? [{ debugName: "details" }] : []));
|
|
10034
10035
|
this.kitSvgIcon = KitSvgIcon;
|
|
10035
10036
|
this.kitButtonType = KitButtonType;
|
|
10036
10037
|
this.kitButtonKind = KitButtonKind;
|
|
@@ -10044,6 +10045,16 @@ class KitCardDetailsComponent {
|
|
|
10044
10045
|
take: 0,
|
|
10045
10046
|
}, ...(ngDevMode ? [{ debugName: "dataState" }] : []));
|
|
10046
10047
|
this.newCreatedCards = signal([], ...(ngDevMode ? [{ debugName: "newCreatedCards" }] : []));
|
|
10048
|
+
this.skipNewCreatedCardFilter = computed(() => {
|
|
10049
|
+
return this.newCreatedCards().length ? {
|
|
10050
|
+
logic: KitFilterLogic.AND,
|
|
10051
|
+
filters: this.newCreatedCards().map(card => ({
|
|
10052
|
+
field: 'id',
|
|
10053
|
+
operator: KitFilterOperator.NEQ,
|
|
10054
|
+
value: card.id,
|
|
10055
|
+
})),
|
|
10056
|
+
} : {};
|
|
10057
|
+
}, ...(ngDevMode ? [{ debugName: "skipNewCreatedCardFilter" }] : []));
|
|
10047
10058
|
this.shouldAppendFetchedData = true;
|
|
10048
10059
|
}
|
|
10049
10060
|
ngOnInit() {
|
|
@@ -10055,16 +10066,6 @@ class KitCardDetailsComponent {
|
|
|
10055
10066
|
this.initSearchSubscription();
|
|
10056
10067
|
this.initStateFromUrl();
|
|
10057
10068
|
}
|
|
10058
|
-
get skipNewCreatedCardFilter() {
|
|
10059
|
-
return this.newCreatedCards().length ? {
|
|
10060
|
-
logic: KitFilterLogic.AND,
|
|
10061
|
-
filters: this.newCreatedCards().map(card => ({
|
|
10062
|
-
field: 'id',
|
|
10063
|
-
operator: KitFilterOperator.NEQ,
|
|
10064
|
-
value: card.id,
|
|
10065
|
-
})),
|
|
10066
|
-
} : {};
|
|
10067
|
-
}
|
|
10068
10069
|
loadMoreData() {
|
|
10069
10070
|
this.shouldAppendFetchedData = true;
|
|
10070
10071
|
this.dataState.update(state => ({
|
|
@@ -10074,54 +10075,50 @@ class KitCardDetailsComponent {
|
|
|
10074
10075
|
}));
|
|
10075
10076
|
this.updateData();
|
|
10076
10077
|
}
|
|
10077
|
-
onCardClick(
|
|
10078
|
-
|
|
10079
|
-
this.
|
|
10080
|
-
this.
|
|
10078
|
+
onCardClick(card) {
|
|
10079
|
+
const normalizedId = this.normalizeCardId(card.id);
|
|
10080
|
+
this.dataState.update(state => ({ ...state, activeId: normalizedId }));
|
|
10081
|
+
this.navigateToCard(normalizedId);
|
|
10082
|
+
this.cardClicked.emit({ ...card, id: normalizedId });
|
|
10081
10083
|
}
|
|
10082
|
-
|
|
10084
|
+
appendCard(card, navigateToCard = true) {
|
|
10083
10085
|
this.cardData.set([
|
|
10084
10086
|
...this.cardData(),
|
|
10085
|
-
|
|
10087
|
+
card,
|
|
10086
10088
|
]);
|
|
10087
10089
|
this.newCreatedCards.set([
|
|
10088
10090
|
...this.newCreatedCards(),
|
|
10089
|
-
|
|
10091
|
+
card,
|
|
10090
10092
|
]);
|
|
10091
10093
|
this.dataState.update(state => ({
|
|
10092
10094
|
...state,
|
|
10093
|
-
filters: this.skipNewCreatedCardFilter,
|
|
10095
|
+
filters: this.skipNewCreatedCardFilter(),
|
|
10094
10096
|
}));
|
|
10095
|
-
this.total.set(this.total() +
|
|
10097
|
+
this.total.set(this.total() + 1);
|
|
10098
|
+
if (navigateToCard) {
|
|
10099
|
+
this.onCardClick(card);
|
|
10100
|
+
}
|
|
10096
10101
|
}
|
|
10097
10102
|
deleteCard(cardId) {
|
|
10098
10103
|
this.isLoading.set(true);
|
|
10099
|
-
|
|
10104
|
+
const normalizedId = this.normalizeCardId(cardId);
|
|
10105
|
+
this.cardData.set(this.cardData().filter(card => this.normalizeCardId(card.id) !== normalizedId));
|
|
10100
10106
|
this.total.set(this.total() - 1);
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
this.newCreatedCards.set(this.newCreatedCards().filter(card => card.id.toString() !== cardId.toString()));
|
|
10104
|
-
this.dataState.update(state => ({
|
|
10105
|
-
...state,
|
|
10106
|
-
filters: this.skipNewCreatedCardFilter,
|
|
10107
|
-
}));
|
|
10107
|
+
if (this.newCreatedCards().some(card => this.normalizeCardId(card.id) === normalizedId)) {
|
|
10108
|
+
this.removeFromNewCreatedCards(normalizedId);
|
|
10108
10109
|
this.isLoading.set(false);
|
|
10109
10110
|
return;
|
|
10110
10111
|
}
|
|
10112
|
+
const loadedCards = (this.dataState().take ?? this.pageSize()) + (this.dataState().skip ?? 0) - 1;
|
|
10111
10113
|
if (loadedCards >= this.total()) {
|
|
10112
10114
|
this.isLoading.set(false);
|
|
10113
10115
|
return;
|
|
10114
10116
|
}
|
|
10115
10117
|
this.shouldAppendFetchedData = true;
|
|
10116
|
-
this.dataStateChanged.emit({ skip: loadedCards, take: 1, filters: this.skipNewCreatedCardFilter, search: this.dataState().search });
|
|
10118
|
+
this.dataStateChanged.emit({ skip: loadedCards, take: 1, filters: this.skipNewCreatedCardFilter(), search: this.dataState().search });
|
|
10117
10119
|
}
|
|
10118
10120
|
updateSpecificCardData(cardData) {
|
|
10119
|
-
this.cardData.set(this.cardData().map(card =>
|
|
10120
|
-
if (card.id.toString() === cardData.id.toString()) {
|
|
10121
|
-
return cardData;
|
|
10122
|
-
}
|
|
10123
|
-
return card;
|
|
10124
|
-
}));
|
|
10121
|
+
this.cardData.set(this.cardData().map(card => this.normalizeCardId(card.id) === this.normalizeCardId(cardData.id) ? cardData : card));
|
|
10125
10122
|
}
|
|
10126
10123
|
scrollToCardById(id) {
|
|
10127
10124
|
const cardsEl = this.host.nativeElement.querySelector('.kit-card-details .cards');
|
|
@@ -10159,7 +10156,7 @@ class KitCardDetailsComponent {
|
|
|
10159
10156
|
this.updateData();
|
|
10160
10157
|
}
|
|
10161
10158
|
initCardDataSubscription() {
|
|
10162
|
-
|
|
10159
|
+
this.getStateFromUrl();
|
|
10163
10160
|
this.cardData$().pipe(takeUntilDestroyed(this.destroyRef), filter(({ loading }) => !loading)).subscribe(data => {
|
|
10164
10161
|
if (this.shouldAppendFetchedData) {
|
|
10165
10162
|
this.cardData.set([
|
|
@@ -10169,44 +10166,38 @@ class KitCardDetailsComponent {
|
|
|
10169
10166
|
this.total.set(data.results.total + this.newCreatedCards().length);
|
|
10170
10167
|
this.shouldAppendFetchedData = false;
|
|
10171
10168
|
}
|
|
10172
|
-
if (!activeId && this.cardData()?.[0]) {
|
|
10173
|
-
activeId = this.cardData()[0].id.toString();
|
|
10174
|
-
}
|
|
10175
|
-
if (activeId) {
|
|
10176
|
-
if (!this.dataState().activeId && this.cardData().length) {
|
|
10177
|
-
activeId = this.cardData().some(item => item.id.toString() === activeId)
|
|
10178
|
-
? activeId : this.cardData()[0].id.toString();
|
|
10179
|
-
this.onCardClick(activeId);
|
|
10180
|
-
this.isLoading.set(false);
|
|
10181
|
-
requestAnimationFrame(() => {
|
|
10182
|
-
activeId && this.scrollToCardById(activeId);
|
|
10183
|
-
});
|
|
10184
|
-
}
|
|
10185
|
-
else {
|
|
10186
|
-
activeId = this.dataState().activeId;
|
|
10187
|
-
}
|
|
10188
|
-
}
|
|
10189
10169
|
this.isLoading.set(false);
|
|
10190
10170
|
});
|
|
10191
10171
|
}
|
|
10192
10172
|
updateData() {
|
|
10193
10173
|
this.isLoading.set(true);
|
|
10194
|
-
this.
|
|
10174
|
+
this.setQueryParamsToUrl(this.dataState());
|
|
10195
10175
|
this.dataStateChanged.emit(this.dataState());
|
|
10196
10176
|
}
|
|
10177
|
+
normalizeCardId(id) {
|
|
10178
|
+
return id.toString();
|
|
10179
|
+
}
|
|
10180
|
+
removeFromNewCreatedCards(cardId) {
|
|
10181
|
+
this.newCreatedCards.set(this.newCreatedCards().filter(card => this.normalizeCardId(card.id) !== cardId));
|
|
10182
|
+
this.dataState.update(state => ({
|
|
10183
|
+
...state,
|
|
10184
|
+
filters: this.skipNewCreatedCardFilter(),
|
|
10185
|
+
}));
|
|
10186
|
+
}
|
|
10197
10187
|
getStateFromUrl() {
|
|
10198
|
-
const
|
|
10188
|
+
const queryParams = this.activatedRoute.snapshot.queryParams;
|
|
10189
|
+
const routeParams = this.activatedRoute.snapshot.firstChild?.params ?? this.activatedRoute.snapshot.params;
|
|
10199
10190
|
return {
|
|
10200
|
-
skip:
|
|
10201
|
-
take:
|
|
10202
|
-
search:
|
|
10203
|
-
activeId:
|
|
10191
|
+
skip: queryParams?.skip && Number(queryParams.skip),
|
|
10192
|
+
take: queryParams?.take && Number(queryParams.take),
|
|
10193
|
+
search: queryParams?.search && String(queryParams.search),
|
|
10194
|
+
activeId: routeParams?.id && String(routeParams.id),
|
|
10204
10195
|
};
|
|
10205
10196
|
}
|
|
10206
|
-
|
|
10197
|
+
setQueryParamsToUrl(state) {
|
|
10207
10198
|
const queryParams = Object.keys(state).reduce((acc, key) => {
|
|
10208
10199
|
const val = state[key];
|
|
10209
|
-
if (val !== undefined && key !== 'filters') {
|
|
10200
|
+
if (val !== undefined && key !== 'filters' && key !== 'activeId') {
|
|
10210
10201
|
acc[key] = val;
|
|
10211
10202
|
}
|
|
10212
10203
|
return acc;
|
|
@@ -10214,11 +10205,17 @@ class KitCardDetailsComponent {
|
|
|
10214
10205
|
this.router.navigate([], {
|
|
10215
10206
|
relativeTo: this.activatedRoute,
|
|
10216
10207
|
queryParams,
|
|
10217
|
-
queryParamsHandling: '
|
|
10208
|
+
queryParamsHandling: 'merge',
|
|
10209
|
+
});
|
|
10210
|
+
}
|
|
10211
|
+
navigateToCard(id) {
|
|
10212
|
+
this.router.navigate([id], {
|
|
10213
|
+
relativeTo: this.activatedRoute,
|
|
10214
|
+
queryParamsHandling: 'preserve',
|
|
10218
10215
|
});
|
|
10219
10216
|
}
|
|
10220
10217
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: KitCardDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10221
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: KitCardDetailsComponent, isStandalone: true, selector: "kit-card-details", inputs: { cardData$: { classPropertyName: "cardData$", publicName: "cardData$", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dataStateChanged: "dataStateChanged", cardClicked: "cardClicked" }, queries: [{ propertyName: "cardElement", first: true, predicate: ["cardElement"], descendants: true, isSignal: true }, { propertyName: "headerActions", first: true, predicate: ["headerActions"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "kitTextboxComponent", first: true, predicate: KitTextboxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-card-details\">\n <div class=\"header\">\n <kit-entity-title class=\"title\">\n {{ title() }}\n </kit-entity-title>\n <ng-container *ngTemplateOutlet=\"headerActions()\" />\n </div>\n\n <div class=\"content\">\n <div class=\"left-panel\">\n <div class=\"textbox-wrapper\">\n <kit-textbox class=\"search-textbox\"\n [placeholder]=\"'kit.search.placeholder' | translate\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [disabled]=\"isLoading()\"\n [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (cardData$() | async; as cards) {\n @if (cards.loading) {\n @for (skeleton of [1, 2, 3]; track $index) {\n <kit-skeleton [width]=\"'100%'\" [height]=\"'200px'\"/>\n }\n } @else {\n @if (cards.results.data?.length === 0 && newCreatedCards().length === 0) {\n <kit-empty-section [text]=\"'kit.common.noData' | translate\"/>\n } @else {\n @for (card of cardData(); track $index) {\n <div class=\"card\"\n [attr.data-card-id]=\"card.id\"\n [class.active]=\"dataState().activeId === (card.id).toString()\"\n (click)=\"onCardClick(card
|
|
10218
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: KitCardDetailsComponent, isStandalone: true, selector: "kit-card-details", inputs: { cardData$: { classPropertyName: "cardData$", publicName: "cardData$", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dataStateChanged: "dataStateChanged", cardClicked: "cardClicked" }, queries: [{ propertyName: "cardElement", first: true, predicate: ["cardElement"], descendants: true, isSignal: true }, { propertyName: "headerActions", first: true, predicate: ["headerActions"], descendants: true, isSignal: true }, { propertyName: "details", first: true, predicate: ["details"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "kitTextboxComponent", first: true, predicate: KitTextboxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-card-details\">\n <div class=\"header\">\n <kit-entity-title class=\"title\">\n {{ title() }}\n </kit-entity-title>\n <ng-container *ngTemplateOutlet=\"headerActions()\" />\n </div>\n\n <div class=\"content\">\n <div class=\"left-panel\">\n <div class=\"textbox-wrapper\">\n <kit-textbox class=\"search-textbox\"\n [placeholder]=\"'kit.search.placeholder' | translate\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [disabled]=\"isLoading()\"\n [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (cardData$() | async; as cards) {\n @if (cards.loading) {\n @for (skeleton of [1, 2, 3]; track $index) {\n <kit-skeleton [width]=\"'100%'\" [height]=\"'200px'\"/>\n }\n } @else {\n @if (cards.results.data?.length === 0 && newCreatedCards().length === 0) {\n <kit-empty-section [text]=\"'kit.common.noData' | translate\"/>\n } @else {\n @for (card of cardData(); track $index) {\n <div class=\"card\"\n [attr.data-card-id]=\"card.id\"\n [class.active]=\"dataState().activeId === (card.id).toString()\"\n (click)=\"onCardClick(card)\">\n <ng-container *ngTemplateOutlet=\"cardElement(); context: { $implicit: card }\" />\n </div>\n }\n\n @if (total() > cardData().length) {\n <kit-button class=\"load-more-btn\"\n [label]=\"'kit.common.loadMore' | translate\"\n [type]=\"kitButtonType.GHOST\"\n [icon]=\"isLoading() ? kitSvgIcon.RELOAD : kitSvgIcon.CHEVRON_DOWN\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [disabled]=\"isLoading()\"\n (clicked)=\"loadMoreData()\" />\n }\n }\n }\n }\n </div>\n </div>\n\n <div class=\"details\">\n <ng-container *ngTemplateOutlet=\"details(); context: { $implicit: dataState().activeId }\" />\n </div>\n </div>\n</div>\n", styles: [".kit-card-details{height:calc(100vh - var(--ui-kit-header-height) - 50px)}.kit-card-details .header{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.kit-card-details .content{display:flex;gap:10px;height:calc(100% - 50px)}.kit-card-details .left-panel{width:25%}.kit-card-details .left-panel .textbox-wrapper{margin-right:10px;margin-bottom:20px}.kit-card-details .left-panel .textbox-wrapper ::ng-deep .kit-textbox-input .kit-svg-icon{stroke:var(--ui-kit-color-grey-10);fill:none}.kit-card-details .left-panel .textbox-wrapper ::ng-deep .kit-textbox .k-textbox{background-color:var(--ui-kit-color-white)}.kit-card-details .left-panel .textbox-wrapper ::ng-deep .kit-textbox.disabled .k-input-inner{background-color:var(--ui-kit-color-grey-13)}.kit-card-details .left-panel .cards{overflow:hidden auto;padding-right:10px;display:flex;flex-direction:column;gap:10px;height:calc(100% - 60px)}.kit-card-details .left-panel .cards .card{background-color:var(--ui-kit-color-white);border:2px solid var(--ui-kit-color-grey-11);border-radius:8px;padding:8px 10px;cursor:pointer}.kit-card-details .left-panel .cards .card.active{border-color:var(--ui-kit-color-main)}.kit-card-details .left-panel .cards .load-more-btn{margin:10px auto auto}.kit-card-details .details{overflow:hidden auto;flex:1;min-width:0;border:1px solid var(--ui-kit-color-grey-11);border-radius:8px;padding:20px;height:100%}\n"], dependencies: [{ kind: "component", type: KitSkeletonComponent, selector: "kit-skeleton", inputs: ["width", "height", "shape", "animation"] }, { kind: "component", type: KitEmptySectionComponent, selector: "kit-empty-section", inputs: ["text"] }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: KitEntityTitleComponent, selector: "kit-entity-title" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10222
10219
|
}
|
|
10223
10220
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: KitCardDetailsComponent, decorators: [{
|
|
10224
10221
|
type: Component,
|
|
@@ -10231,8 +10228,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
10231
10228
|
KitTextboxComponent,
|
|
10232
10229
|
NgTemplateOutlet,
|
|
10233
10230
|
KitEntityTitleComponent,
|
|
10234
|
-
], template: "<div class=\"kit-card-details\">\n <div class=\"header\">\n <kit-entity-title class=\"title\">\n {{ title() }}\n </kit-entity-title>\n <ng-container *ngTemplateOutlet=\"headerActions()\" />\n </div>\n\n <div class=\"content\">\n <div class=\"left-panel\">\n <div class=\"textbox-wrapper\">\n <kit-textbox class=\"search-textbox\"\n [placeholder]=\"'kit.search.placeholder' | translate\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [disabled]=\"isLoading()\"\n [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (cardData$() | async; as cards) {\n @if (cards.loading) {\n @for (skeleton of [1, 2, 3]; track $index) {\n <kit-skeleton [width]=\"'100%'\" [height]=\"'200px'\"/>\n }\n } @else {\n @if (cards.results.data?.length === 0 && newCreatedCards().length === 0) {\n <kit-empty-section [text]=\"'kit.common.noData' | translate\"/>\n } @else {\n @for (card of cardData(); track $index) {\n <div class=\"card\"\n [attr.data-card-id]=\"card.id\"\n [class.active]=\"dataState().activeId === (card.id).toString()\"\n (click)=\"onCardClick(card
|
|
10235
|
-
}], propDecorators: { cardData$: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardData$", required: true }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], dataStateChanged: [{ type: i0.Output, args: ["dataStateChanged"] }], cardClicked: [{ type: i0.Output, args: ["cardClicked"] }], kitTextboxComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitTextboxComponent), { isSignal: true }] }], cardElement: [{ type: i0.ContentChild, args: ['cardElement', { isSignal: true }] }], headerActions: [{ type: i0.ContentChild, args: ['headerActions', { isSignal: true }] }] } });
|
|
10231
|
+
], template: "<div class=\"kit-card-details\">\n <div class=\"header\">\n <kit-entity-title class=\"title\">\n {{ title() }}\n </kit-entity-title>\n <ng-container *ngTemplateOutlet=\"headerActions()\" />\n </div>\n\n <div class=\"content\">\n <div class=\"left-panel\">\n <div class=\"textbox-wrapper\">\n <kit-textbox class=\"search-textbox\"\n [placeholder]=\"'kit.search.placeholder' | translate\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [disabled]=\"isLoading()\"\n [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (cardData$() | async; as cards) {\n @if (cards.loading) {\n @for (skeleton of [1, 2, 3]; track $index) {\n <kit-skeleton [width]=\"'100%'\" [height]=\"'200px'\"/>\n }\n } @else {\n @if (cards.results.data?.length === 0 && newCreatedCards().length === 0) {\n <kit-empty-section [text]=\"'kit.common.noData' | translate\"/>\n } @else {\n @for (card of cardData(); track $index) {\n <div class=\"card\"\n [attr.data-card-id]=\"card.id\"\n [class.active]=\"dataState().activeId === (card.id).toString()\"\n (click)=\"onCardClick(card)\">\n <ng-container *ngTemplateOutlet=\"cardElement(); context: { $implicit: card }\" />\n </div>\n }\n\n @if (total() > cardData().length) {\n <kit-button class=\"load-more-btn\"\n [label]=\"'kit.common.loadMore' | translate\"\n [type]=\"kitButtonType.GHOST\"\n [icon]=\"isLoading() ? kitSvgIcon.RELOAD : kitSvgIcon.CHEVRON_DOWN\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [disabled]=\"isLoading()\"\n (clicked)=\"loadMoreData()\" />\n }\n }\n }\n }\n </div>\n </div>\n\n <div class=\"details\">\n <ng-container *ngTemplateOutlet=\"details(); context: { $implicit: dataState().activeId }\" />\n </div>\n </div>\n</div>\n", styles: [".kit-card-details{height:calc(100vh - var(--ui-kit-header-height) - 50px)}.kit-card-details .header{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.kit-card-details .content{display:flex;gap:10px;height:calc(100% - 50px)}.kit-card-details .left-panel{width:25%}.kit-card-details .left-panel .textbox-wrapper{margin-right:10px;margin-bottom:20px}.kit-card-details .left-panel .textbox-wrapper ::ng-deep .kit-textbox-input .kit-svg-icon{stroke:var(--ui-kit-color-grey-10);fill:none}.kit-card-details .left-panel .textbox-wrapper ::ng-deep .kit-textbox .k-textbox{background-color:var(--ui-kit-color-white)}.kit-card-details .left-panel .textbox-wrapper ::ng-deep .kit-textbox.disabled .k-input-inner{background-color:var(--ui-kit-color-grey-13)}.kit-card-details .left-panel .cards{overflow:hidden auto;padding-right:10px;display:flex;flex-direction:column;gap:10px;height:calc(100% - 60px)}.kit-card-details .left-panel .cards .card{background-color:var(--ui-kit-color-white);border:2px solid var(--ui-kit-color-grey-11);border-radius:8px;padding:8px 10px;cursor:pointer}.kit-card-details .left-panel .cards .card.active{border-color:var(--ui-kit-color-main)}.kit-card-details .left-panel .cards .load-more-btn{margin:10px auto auto}.kit-card-details .details{overflow:hidden auto;flex:1;min-width:0;border:1px solid var(--ui-kit-color-grey-11);border-radius:8px;padding:20px;height:100%}\n"] }]
|
|
10232
|
+
}], propDecorators: { cardData$: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardData$", required: true }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], dataStateChanged: [{ type: i0.Output, args: ["dataStateChanged"] }], cardClicked: [{ type: i0.Output, args: ["cardClicked"] }], kitTextboxComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitTextboxComponent), { isSignal: true }] }], cardElement: [{ type: i0.ContentChild, args: ['cardElement', { isSignal: true }] }], headerActions: [{ type: i0.ContentChild, args: ['headerActions', { isSignal: true }] }], details: [{ type: i0.ContentChild, args: ['details', { isSignal: true }] }] } });
|
|
10236
10233
|
|
|
10237
10234
|
class KitListComponent {
|
|
10238
10235
|
constructor() {
|