@uxland/primary-shell 5.2.0 → 5.2.1
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/index.js +383 -363
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +107 -96
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.d.ts +9 -0
- package/package.json +1 -1
- package/src/UI/shared-components/bootstrapper.ts +2 -0
- package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts +29 -0
- package/src/UI/shared-components/primaria-character-limit-badge/styles.css +8 -0
- package/src/handle-views.ts +2 -24
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
|
|
3
|
+
export declare class PrimariaCharacterLimitBadge extends LitElement {
|
|
4
|
+
characterCount: number;
|
|
5
|
+
characterLimit: number;
|
|
6
|
+
label: string;
|
|
7
|
+
static styles: import('lit').CSSResult;
|
|
8
|
+
render(): import('lit').TemplateResult<1> | typeof nothing;
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -3,10 +3,12 @@ import { PrimariaContentSwitcher } from "./primaria-content-switcher/primaria-co
|
|
|
3
3
|
import { PrimariaNavItem } from "./primaria-nav-item/primaria-nav-item";
|
|
4
4
|
import { PrimariaNavTreeMenu } from "./primaria-nav-tree-menu/primaria-nav-tree-menu";
|
|
5
5
|
import { PrimariaRichTextEditor } from "./primaria-text-editor/primaria-rich-text-editor";
|
|
6
|
+
import { PrimariaCharacterLimitBadge } from "./primaria-character-limit-badge/primaria-character-limit-badge";
|
|
6
7
|
|
|
7
8
|
export const useSharedUI = () => {
|
|
8
9
|
customElement("primaria-content-switcher")(PrimariaContentSwitcher);
|
|
9
10
|
customElement("primaria-nav-item")(PrimariaNavItem);
|
|
10
11
|
customElement("primaria-rich-text-editor")(PrimariaRichTextEditor);
|
|
11
12
|
customElement("primaria-nav-tree-menu")(PrimariaNavTreeMenu);
|
|
13
|
+
customElement("primaria-character-limit-badge")(PrimariaCharacterLimitBadge);
|
|
12
14
|
};
|
package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement, html, nothing, css, unsafeCSS } from "lit";
|
|
2
|
+
import { property } from "lit/decorators.js";
|
|
3
|
+
import styles from "./styles.css?inline";
|
|
4
|
+
|
|
5
|
+
export class PrimariaCharacterLimitBadge extends LitElement {
|
|
6
|
+
@property({ type: Number }) characterCount = 0;
|
|
7
|
+
@property({ type: Number }) characterLimit = 0;
|
|
8
|
+
@property({ type: String }) label = "";
|
|
9
|
+
|
|
10
|
+
static styles = css`
|
|
11
|
+
${unsafeCSS(styles)}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
if (this.characterCount > this.characterLimit) {
|
|
16
|
+
return html`
|
|
17
|
+
<dss-badge
|
|
18
|
+
class="limit-badge"
|
|
19
|
+
icon="report"
|
|
20
|
+
size="md"
|
|
21
|
+
state="alert"
|
|
22
|
+
text="${this.label} ${this.characterCount}/${this.characterLimit}"
|
|
23
|
+
outlined
|
|
24
|
+
></dss-badge>
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
return nothing;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/handle-views.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { pocTestEventsId } from "./constants";
|
|
|
5
5
|
import { ExitShell } from "./features/exit/request";
|
|
6
6
|
import { getPatientCip } from "./features/get-patient-cip/action";
|
|
7
7
|
import { navigateToEcapWithoutClosingWithCip } from "./features/navigate-to-ecap/navigate-without-closing-and-with-cip";
|
|
8
|
-
import { PocEventsEcap } from "./UI/components/poc-events-ecap/poc-events-ecap";
|
|
9
8
|
import { PrimariaNavItem } from "./UI/shared-components/primaria-nav-item/primaria-nav-item";
|
|
10
9
|
import { PrimariaNavTreeMenu } from "./UI/shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu";
|
|
11
10
|
|
|
@@ -116,7 +115,7 @@ const registerUpperNavMenuViews = () => {
|
|
|
116
115
|
id: "results-reports",
|
|
117
116
|
factory: () => {
|
|
118
117
|
const menuItem = new PrimariaNavTreeMenu({
|
|
119
|
-
icon: "
|
|
118
|
+
icon: "folder_shared",
|
|
120
119
|
label: "Documents",
|
|
121
120
|
actionMenuItems: [
|
|
122
121
|
{
|
|
@@ -189,7 +188,7 @@ const registerUpperNavMenuViews = () => {
|
|
|
189
188
|
id: "visits",
|
|
190
189
|
factory: () => {
|
|
191
190
|
const menuItem = new PrimariaNavItem({
|
|
192
|
-
icon: "
|
|
191
|
+
icon: "event",
|
|
193
192
|
label: "Visites",
|
|
194
193
|
callbackFn: async (): Promise<void> => {
|
|
195
194
|
navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES");
|
|
@@ -199,19 +198,6 @@ const registerUpperNavMenuViews = () => {
|
|
|
199
198
|
},
|
|
200
199
|
sortHint: "001300",
|
|
201
200
|
});
|
|
202
|
-
shellApi.regionManager.registerView(shellRegions.navigationMenu, {
|
|
203
|
-
id: pocTestEventsId,
|
|
204
|
-
factory: () => {
|
|
205
|
-
const menuItem = new PrimariaNavItem({
|
|
206
|
-
icon: "bolt",
|
|
207
|
-
label: "Prova Events ECAP",
|
|
208
|
-
callbackFn: () => {
|
|
209
|
-
shellApi.regionManager.activateMainView(pocTestEventsId);
|
|
210
|
-
},
|
|
211
|
-
});
|
|
212
|
-
return Promise.resolve(menuItem);
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
201
|
|
|
216
202
|
shellApi.regionManager.registerView(shellRegions.navigationMenu, {
|
|
217
203
|
id: "it",
|
|
@@ -259,14 +245,6 @@ const registerLowerNavMenuViews = () => {
|
|
|
259
245
|
};
|
|
260
246
|
|
|
261
247
|
const registerMainViews = () => {
|
|
262
|
-
shellApi.regionManager.registerMainView({
|
|
263
|
-
id: pocTestEventsId,
|
|
264
|
-
factory: () => {
|
|
265
|
-
const mainItem = new PocEventsEcap();
|
|
266
|
-
return Promise.resolve(mainItem as unknown as HTMLElement);
|
|
267
|
-
},
|
|
268
|
-
});
|
|
269
|
-
|
|
270
248
|
registerPDFVisorMainView();
|
|
271
249
|
};
|
|
272
250
|
|