@indigina/ui-kit 1.1.506 → 1.1.507
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 +128 -149
- package/fesm2022/indigina-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/indigina-ui-kit.d.ts +12 -12
|
@@ -7688,192 +7688,187 @@ class KitCardDetailsComponent {
|
|
|
7688
7688
|
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
7689
7689
|
this.cardData = signal([], ...(ngDevMode ? [{ debugName: "cardData" }] : /* istanbul ignore next */ []));
|
|
7690
7690
|
this.total = signal(0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
7691
|
-
this.dataState = signal({
|
|
7692
|
-
skip: 0,
|
|
7693
|
-
take: 0,
|
|
7694
|
-
}, ...(ngDevMode ? [{ debugName: "dataState" }] : /* istanbul ignore next */ []));
|
|
7691
|
+
this.dataState = signal({ skip: 0, take: 0 }, ...(ngDevMode ? [{ debugName: "dataState" }] : /* istanbul ignore next */ []));
|
|
7695
7692
|
this.newCreatedCards = signal([], ...(ngDevMode ? [{ debugName: "newCreatedCards" }] : /* istanbul ignore next */ []));
|
|
7696
|
-
this.
|
|
7697
|
-
|
|
7693
|
+
this.showDetails = signal(false, ...(ngDevMode ? [{ debugName: "showDetails" }] : /* istanbul ignore next */ []));
|
|
7694
|
+
this.skipNewCreatedCardFilter = computed(() => this.newCreatedCards().length
|
|
7695
|
+
? {
|
|
7698
7696
|
logic: KitFilterLogic.AND,
|
|
7699
7697
|
filters: this.newCreatedCards().map(card => ({
|
|
7700
7698
|
field: 'id',
|
|
7701
7699
|
operator: KitFilterOperator.NEQ,
|
|
7702
7700
|
value: card.id,
|
|
7703
7701
|
})),
|
|
7704
|
-
}
|
|
7705
|
-
|
|
7706
|
-
this.
|
|
7707
|
-
this.showDetails = false;
|
|
7702
|
+
}
|
|
7703
|
+
: {}, ...(ngDevMode ? [{ debugName: "skipNewCreatedCardFilter" }] : /* istanbul ignore next */ []));
|
|
7704
|
+
this.shouldProcessNextData = false;
|
|
7708
7705
|
}
|
|
7709
7706
|
ngOnInit() {
|
|
7710
|
-
this.dataState.update(state => ({
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
this.
|
|
7715
|
-
this.initSearchSubscription();
|
|
7716
|
-
this.initStateFromUrl();
|
|
7707
|
+
this.dataState.update(state => ({ ...state, take: this.pageSize() }));
|
|
7708
|
+
this.initRouteListener();
|
|
7709
|
+
this.initDataListener();
|
|
7710
|
+
this.initSearchListener();
|
|
7711
|
+
this.restoreStateFromUrl();
|
|
7717
7712
|
}
|
|
7718
7713
|
loadMoreData() {
|
|
7719
|
-
this.
|
|
7720
|
-
this.
|
|
7721
|
-
...state,
|
|
7722
|
-
skip: (this.dataState()?.skip ?? 0) + this.pageSize(),
|
|
7723
|
-
take: this.pageSize(),
|
|
7724
|
-
}));
|
|
7725
|
-
this.updateData();
|
|
7714
|
+
this.dataState.update(state => ({ ...state, skip: (state.skip ?? 0) + this.pageSize(), take: this.pageSize() }));
|
|
7715
|
+
this.fetchData();
|
|
7726
7716
|
}
|
|
7727
7717
|
onCardClick(card) {
|
|
7728
|
-
|
|
7729
|
-
this.dataState.update(state => ({ ...state, activeId: normalizedId }));
|
|
7730
|
-
this.navigateToCard(normalizedId);
|
|
7731
|
-
this.cardClicked.emit({ ...card, id: normalizedId });
|
|
7718
|
+
this.selectCard(card, true);
|
|
7732
7719
|
}
|
|
7733
7720
|
appendCard(card, navigateToCard = true) {
|
|
7734
|
-
this.cardData.
|
|
7735
|
-
...
|
|
7721
|
+
this.cardData.update(cards => [
|
|
7722
|
+
...cards,
|
|
7736
7723
|
card,
|
|
7737
7724
|
]);
|
|
7738
|
-
this.newCreatedCards.
|
|
7739
|
-
...
|
|
7725
|
+
this.newCreatedCards.update(cards => [
|
|
7726
|
+
...cards,
|
|
7740
7727
|
card,
|
|
7741
7728
|
]);
|
|
7742
|
-
this.dataState.update(state => ({
|
|
7743
|
-
|
|
7744
|
-
filters: this.skipNewCreatedCardFilter(),
|
|
7745
|
-
}));
|
|
7746
|
-
this.total.set(this.total() + 1);
|
|
7729
|
+
this.dataState.update(state => ({ ...state, filters: this.skipNewCreatedCardFilter() }));
|
|
7730
|
+
this.total.update(total => total + 1);
|
|
7747
7731
|
if (navigateToCard) {
|
|
7748
|
-
this.
|
|
7749
|
-
this.showDetails = true;
|
|
7732
|
+
this.selectCard(card, true);
|
|
7750
7733
|
}
|
|
7751
7734
|
}
|
|
7752
7735
|
deleteCard(cardId) {
|
|
7753
7736
|
this.isLoading.set(true);
|
|
7754
|
-
const
|
|
7755
|
-
const deletedIndex = this.cardData().findIndex(card =>
|
|
7756
|
-
this.cardData.
|
|
7757
|
-
this.total.
|
|
7758
|
-
const
|
|
7759
|
-
const nextCard = remainingCards.length ? remainingCards[deletedIndex] ?? remainingCards[deletedIndex - 1] : null;
|
|
7737
|
+
const id = String(cardId);
|
|
7738
|
+
const deletedIndex = this.cardData().findIndex(card => String(card.id) === id);
|
|
7739
|
+
this.cardData.update(cards => cards.filter(card => String(card.id) !== id));
|
|
7740
|
+
this.total.update(total => total - 1);
|
|
7741
|
+
const next = this.cardData()[deletedIndex] ?? this.cardData()[deletedIndex - 1] ?? null;
|
|
7760
7742
|
if (!this.cardData().length) {
|
|
7761
|
-
this.showDetails
|
|
7743
|
+
this.showDetails.set(false);
|
|
7762
7744
|
}
|
|
7763
|
-
if (this.newCreatedCards().some(card =>
|
|
7764
|
-
this.
|
|
7745
|
+
if (this.newCreatedCards().some(card => String(card.id) === id)) {
|
|
7746
|
+
this.newCreatedCards.update(cards => cards.filter(card => String(card.id) !== id));
|
|
7747
|
+
this.dataState.update(state => ({ ...state, filters: this.skipNewCreatedCardFilter() }));
|
|
7765
7748
|
this.isLoading.set(false);
|
|
7766
|
-
if (
|
|
7767
|
-
this.
|
|
7749
|
+
if (next) {
|
|
7750
|
+
this.selectCard(next, true);
|
|
7768
7751
|
}
|
|
7769
7752
|
return;
|
|
7770
7753
|
}
|
|
7771
|
-
const
|
|
7772
|
-
if (
|
|
7754
|
+
const loadedCount = (this.dataState().take ?? this.pageSize()) + (this.dataState().skip ?? 0) - 1;
|
|
7755
|
+
if (loadedCount >= this.total()) {
|
|
7773
7756
|
this.isLoading.set(false);
|
|
7774
|
-
if (
|
|
7775
|
-
this.
|
|
7757
|
+
if (next) {
|
|
7758
|
+
this.selectCard(next, true);
|
|
7776
7759
|
}
|
|
7777
7760
|
return;
|
|
7778
7761
|
}
|
|
7779
|
-
this.showDetails
|
|
7780
|
-
this.
|
|
7762
|
+
this.showDetails.set(false);
|
|
7763
|
+
this.shouldProcessNextData = true;
|
|
7764
|
+
this.navigateToParent();
|
|
7781
7765
|
this.dataStateChanged.emit({
|
|
7782
|
-
skip:
|
|
7766
|
+
skip: loadedCount,
|
|
7783
7767
|
take: 1,
|
|
7784
7768
|
filters: this.skipNewCreatedCardFilter(),
|
|
7785
7769
|
search: this.dataState().search,
|
|
7786
7770
|
});
|
|
7787
7771
|
}
|
|
7788
7772
|
updateSpecificCardData(cardData) {
|
|
7789
|
-
this.cardData.
|
|
7773
|
+
this.cardData.update(cards => cards.map(card => String(card.id) === String(cardData.id) ? cardData : card));
|
|
7790
7774
|
}
|
|
7791
7775
|
scrollToCardById(id) {
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7776
|
+
this.host.nativeElement
|
|
7777
|
+
.querySelector('.kit-card-details .cards')
|
|
7778
|
+
?.querySelector(`[data-card-id="${id}"]`)
|
|
7779
|
+
?.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' });
|
|
7780
|
+
}
|
|
7781
|
+
initDataListener() {
|
|
7782
|
+
this.cardData$().pipe(filter(({ loading }) => !loading), takeUntilDestroyed(this.destroyRef)).subscribe(({ results }) => {
|
|
7783
|
+
if (!this.shouldProcessNextData) {
|
|
7784
|
+
return;
|
|
7785
|
+
}
|
|
7786
|
+
this.shouldProcessNextData = false;
|
|
7787
|
+
this.cardData.update(cards => [
|
|
7788
|
+
...cards,
|
|
7789
|
+
...results.data,
|
|
7790
|
+
]);
|
|
7791
|
+
this.total.set(results.total + this.newCreatedCards().length);
|
|
7792
|
+
this.isLoading.set(false);
|
|
7793
|
+
const activeId = this.getActiveIdFromRoute();
|
|
7794
|
+
if (!this.selectCardByRouteId(activeId) && !this.showDetails() && results.data.length) {
|
|
7795
|
+
this.selectCard(results.data[0], true);
|
|
7796
|
+
requestAnimationFrame(() => this.scrollToCardById(String(results.data[0].id)));
|
|
7797
|
+
}
|
|
7798
|
+
});
|
|
7799
|
+
}
|
|
7800
|
+
initRouteListener() {
|
|
7801
|
+
this.router.events.pipe(filter((event) => event instanceof NavigationEnd), startWith(null), map(() => this.getActiveIdFromRoute()), distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)).subscribe(activeId => this.selectCardByRouteId(activeId));
|
|
7795
7802
|
}
|
|
7796
|
-
|
|
7797
|
-
outputToObservable(this.kitTextboxComponent().changed).pipe(debounceTime(500),
|
|
7803
|
+
initSearchListener() {
|
|
7804
|
+
outputToObservable(this.kitTextboxComponent().changed).pipe(debounceTime(500), map(value => value.trim()), takeUntilDestroyed(this.destroyRef)).subscribe(search => {
|
|
7798
7805
|
this.cardData.set([]);
|
|
7799
7806
|
this.newCreatedCards.set([]);
|
|
7800
|
-
this.
|
|
7801
|
-
this.
|
|
7802
|
-
this.
|
|
7803
|
-
this.updateData();
|
|
7807
|
+
this.showDetails.set(false);
|
|
7808
|
+
this.dataState.set({ skip: 0, take: this.pageSize(), search: search || undefined });
|
|
7809
|
+
this.fetchData();
|
|
7804
7810
|
});
|
|
7805
7811
|
}
|
|
7806
|
-
|
|
7807
|
-
const
|
|
7812
|
+
restoreStateFromUrl() {
|
|
7813
|
+
const params = this.router.routerState.snapshot.root.queryParams;
|
|
7814
|
+
const skip = params.skip ? Number(params.skip) : 0;
|
|
7815
|
+
const search = params.search ? String(params.search) : undefined;
|
|
7808
7816
|
if (search) {
|
|
7809
7817
|
this.kitTextboxComponent().writeValue(search);
|
|
7810
|
-
if (skip && skip > 0) {
|
|
7811
|
-
this.dataStateChanged.emit({ skip: 0, take: skip + this.pageSize(), search });
|
|
7812
|
-
this.dataState.set({ skip, take: this.pageSize(), search });
|
|
7813
|
-
}
|
|
7814
|
-
else {
|
|
7815
|
-
this.isLoading.set(false);
|
|
7816
|
-
this.kitTextboxComponent().changed.emit(search);
|
|
7817
|
-
}
|
|
7818
|
-
return;
|
|
7819
7818
|
}
|
|
7820
|
-
if (skip
|
|
7821
|
-
this.
|
|
7822
|
-
this.
|
|
7819
|
+
if (skip > 0 || search) {
|
|
7820
|
+
this.dataState.set({ skip, take: this.pageSize(), search });
|
|
7821
|
+
this.fetchData({ skip: 0, take: skip + this.pageSize(), search }, false);
|
|
7823
7822
|
return;
|
|
7824
7823
|
}
|
|
7825
|
-
this.
|
|
7826
|
-
}
|
|
7827
|
-
initCardDataSubscription() {
|
|
7828
|
-
const { activeId } = this.getStateFromUrl();
|
|
7829
|
-
this.cardData$().pipe(takeUntilDestroyed(this.destroyRef), filter(({ loading }) => !loading)).subscribe(data => {
|
|
7830
|
-
if (this.shouldAppendFetchedData) {
|
|
7831
|
-
this.cardData.set([
|
|
7832
|
-
...this.cardData(),
|
|
7833
|
-
...data.results.data,
|
|
7834
|
-
]);
|
|
7835
|
-
this.total.set(data.results.total + this.newCreatedCards().length);
|
|
7836
|
-
this.shouldAppendFetchedData = false;
|
|
7837
|
-
if (activeId && !this.dataState().activeId) {
|
|
7838
|
-
const activeCard = this.cardData().find(item => this.normalizeCardId(item.id) === activeId);
|
|
7839
|
-
if (activeCard) {
|
|
7840
|
-
this.selectNewLoadedCard(activeCard);
|
|
7841
|
-
return;
|
|
7842
|
-
}
|
|
7843
|
-
}
|
|
7844
|
-
if (!this.showDetails && data.results.data.length) {
|
|
7845
|
-
this.selectNewLoadedCard(data.results.data[0]);
|
|
7846
|
-
}
|
|
7847
|
-
}
|
|
7848
|
-
this.isLoading.set(false);
|
|
7849
|
-
});
|
|
7824
|
+
this.fetchData();
|
|
7850
7825
|
}
|
|
7851
|
-
|
|
7826
|
+
fetchData(emitState, writeToUrl = true) {
|
|
7852
7827
|
this.isLoading.set(true);
|
|
7853
|
-
this.
|
|
7854
|
-
|
|
7828
|
+
this.shouldProcessNextData = true;
|
|
7829
|
+
if (writeToUrl) {
|
|
7830
|
+
this.writeQueryParamsToUrl(this.dataState());
|
|
7831
|
+
}
|
|
7832
|
+
this.dataStateChanged.emit(emitState ?? this.dataState());
|
|
7855
7833
|
}
|
|
7856
|
-
|
|
7857
|
-
|
|
7834
|
+
selectCard(card, navigate) {
|
|
7835
|
+
const id = String(card.id);
|
|
7836
|
+
this.isLoading.set(false);
|
|
7837
|
+
this.showDetails.set(true);
|
|
7838
|
+
this.dataState.update(state => ({ ...state, activeId: id }));
|
|
7839
|
+
if (navigate) {
|
|
7840
|
+
this.router.navigate([id], { relativeTo: this.activatedRoute, queryParamsHandling: 'preserve' });
|
|
7841
|
+
}
|
|
7842
|
+
this.cardClicked.emit({ ...card, id });
|
|
7858
7843
|
}
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7844
|
+
selectCardByRouteId(activeId) {
|
|
7845
|
+
if (!activeId) {
|
|
7846
|
+
return false;
|
|
7847
|
+
}
|
|
7848
|
+
if (this.dataState().activeId === activeId) {
|
|
7849
|
+
this.showDetails.set(true);
|
|
7850
|
+
return true;
|
|
7851
|
+
}
|
|
7852
|
+
const card = this.cardData().find(card => String(card.id) === activeId);
|
|
7853
|
+
if (!card) {
|
|
7854
|
+
return false;
|
|
7855
|
+
}
|
|
7856
|
+
this.selectCard(card, false);
|
|
7857
|
+
requestAnimationFrame(() => this.scrollToCardById(activeId));
|
|
7858
|
+
return true;
|
|
7865
7859
|
}
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
}
|
|
7860
|
+
getActiveIdFromRoute() {
|
|
7861
|
+
let snapshot = this.activatedRoute.snapshot;
|
|
7862
|
+
let activeId;
|
|
7863
|
+
while (snapshot) {
|
|
7864
|
+
if (snapshot.params.id !== undefined) {
|
|
7865
|
+
activeId = String(snapshot.params.id);
|
|
7866
|
+
}
|
|
7867
|
+
snapshot = snapshot.firstChild;
|
|
7868
|
+
}
|
|
7869
|
+
return activeId;
|
|
7875
7870
|
}
|
|
7876
|
-
|
|
7871
|
+
writeQueryParamsToUrl(state) {
|
|
7877
7872
|
const queryParams = Object.keys(state).reduce((acc, key) => {
|
|
7878
7873
|
const val = state[key];
|
|
7879
7874
|
if (val !== undefined && val !== '' && key !== 'filters' && key !== 'activeId') {
|
|
@@ -7881,41 +7876,25 @@ class KitCardDetailsComponent {
|
|
|
7881
7876
|
}
|
|
7882
7877
|
return acc;
|
|
7883
7878
|
}, {});
|
|
7884
|
-
this.router.navigate([], {
|
|
7885
|
-
relativeTo: this.activatedRoute,
|
|
7886
|
-
queryParams,
|
|
7887
|
-
queryParamsHandling: 'replace',
|
|
7888
|
-
});
|
|
7889
|
-
}
|
|
7890
|
-
navigateToCard(id) {
|
|
7891
|
-
this.router.navigate([id], {
|
|
7892
|
-
relativeTo: this.activatedRoute,
|
|
7893
|
-
queryParamsHandling: 'preserve',
|
|
7894
|
-
});
|
|
7879
|
+
this.router.navigate([], { relativeTo: this.activatedRoute, queryParams, queryParamsHandling: 'replace' });
|
|
7895
7880
|
}
|
|
7896
|
-
|
|
7897
|
-
this.
|
|
7898
|
-
this.showDetails = true;
|
|
7899
|
-
this.onCardClick(card);
|
|
7900
|
-
requestAnimationFrame(() => {
|
|
7901
|
-
this.scrollToCardById(card.id.toString());
|
|
7902
|
-
});
|
|
7881
|
+
navigateToParent() {
|
|
7882
|
+
this.router.navigate(['./'], { relativeTo: this.activatedRoute, queryParamsHandling: 'preserve' });
|
|
7903
7883
|
}
|
|
7904
7884
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitCardDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7905
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", 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 }, cardSkeletonConfig: { classPropertyName: "cardSkeletonConfig", publicName: "cardSkeletonConfig", isSignal: true, isRequired: false, 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 [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (
|
|
7885
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", 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 }, cardSkeletonConfig: { classPropertyName: "cardSkeletonConfig", publicName: "cardSkeletonConfig", isSignal: true, isRequired: false, 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 [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (isLoading() && cardData().length === 0) {\n @if (cardSkeletonConfig(); as config) {\n @for (_ of [].constructor(config.itemsCount); track $index) {\n <kit-skeleton [width]=\"'100%'\"\n [height]=\"config.itemHeight\" />\n }\n }\n } @else if (cardData().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 (cardData().length && (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 </div>\n </div>\n\n @if (showDetails()) {\n <div class=\"details\">\n <ng-container *ngTemplateOutlet=\"details(); context: { $implicit: dataState().activeId }\" />\n </div>\n }\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 .k-svg-i-x.k-svg-icon{background-image:none}.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: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitEntityTitleComponent, selector: "kit-entity-title" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7906
7886
|
}
|
|
7907
7887
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitCardDetailsComponent, decorators: [{
|
|
7908
7888
|
type: Component,
|
|
7909
7889
|
args: [{ selector: 'kit-card-details', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
7910
|
-
|
|
7890
|
+
NgTemplateOutlet,
|
|
7911
7891
|
KitSkeletonComponent,
|
|
7912
7892
|
KitEmptySectionComponent,
|
|
7913
7893
|
KitButtonComponent,
|
|
7914
7894
|
TranslatePipe,
|
|
7915
7895
|
KitTextboxComponent,
|
|
7916
|
-
NgTemplateOutlet,
|
|
7917
7896
|
KitEntityTitleComponent,
|
|
7918
|
-
], 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 [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (
|
|
7897
|
+
], 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 [clearButton]=\"true\"\n [showStateIcon]=\"false\" />\n </div>\n\n <div class=\"cards\">\n @if (isLoading() && cardData().length === 0) {\n @if (cardSkeletonConfig(); as config) {\n @for (_ of [].constructor(config.itemsCount); track $index) {\n <kit-skeleton [width]=\"'100%'\"\n [height]=\"config.itemHeight\" />\n }\n }\n } @else if (cardData().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 (cardData().length && (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 </div>\n </div>\n\n @if (showDetails()) {\n <div class=\"details\">\n <ng-container *ngTemplateOutlet=\"details(); context: { $implicit: dataState().activeId }\" />\n </div>\n }\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 .k-svg-i-x.k-svg-icon{background-image:none}.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"] }]
|
|
7919
7898
|
}], 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 }] }], cardSkeletonConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardSkeletonConfig", required: false }] }], 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 }] }] } });
|
|
7920
7899
|
|
|
7921
7900
|
class KitAbstractPayloadAction {
|