@uxland/primary-shell 7.16.0 → 7.17.0
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/dist/{component-D9lohRLm.js → component-D450DMlk.js} +2 -2
- package/dist/{component-D9lohRLm.js.map → component-D450DMlk.js.map} +1 -1
- package/dist/{index-CEAb6DC3.js → index-hZAiHLDu.js} +79 -52
- package/dist/index-hZAiHLDu.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/index-CEAb6DC3.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as d, k as l, P as p, h as g, r as m, i as v, s as h, a as f, b as u } from "./index-
|
|
1
|
+
import { t as d, k as l, P as p, h as g, r as m, i as v, s as h, a as f, b as u } from "./index-hZAiHLDu.js";
|
|
2
2
|
const x = ".container{background-color:#fff;display:flex;flex-direction:column;min-width:500px;width:90vw;height:90vh;border-radius:var(--dss-radius-sm);overflow:hidden}.content{display:grid;height:100%;min-height:1px;grid-template-columns:1fr 1fr;grid-auto-rows:1fr;gap:16px;padding:16px;overflow-y:auto;max-height:calc(90vh - 120px)}.content>*{border:1px solid var(--color-neutral-200);border-radius:8px;padding:16px;background-color:var(--color-neutral-50);min-height:200px}.footer{display:flex;flex-direction:row;align-items:center;background:#fff;justify-content:end;gap:12px;height:56px;border-top:1px solid var(--color-neutral-100);padding:var(--dss-spacing-sm)}", b = (r) => l`
|
|
3
3
|
<div class="container">
|
|
4
4
|
<!-- <div class="header">
|
|
@@ -44,4 +44,4 @@ i = c([
|
|
|
44
44
|
export {
|
|
45
45
|
i as ImportDataManagerModal
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=component-
|
|
47
|
+
//# sourceMappingURL=component-D450DMlk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-
|
|
1
|
+
{"version":3,"file":"component-D450DMlk.js","sources":["../src/api/import-data-manager/component/template.ts","../src/api/import-data-manager/component/component.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { translate } from \"../../../locales\";\nimport { ImportDataManagerModal } from \"./component\";\n\nexport const template = (props: ImportDataManagerModal) => {\n return html`\n <div class=\"container\">\n <!-- <div class=\"header\">\n <div class=\"title\">\n <div>${translate(\"importDataManager.title\")}</div>\n </div> \n </div> -->\n <div class=\"content\" id=\"import-data-region\"></div>\n <div class=\"footer\">\n <dss-button label=\"${translate(\"importDataManager.actions.cancel\")}\" @click=\"${() => {\n props.cancel();\n }}\" size=\"md\" variant=\"secondary\"></dss-button>\n <dss-button label=\"${translate(\"importDataManager.actions.import\")}\" @click=\"${() => {\n props._accept();\n }}\" size=\"md\" variant=\"primary\"></dss-button>\n </div>\n </div>\n `;\n};\n","import { IRegion, region } from \"@uxland/regions\";\nimport { LitElement, css, html, unsafeCSS } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport styles from \"./styles.css?inline\";\nimport { template } from \"./template\";\nimport { ConfirmationContentProps } from \"../../interaction-service\";\nimport { PrimariaRegionHost, shellApi } from \"../../api\";\n\n@customElement(\"import-data-manager-modal\")\nexport class ImportDataManagerModal\n extends PrimariaRegionHost(LitElement)\n implements ConfirmationContentProps<undefined, undefined>\n{\n data: undefined;\n setResult: (result: undefined) => void;\n setIsValid: (isValid: boolean) => void;\n confirm: () => void;\n cancel: () => void;\n\n @region({ targetId: \"import-data-region\", name: shellApi.regionManager.regions.shell.importData })\n importDataRegion: IRegion | undefined;\n\n render() {\n return html`${template(this)}`;\n }\n\n static styles = css`\n ${unsafeCSS(styles)}\n `;\n\n _accept = () => {\n this.confirm();\n };\n}\n"],"names":["template","props","html","translate","ImportDataManagerModal","PrimariaRegionHost","LitElement","css","unsafeCSS","styles","__decorateClass","region","shellApi","customElement"],"mappings":";gqBAIaA,IAAW,CAACC,MAChBC;AAAAA;AAAAA;AAAAA;AAAAA,iBAIQC,EAAU,yBAAyB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,yBAK5BA,EAAU,kCAAkC,CAAC,aAAa,MAAM;AACjF,EAAAF,EAAM,OAAA;AACR,CAAC;AAAA,2BACoBE,EAAU,kCAAkC,CAAC,aAAa,MAAM;AACnF,EAAAF,EAAM,QAAA;AACR,CAAC;AAAA;AAAA;AAAA;;;;;;ACVA,IAAMG,IAAN,cACGC,EAAmBC,CAAU,EAEvC;AAAA,EAHO,cAAA;AAAA,UAAA,GAAA,SAAA,GAqBL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AAxBaI,EAiBJ,SAASG;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAPrBC,EAAA;AAAA,EADCC,EAAO,EAAE,UAAU,sBAAsB,MAAMC,EAAS,cAAc,QAAQ,MAAM,WAAA,CAAY;AAAA,GAVtFR,EAWX,WAAA,oBAAA,CAAA;AAXWA,IAANM,EAAA;AAAA,EADNG,EAAc,2BAA2B;AAAA,GAC7BT,CAAA;"}
|
|
@@ -9751,7 +9751,7 @@ class ImportDataManagerImpl {
|
|
|
9751
9751
|
async import(J) {
|
|
9752
9752
|
this.currentImporterId = J, this.selectedItems = {}, this.pluginTexts = {};
|
|
9753
9753
|
try {
|
|
9754
|
-
const { ImportDataManagerModal: X } = await import("./component-
|
|
9754
|
+
const { ImportDataManagerModal: X } = await import("./component-D450DMlk.js"), { confirmed: re } = await this.interactionService.confirm(
|
|
9755
9755
|
void 0,
|
|
9756
9756
|
{ component: X },
|
|
9757
9757
|
{
|
|
@@ -11402,49 +11402,6 @@ isValidDateString(te.date), ensureAreValidBasicActivityHistoryItems = (te) => {
|
|
|
11402
11402
|
const X = getUpFilter(te);
|
|
11403
11403
|
X && J.dispatch(activityHistoryFiltersSlice.actions.addUpFilters(X));
|
|
11404
11404
|
}, { addActivityHistoryItem } = activityHistoryCollectionsSlice.actions;
|
|
11405
|
-
class AddHistoryItemHandler extends StoreBaseHandler {
|
|
11406
|
-
async handle(J) {
|
|
11407
|
-
try {
|
|
11408
|
-
ensureAreValidBasicActivityHistoryItems([J.item]), handleAddDiagnosticsFilter([J.item], this.store), handleAddUpFilter([J.item], this.store), this.store.dispatch(
|
|
11409
|
-
addActivityHistoryItem({
|
|
11410
|
-
id: J.entityId,
|
|
11411
|
-
item: J.item
|
|
11412
|
-
})
|
|
11413
|
-
);
|
|
11414
|
-
} catch (X) {
|
|
11415
|
-
console.log(X.message);
|
|
11416
|
-
}
|
|
11417
|
-
}
|
|
11418
|
-
}
|
|
11419
|
-
let request$l;
|
|
11420
|
-
const bootstrapAddHistoryItem = (te) => {
|
|
11421
|
-
request$l = te.registerRequest("add_history_item_request", AddHistoryItemHandler);
|
|
11422
|
-
}, teardownAddHistoryItem = () => {
|
|
11423
|
-
request$l?.dispose();
|
|
11424
|
-
}, { addActivityHistoryItems } = activityHistoryCollectionsSlice.actions;
|
|
11425
|
-
class AddHistoryItemsHandler extends StoreBaseHandler {
|
|
11426
|
-
async handle(J) {
|
|
11427
|
-
try {
|
|
11428
|
-
const X = validateAndFilterBasicItems(J.items);
|
|
11429
|
-
handleAddDiagnosticsFilter(X, this.store), handleAddUpFilter(X, this.store), this.store.dispatch(
|
|
11430
|
-
addActivityHistoryItems({
|
|
11431
|
-
id: J.entityId,
|
|
11432
|
-
items: X,
|
|
11433
|
-
componentFactory: J.componentFactory,
|
|
11434
|
-
searchPredicate: J.searchPredicate
|
|
11435
|
-
})
|
|
11436
|
-
);
|
|
11437
|
-
} catch (X) {
|
|
11438
|
-
console.log(X.message);
|
|
11439
|
-
}
|
|
11440
|
-
}
|
|
11441
|
-
}
|
|
11442
|
-
let request$k;
|
|
11443
|
-
const bootstrapAddHistoryItems = (te) => {
|
|
11444
|
-
request$k = te.registerRequest("add_history_items_request", AddHistoryItemsHandler);
|
|
11445
|
-
}, teardownAddHistoryItems = () => {
|
|
11446
|
-
request$k?.dispose();
|
|
11447
|
-
}, styles$j = ".spinner-container{display:flex;flex-direction:row;align-items:center;gap:24px;justify-content:center;padding-top:16px}.skeleton-container{padding:20px;height:100%}";
|
|
11448
11405
|
let pluginLocaleManager;
|
|
11449
11406
|
const initializeLocalization = async (te) => {
|
|
11450
11407
|
pluginLocaleManager = await te.createLocaleManager(locales);
|
|
@@ -11527,11 +11484,80 @@ const initializeLocalization = async (te) => {
|
|
|
11527
11484
|
title: "Error en la càrrega",
|
|
11528
11485
|
viewDetails: "Veure detalls",
|
|
11529
11486
|
imageAlt: "Imatge d'error",
|
|
11530
|
-
errorToRefresh: "Error en l'acció d'actualitzar la pàgina"
|
|
11487
|
+
errorToRefresh: "Error en l'acció d'actualitzar la pàgina",
|
|
11488
|
+
itemAlreadyExists: "Aquest element ja existeix al històric d'activitat",
|
|
11489
|
+
allItemsAlreadyExist: "Tots els elements ja existeixen al històric d'activitat",
|
|
11490
|
+
filterNotInitialized: "No s'han pogut afegir elements ja que aquesta iniciativa no ha sigut inicialitzada a l'Històric d'Activitat."
|
|
11491
|
+
},
|
|
11492
|
+
warning: {
|
|
11493
|
+
someItemsAlreadyExist: "Alguns elements ja existien al històric d'activitat i no s'han afegit"
|
|
11531
11494
|
}
|
|
11532
11495
|
}
|
|
11533
11496
|
}
|
|
11534
|
-
},
|
|
11497
|
+
}, existItemInCollection = (te, J, X) => {
|
|
11498
|
+
const re = te?.[J];
|
|
11499
|
+
return re?.items ? re.items.some((ne) => ne.id === X) : !1;
|
|
11500
|
+
};
|
|
11501
|
+
class AddHistoryItemHandler extends BaseHandler {
|
|
11502
|
+
async handle(J) {
|
|
11503
|
+
try {
|
|
11504
|
+
ensureAreValidBasicActivityHistoryItems([J.item]);
|
|
11505
|
+
const X = this.store.getState(), re = existItemInCollection(X.activityHistoryCollections?.collections, J.entityId, J.item.id), ne = X.activityHistoryFilters?.filters?.find((oe) => oe.id === J.entityId);
|
|
11506
|
+
if (re)
|
|
11507
|
+
throw new Error(translate("error.itemAlreadyExists"));
|
|
11508
|
+
if (!ne)
|
|
11509
|
+
throw new Error(translate("error.filterNotInitialized"));
|
|
11510
|
+
handleAddDiagnosticsFilter([J.item], this.store), handleAddUpFilter([J.item], this.store), this.store.dispatch(
|
|
11511
|
+
addActivityHistoryItem({
|
|
11512
|
+
id: J.entityId,
|
|
11513
|
+
item: J.item,
|
|
11514
|
+
componentFactory: J.componentFactory
|
|
11515
|
+
})
|
|
11516
|
+
);
|
|
11517
|
+
} catch (X) {
|
|
11518
|
+
this.api.notificationService.error(X.message);
|
|
11519
|
+
}
|
|
11520
|
+
}
|
|
11521
|
+
}
|
|
11522
|
+
let request$l;
|
|
11523
|
+
const bootstrapAddHistoryItem = (te) => {
|
|
11524
|
+
request$l = te.registerRequest("add_history_item_request", AddHistoryItemHandler);
|
|
11525
|
+
}, teardownAddHistoryItem = () => {
|
|
11526
|
+
request$l?.dispose();
|
|
11527
|
+
}, { addActivityHistoryItems } = activityHistoryCollectionsSlice.actions;
|
|
11528
|
+
class AddHistoryItemsHandler extends BaseHandler {
|
|
11529
|
+
async handle(J) {
|
|
11530
|
+
try {
|
|
11531
|
+
const X = validateAndFilterBasicItems(J.items), re = this.filterDuplicateItems(X, J.entityId);
|
|
11532
|
+
if (!this.store.getState().activityHistoryFilters?.filters?.find((de) => de.id === J.entityId) && !J.filters)
|
|
11533
|
+
throw new Error(translate("error.filterNotInitialized"));
|
|
11534
|
+
re.length > 0 && (handleAddDiagnosticsFilter(re, this.store), handleAddUpFilter(re, this.store), this.store.dispatch(
|
|
11535
|
+
addActivityHistoryItems({
|
|
11536
|
+
id: J.entityId,
|
|
11537
|
+
items: re,
|
|
11538
|
+
componentFactory: J.componentFactory,
|
|
11539
|
+
searchPredicate: J.searchPredicate
|
|
11540
|
+
})
|
|
11541
|
+
), J.filters && this.api.broker.send(new AddCustomFiltersCommand(J.filters)));
|
|
11542
|
+
} catch (X) {
|
|
11543
|
+
this.api.notificationService.error(X.message);
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
filterDuplicateItems(J, X) {
|
|
11547
|
+
const re = this.store.getState(), ne = J.filter(
|
|
11548
|
+
(oe) => !existItemInCollection(re.activityHistoryCollections?.collections, X, oe.id)
|
|
11549
|
+
);
|
|
11550
|
+
if (ne.length === 0 && J.length > 0)
|
|
11551
|
+
throw new Error(translate("error.allItemsAlreadyExist"));
|
|
11552
|
+
return ne.length < J.length && this.api.notificationService.warning(translate("warning.someItemsAlreadyExist")), ne;
|
|
11553
|
+
}
|
|
11554
|
+
}
|
|
11555
|
+
let request$k;
|
|
11556
|
+
const bootstrapAddHistoryItems = (te) => {
|
|
11557
|
+
request$k = te.registerRequest("add_history_items_request", AddHistoryItemsHandler);
|
|
11558
|
+
}, teardownAddHistoryItems = () => {
|
|
11559
|
+
request$k?.dispose();
|
|
11560
|
+
}, styles$j = ".spinner-container{display:flex;flex-direction:row;align-items:center;gap:24px;justify-content:center;padding-top:16px}.skeleton-container{padding:20px;height:100%}", template$l = (te) => te.isCollectionInitialState ? ke$1`<div class="skeleton-container">${te.skeletons}</div>` : te.isSomeCollectionLoadedAndOtherLoading ? ke$1`<div class="spinner-container"><dss-spinner size="sm"></dss-spinner><div class="busy-description">${translate("busyEntriesLoading")}</div></div>` : D$4;
|
|
11535
11561
|
function connectedProperty(te, J = {}) {
|
|
11536
11562
|
return createConnectedProperty(store)(te, J);
|
|
11537
11563
|
}
|
|
@@ -11884,10 +11910,10 @@ const normalizeStringToNFD = (te) => te == null ? "" : String(te).normalize("NFD
|
|
|
11884
11910
|
const X = normalizeStringToNFD(te), re = normalizeStringToNFD(J);
|
|
11885
11911
|
return X.toString().toLowerCase().indexOf(re) !== -1 || X.toString().indexOf(re) !== -1;
|
|
11886
11912
|
}, commonFieldsSearchPredicate = (te, J) => {
|
|
11887
|
-
const X = te.professional?.name && propContainsString(te.professional?.name, J), re = te.center?.description && propContainsString(te.center.description, J), ne = te.professional?.speciality?.description && propContainsString(te.professional?.speciality.description, J), oe = te.professional?.role?.description && propContainsString(te.professional?.role.description, J), de = te.service?.description && propContainsString(te.service.description, J), ce = te.diagnostics?.some(
|
|
11888
|
-
(
|
|
11913
|
+
const X = te.professional?.name && propContainsString(te.professional?.name, J), re = te.center?.description && propContainsString(te.center.description, J), ne = te.professional?.speciality?.description && propContainsString(te.professional?.speciality.description, J), oe = te.professional?.role?.description && propContainsString(te.professional?.role.description, J), de = te.service?.description && propContainsString(te.service.description, J), ce = te.up?.description && propContainsString(te.up.description, J), ue = te.diagnostics?.some(
|
|
11914
|
+
(he) => propContainsString(he.descripcio, J)
|
|
11889
11915
|
);
|
|
11890
|
-
return X || re || ne || oe || de || ce;
|
|
11916
|
+
return X || re || ne || oe || de || ce || ue;
|
|
11891
11917
|
};
|
|
11892
11918
|
class SearchStringSpec extends Spec {
|
|
11893
11919
|
constructor(J, X) {
|
|
@@ -11913,7 +11939,8 @@ class ComposedTypeSpec extends Spec {
|
|
|
11913
11939
|
super(), this.filters = J;
|
|
11914
11940
|
}
|
|
11915
11941
|
isSatisfiedBy(J) {
|
|
11916
|
-
|
|
11942
|
+
const X = this.filters.filter((ne) => ne.enabled).map((ne) => ne.id);
|
|
11943
|
+
return X.length === 0 ? !0 : X.reduce((ne, oe) => ne.or(new TypeSpec(oe)), new FalseSpec()).isSatisfiedBy(J);
|
|
11917
11944
|
}
|
|
11918
11945
|
}
|
|
11919
11946
|
const activityHistoryCustomFilterGroupsSelector = createSelector(
|
|
@@ -12075,7 +12102,7 @@ const activityHistoryCollectionsSelector = (te) => te.activityHistoryCollections
|
|
|
12075
12102
|
...re,
|
|
12076
12103
|
filters: re.filters.map((oe) => ({
|
|
12077
12104
|
...oe,
|
|
12078
|
-
options: (oe.singleOption ? [] : getUniqueObjects(ne.items, oe.propPathValue, oe.propsPathDescription, oe.title)) || []
|
|
12105
|
+
options: (oe.singleOption ? [] : ne?.items && getUniqueObjects(ne.items, oe.propPathValue, oe.propsPathDescription, oe.title)) || []
|
|
12079
12106
|
}))
|
|
12080
12107
|
};
|
|
12081
12108
|
})
|
|
@@ -46084,4 +46111,4 @@ export {
|
|
|
46084
46111
|
h as w,
|
|
46085
46112
|
PrimariaInteractionService as x
|
|
46086
46113
|
};
|
|
46087
|
-
//# sourceMappingURL=index-
|
|
46114
|
+
//# sourceMappingURL=index-hZAiHLDu.js.map
|