@indigina/ui-kit 1.1.330 → 1.1.332
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 +66 -64
- package/fesm2022/indigina-ui-kit.mjs.map +1 -1
- package/index.d.ts +11 -6
- package/package.json +1 -1
|
@@ -6916,6 +6916,7 @@ var KitFilterType;
|
|
|
6916
6916
|
var KitFilterDateRange;
|
|
6917
6917
|
(function (KitFilterDateRange) {
|
|
6918
6918
|
KitFilterDateRange["TODAY"] = "today";
|
|
6919
|
+
KitFilterDateRange["LAST_THREE_DAYS"] = "lastThreeDays";
|
|
6919
6920
|
KitFilterDateRange["LAST_WEEK"] = "lastWeek";
|
|
6920
6921
|
KitFilterDateRange["LAST_MONTH"] = "lastMonth";
|
|
6921
6922
|
})(KitFilterDateRange || (KitFilterDateRange = {}));
|
|
@@ -7012,6 +7013,10 @@ const getDatesByRange = (range) => {
|
|
|
7012
7013
|
case KitFilterDateRange.TODAY:
|
|
7013
7014
|
startDate = new Date(now.setHours(0, 0, 0, 0));
|
|
7014
7015
|
break;
|
|
7016
|
+
case KitFilterDateRange.LAST_THREE_DAYS:
|
|
7017
|
+
startDate.setDate(now.getDate() - 3);
|
|
7018
|
+
startDate.setHours(0, 0, 0, 0);
|
|
7019
|
+
break;
|
|
7015
7020
|
case KitFilterDateRange.LAST_WEEK:
|
|
7016
7021
|
startDate.setDate(now.getDate() - 7);
|
|
7017
7022
|
startDate.setHours(0, 0, 0, 0);
|
|
@@ -10031,6 +10036,7 @@ class KitCardDetailsComponent {
|
|
|
10031
10036
|
this.kitTextboxComponent = viewChild.required(KitTextboxComponent);
|
|
10032
10037
|
this.cardElement = contentChild('cardElement', ...(ngDevMode ? [{ debugName: "cardElement" }] : []));
|
|
10033
10038
|
this.headerActions = contentChild('headerActions', ...(ngDevMode ? [{ debugName: "headerActions" }] : []));
|
|
10039
|
+
this.details = contentChild('details', ...(ngDevMode ? [{ debugName: "details" }] : []));
|
|
10034
10040
|
this.kitSvgIcon = KitSvgIcon;
|
|
10035
10041
|
this.kitButtonType = KitButtonType;
|
|
10036
10042
|
this.kitButtonKind = KitButtonKind;
|
|
@@ -10044,6 +10050,16 @@ class KitCardDetailsComponent {
|
|
|
10044
10050
|
take: 0,
|
|
10045
10051
|
}, ...(ngDevMode ? [{ debugName: "dataState" }] : []));
|
|
10046
10052
|
this.newCreatedCards = signal([], ...(ngDevMode ? [{ debugName: "newCreatedCards" }] : []));
|
|
10053
|
+
this.skipNewCreatedCardFilter = computed(() => {
|
|
10054
|
+
return this.newCreatedCards().length ? {
|
|
10055
|
+
logic: KitFilterLogic.AND,
|
|
10056
|
+
filters: this.newCreatedCards().map(card => ({
|
|
10057
|
+
field: 'id',
|
|
10058
|
+
operator: KitFilterOperator.NEQ,
|
|
10059
|
+
value: card.id,
|
|
10060
|
+
})),
|
|
10061
|
+
} : {};
|
|
10062
|
+
}, ...(ngDevMode ? [{ debugName: "skipNewCreatedCardFilter" }] : []));
|
|
10047
10063
|
this.shouldAppendFetchedData = true;
|
|
10048
10064
|
}
|
|
10049
10065
|
ngOnInit() {
|
|
@@ -10055,16 +10071,6 @@ class KitCardDetailsComponent {
|
|
|
10055
10071
|
this.initSearchSubscription();
|
|
10056
10072
|
this.initStateFromUrl();
|
|
10057
10073
|
}
|
|
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
10074
|
loadMoreData() {
|
|
10069
10075
|
this.shouldAppendFetchedData = true;
|
|
10070
10076
|
this.dataState.update(state => ({
|
|
@@ -10074,54 +10080,50 @@ class KitCardDetailsComponent {
|
|
|
10074
10080
|
}));
|
|
10075
10081
|
this.updateData();
|
|
10076
10082
|
}
|
|
10077
|
-
onCardClick(
|
|
10078
|
-
|
|
10079
|
-
this.
|
|
10080
|
-
this.
|
|
10083
|
+
onCardClick(card) {
|
|
10084
|
+
const normalizedId = this.normalizeCardId(card.id);
|
|
10085
|
+
this.dataState.update(state => ({ ...state, activeId: normalizedId }));
|
|
10086
|
+
this.navigateToCard(normalizedId);
|
|
10087
|
+
this.cardClicked.emit({ ...card, id: normalizedId });
|
|
10081
10088
|
}
|
|
10082
|
-
|
|
10089
|
+
appendCard(card, navigateToCard = true) {
|
|
10083
10090
|
this.cardData.set([
|
|
10084
10091
|
...this.cardData(),
|
|
10085
|
-
|
|
10092
|
+
card,
|
|
10086
10093
|
]);
|
|
10087
10094
|
this.newCreatedCards.set([
|
|
10088
10095
|
...this.newCreatedCards(),
|
|
10089
|
-
|
|
10096
|
+
card,
|
|
10090
10097
|
]);
|
|
10091
10098
|
this.dataState.update(state => ({
|
|
10092
10099
|
...state,
|
|
10093
|
-
filters: this.skipNewCreatedCardFilter,
|
|
10100
|
+
filters: this.skipNewCreatedCardFilter(),
|
|
10094
10101
|
}));
|
|
10095
|
-
this.total.set(this.total() +
|
|
10102
|
+
this.total.set(this.total() + 1);
|
|
10103
|
+
if (navigateToCard) {
|
|
10104
|
+
this.onCardClick(card);
|
|
10105
|
+
}
|
|
10096
10106
|
}
|
|
10097
10107
|
deleteCard(cardId) {
|
|
10098
10108
|
this.isLoading.set(true);
|
|
10099
|
-
|
|
10109
|
+
const normalizedId = this.normalizeCardId(cardId);
|
|
10110
|
+
this.cardData.set(this.cardData().filter(card => this.normalizeCardId(card.id) !== normalizedId));
|
|
10100
10111
|
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
|
-
}));
|
|
10112
|
+
if (this.newCreatedCards().some(card => this.normalizeCardId(card.id) === normalizedId)) {
|
|
10113
|
+
this.removeFromNewCreatedCards(normalizedId);
|
|
10108
10114
|
this.isLoading.set(false);
|
|
10109
10115
|
return;
|
|
10110
10116
|
}
|
|
10117
|
+
const loadedCards = (this.dataState().take ?? this.pageSize()) + (this.dataState().skip ?? 0) - 1;
|
|
10111
10118
|
if (loadedCards >= this.total()) {
|
|
10112
10119
|
this.isLoading.set(false);
|
|
10113
10120
|
return;
|
|
10114
10121
|
}
|
|
10115
10122
|
this.shouldAppendFetchedData = true;
|
|
10116
|
-
this.dataStateChanged.emit({ skip: loadedCards, take: 1, filters: this.skipNewCreatedCardFilter, search: this.dataState().search });
|
|
10123
|
+
this.dataStateChanged.emit({ skip: loadedCards, take: 1, filters: this.skipNewCreatedCardFilter(), search: this.dataState().search });
|
|
10117
10124
|
}
|
|
10118
10125
|
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
|
-
}));
|
|
10126
|
+
this.cardData.set(this.cardData().map(card => this.normalizeCardId(card.id) === this.normalizeCardId(cardData.id) ? cardData : card));
|
|
10125
10127
|
}
|
|
10126
10128
|
scrollToCardById(id) {
|
|
10127
10129
|
const cardsEl = this.host.nativeElement.querySelector('.kit-card-details .cards');
|
|
@@ -10159,7 +10161,7 @@ class KitCardDetailsComponent {
|
|
|
10159
10161
|
this.updateData();
|
|
10160
10162
|
}
|
|
10161
10163
|
initCardDataSubscription() {
|
|
10162
|
-
|
|
10164
|
+
this.getStateFromUrl();
|
|
10163
10165
|
this.cardData$().pipe(takeUntilDestroyed(this.destroyRef), filter(({ loading }) => !loading)).subscribe(data => {
|
|
10164
10166
|
if (this.shouldAppendFetchedData) {
|
|
10165
10167
|
this.cardData.set([
|
|
@@ -10169,44 +10171,38 @@ class KitCardDetailsComponent {
|
|
|
10169
10171
|
this.total.set(data.results.total + this.newCreatedCards().length);
|
|
10170
10172
|
this.shouldAppendFetchedData = false;
|
|
10171
10173
|
}
|
|
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
10174
|
this.isLoading.set(false);
|
|
10190
10175
|
});
|
|
10191
10176
|
}
|
|
10192
10177
|
updateData() {
|
|
10193
10178
|
this.isLoading.set(true);
|
|
10194
|
-
this.
|
|
10179
|
+
this.setQueryParamsToUrl(this.dataState());
|
|
10195
10180
|
this.dataStateChanged.emit(this.dataState());
|
|
10196
10181
|
}
|
|
10182
|
+
normalizeCardId(id) {
|
|
10183
|
+
return id.toString();
|
|
10184
|
+
}
|
|
10185
|
+
removeFromNewCreatedCards(cardId) {
|
|
10186
|
+
this.newCreatedCards.set(this.newCreatedCards().filter(card => this.normalizeCardId(card.id) !== cardId));
|
|
10187
|
+
this.dataState.update(state => ({
|
|
10188
|
+
...state,
|
|
10189
|
+
filters: this.skipNewCreatedCardFilter(),
|
|
10190
|
+
}));
|
|
10191
|
+
}
|
|
10197
10192
|
getStateFromUrl() {
|
|
10198
|
-
const
|
|
10193
|
+
const queryParams = this.activatedRoute.snapshot.queryParams;
|
|
10194
|
+
const routeParams = this.activatedRoute.snapshot.firstChild?.params ?? this.activatedRoute.snapshot.params;
|
|
10199
10195
|
return {
|
|
10200
|
-
skip:
|
|
10201
|
-
take:
|
|
10202
|
-
search:
|
|
10203
|
-
activeId:
|
|
10196
|
+
skip: queryParams?.skip && Number(queryParams.skip),
|
|
10197
|
+
take: queryParams?.take && Number(queryParams.take),
|
|
10198
|
+
search: queryParams?.search && String(queryParams.search),
|
|
10199
|
+
activeId: routeParams?.id && String(routeParams.id),
|
|
10204
10200
|
};
|
|
10205
10201
|
}
|
|
10206
|
-
|
|
10202
|
+
setQueryParamsToUrl(state) {
|
|
10207
10203
|
const queryParams = Object.keys(state).reduce((acc, key) => {
|
|
10208
10204
|
const val = state[key];
|
|
10209
|
-
if (val !== undefined && key !== 'filters') {
|
|
10205
|
+
if (val !== undefined && key !== 'filters' && key !== 'activeId') {
|
|
10210
10206
|
acc[key] = val;
|
|
10211
10207
|
}
|
|
10212
10208
|
return acc;
|
|
@@ -10214,11 +10210,17 @@ class KitCardDetailsComponent {
|
|
|
10214
10210
|
this.router.navigate([], {
|
|
10215
10211
|
relativeTo: this.activatedRoute,
|
|
10216
10212
|
queryParams,
|
|
10217
|
-
queryParamsHandling: '
|
|
10213
|
+
queryParamsHandling: 'merge',
|
|
10214
|
+
});
|
|
10215
|
+
}
|
|
10216
|
+
navigateToCard(id) {
|
|
10217
|
+
this.router.navigate([id], {
|
|
10218
|
+
relativeTo: this.activatedRoute,
|
|
10219
|
+
queryParamsHandling: 'preserve',
|
|
10218
10220
|
});
|
|
10219
10221
|
}
|
|
10220
10222
|
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
|
|
10223
|
+
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
10224
|
}
|
|
10223
10225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: KitCardDetailsComponent, decorators: [{
|
|
10224
10226
|
type: Component,
|
|
@@ -10231,8 +10233,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
10231
10233
|
KitTextboxComponent,
|
|
10232
10234
|
NgTemplateOutlet,
|
|
10233
10235
|
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 }] }] } });
|
|
10236
|
+
], 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"] }]
|
|
10237
|
+
}], 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
10238
|
|
|
10237
10239
|
class KitListComponent {
|
|
10238
10240
|
constructor() {
|