@oicl/openbridge-webcomponents 2.0.0-next.132 → 2.0.0-next.134
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/bundle/openbridge-webcomponents.bundle.js +59 -49
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +19 -20
- package/dist/components/automation-button-readout-stack/automation-button-readout-stack.css.js +8 -1
- package/dist/components/automation-button-readout-stack/automation-button-readout-stack.css.js.map +1 -1
- package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts +6 -0
- package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts.map +1 -1
- package/dist/components/automation-button-readout-stack/automation-button-readout-stack.js +13 -2
- package/dist/components/automation-button-readout-stack/automation-button-readout-stack.js.map +1 -1
- package/dist/components/user-menu/user-menu.d.ts +15 -6
- package/dist/components/user-menu/user-menu.d.ts.map +1 -1
- package/dist/components/user-menu/user-menu.js +38 -46
- package/dist/components/user-menu/user-menu.js.map +1 -1
- package/dist/generated/locales/es-419.d.ts +1 -5
- package/dist/generated/locales/es-419.d.ts.map +1 -1
- package/dist/generated/locales/es-419.js +1 -5
- package/dist/generated/locales/es-419.js.map +1 -1
- package/dist/generated/locales/fi-FI.d.ts +1 -5
- package/dist/generated/locales/fi-FI.d.ts.map +1 -1
- package/dist/generated/locales/fi-FI.js +1 -5
- package/dist/generated/locales/fi-FI.js.map +1 -1
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -49727,7 +49727,8 @@
|
|
|
49727
49727
|
"text": "AutomationButtonReadoutStackValue"
|
|
49728
49728
|
}
|
|
49729
49729
|
}
|
|
49730
|
-
]
|
|
49730
|
+
],
|
|
49731
|
+
"description": "Numeric readout with hinted zeros.\n\nThe minus sign occupies a digit slot, so the readout stays `nDigits` wide\nand the sign renders ahead of the hinted padding (`-05`, not `0-5`)."
|
|
49731
49732
|
},
|
|
49732
49733
|
{
|
|
49733
49734
|
"kind": "method",
|
|
@@ -77401,7 +77402,7 @@
|
|
|
77401
77402
|
"declarations": [
|
|
77402
77403
|
{
|
|
77403
77404
|
"kind": "class",
|
|
77404
|
-
"description": "`<obc-user-menu>` – A user menu component with sign-in and signed-in layouts.\n\nProvides multiple layouts for authentication and account access states, including\nsign-in forms, user-specific sign-in, loading states, and signed-in navigation.\n\n### Features\n- **Multiple States:** Supports sign-in, user sign-in, loading, and signed-in layouts.\n- **Size Options:** Regular and small sizes for compact layouts.\n- **Recent Users:** Optional \"Recently signed in\" section for quick access.\n- **Navigation Actions:** Signed-in state
|
|
77405
|
+
"description": "`<obc-user-menu>` – A user menu component with sign-in and signed-in layouts.\n\nProvides multiple layouts for authentication and account access states, including\nsign-in forms, user-specific sign-in, loading states, and signed-in navigation.\n\n### Features\n- **Multiple States:** Supports sign-in, user sign-in, loading, and signed-in layouts.\n- **Size Options:** Regular and small sizes for compact layouts.\n- **Recent Users:** Optional \"Recently signed in\" section for quick access.\n- **Navigation Actions:** Signed-in state lists the actions it is given.\n\n### Variants\n- `type`: `sign-in`, `user-sign-in`, `loading-sign-in`, `signed-in`\n- `size`: `regular`, `small`\n\n### Usage Guidelines\nUse `obc-user-menu` in authentication or account panels where quick access to\nsign-in, profile, or account actions is needed. The `user-sign-in` type is\nbest for fast re-auth flows; `loading-sign-in` is for pending auth states.\n\n### Properties and Configuration\n- `type` (`ObcUserMenuType`): Controls the layout state. Defaults to `sign-in`.\n- `size` (`ObcUserMenuSize`): Controls the overall size. Defaults to `regular`.\n- `hasRecentlySignedIn` (`boolean`): Toggles the recent users section.\n Defaults to `false`.\n- `username` (`string`): Current username value for sign-in layouts.\n- `password` (`string`): Current password value for sign-in layouts.\n- `usernameError` (`string`): Error message for the username field.\n- `passwordError` (`string`): Error message for the password field.\n- `userInitials` (`string`): Initials for the primary user profile.\n- `userLabel` (`string`): Label for the primary user profile.\n- `recentUsers` (`ObcUserMenuUser[]`): List of recent users shown in the\n \"Recently signed in\" section. Empty renders no section.\n- `signedInActions` (`ObcUserMenuSignedInAction[]`): Actions shown in the\n signed-in navigation list. Empty renders no actions.\n- `primaryActionId` (`string`): Id of the action promoted to a button in the\n small signed-in layout.\n\n### Events\n- `sign-in-click` – Fired when a sign-in button is clicked.\n- `sign-out-click` – Fired when the sign-out button is clicked.\n- `signed-in-action-click` – Fired when a signed-in action is clicked.\n- `recent-user-click` – Fired when a recent user button is clicked.\n\n### Slots\n- `signed-in-action-icon-{id}`: Optional icon for a signed-in action. The\n `{id}` is the normalized action id.\n\n### Example\n```html\n<obc-user-menu\n type=\"user-sign-in\"\n size=\"small\"\n hasRecentlySignedIn=\"false\"\n userInitials=\"JD\"\n userLabel=\"John Doe\"\n></obc-user-menu>\n```",
|
|
77405
77406
|
"name": "ObcUserMenu",
|
|
77406
77407
|
"slots": [
|
|
77407
77408
|
{
|
|
@@ -77544,13 +77545,17 @@
|
|
|
77544
77545
|
},
|
|
77545
77546
|
{
|
|
77546
77547
|
"kind": "field",
|
|
77547
|
-
"name": "
|
|
77548
|
-
"
|
|
77549
|
-
|
|
77548
|
+
"name": "primaryActionId",
|
|
77549
|
+
"type": {
|
|
77550
|
+
"text": "string | undefined"
|
|
77551
|
+
},
|
|
77552
|
+
"description": "Id of the action promoted to a button in the small signed-in layout.\n\nAvailable when `type==signedIn && size==small`.",
|
|
77553
|
+
"attribute": "primaryActionId",
|
|
77554
|
+
"availableWhen": "type==signedIn && size==small"
|
|
77550
77555
|
},
|
|
77551
77556
|
{
|
|
77552
77557
|
"kind": "field",
|
|
77553
|
-
"name": "
|
|
77558
|
+
"name": "showRecentUsers",
|
|
77554
77559
|
"privacy": "private",
|
|
77555
77560
|
"readonly": true
|
|
77556
77561
|
},
|
|
@@ -77624,20 +77629,6 @@
|
|
|
77624
77629
|
"type": {
|
|
77625
77630
|
"text": "'large' | 'regular'"
|
|
77626
77631
|
}
|
|
77627
|
-
},
|
|
77628
|
-
{
|
|
77629
|
-
"name": "initials",
|
|
77630
|
-
"optional": true,
|
|
77631
|
-
"type": {
|
|
77632
|
-
"text": "string"
|
|
77633
|
-
}
|
|
77634
|
-
},
|
|
77635
|
-
{
|
|
77636
|
-
"name": "label",
|
|
77637
|
-
"optional": true,
|
|
77638
|
-
"type": {
|
|
77639
|
-
"text": "string"
|
|
77640
|
-
}
|
|
77641
77632
|
}
|
|
77642
77633
|
]
|
|
77643
77634
|
},
|
|
@@ -77882,6 +77873,14 @@
|
|
|
77882
77873
|
},
|
|
77883
77874
|
"description": "Label for the primary user profile.\n\nAvailable when `type!=signIn`.",
|
|
77884
77875
|
"fieldName": "userLabel"
|
|
77876
|
+
},
|
|
77877
|
+
{
|
|
77878
|
+
"name": "primaryActionId",
|
|
77879
|
+
"type": {
|
|
77880
|
+
"text": "string | undefined"
|
|
77881
|
+
},
|
|
77882
|
+
"description": "Id of the action promoted to a button in the small signed-in layout.\n\nAvailable when `type==signedIn && size==small`.",
|
|
77883
|
+
"fieldName": "primaryActionId"
|
|
77885
77884
|
}
|
|
77886
77885
|
],
|
|
77887
77886
|
"superclass": {
|
package/dist/components/automation-button-readout-stack/automation-button-readout-stack.css.js
CHANGED
|
@@ -59,7 +59,14 @@ const compentStyle = css`* {
|
|
|
59
59
|
display: flex;
|
|
60
60
|
justify-content: center;
|
|
61
61
|
align-items: center;
|
|
62
|
-
gap:
|
|
62
|
+
gap: 0;
|
|
63
|
+
}
|
|
64
|
+
.readout-stack .value-text .hinted-zero {
|
|
65
|
+
color: var(
|
|
66
|
+
--obc-automation-button-readout-stack-hinted-color,
|
|
67
|
+
var(--element-disabled-color)
|
|
68
|
+
);
|
|
69
|
+
font-weight: var(--global-typography-generic-l-font-weight-regular);
|
|
63
70
|
}
|
|
64
71
|
.readout-stack.small .readout-item {
|
|
65
72
|
font-family: var(--global-typography-font-family);
|
package/dist/components/automation-button-readout-stack/automation-button-readout-stack.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-button-readout-stack.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"automation-button-readout-stack.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts
CHANGED
|
@@ -56,6 +56,12 @@ export declare class ObcAutomationButtonReadoutStack extends LitElement {
|
|
|
56
56
|
renderTag(): typeof nothing | HTMLTemplateResult;
|
|
57
57
|
private renderValueContainer;
|
|
58
58
|
private renderValueText;
|
|
59
|
+
/**
|
|
60
|
+
* Numeric readout with hinted zeros.
|
|
61
|
+
*
|
|
62
|
+
* The minus sign occupies a digit slot, so the readout stays `nDigits` wide
|
|
63
|
+
* and the sign renders ahead of the hinted padding (`-05`, not `0-5`).
|
|
64
|
+
*/
|
|
59
65
|
renderValue(readout: AutomationButtonReadoutStackValue): HTMLTemplateResult;
|
|
60
66
|
renderStateOff(readout: AutomationButtonReadoutStackStateOff): HTMLTemplateResult;
|
|
61
67
|
renderStateOn(readout: AutomationButtonReadoutStackStateOn): HTMLTemplateResult;
|
package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-button-readout-stack.d.ts","sourceRoot":"","sources":["../../../src/components/automation-button-readout-stack/automation-button-readout-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAI7E,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,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G,EAAE,MAAM,GAAG,IAAI,CAAQ;IACxC,IAAI,EAAE,gCAAgC,CACP;IAC/B,gBAAgB,EAAE,gBAAgB,CAAwB;IAEtE,SAAS,IAAI,OAAO,OAAO,GAAG,kBAAkB;IAMhD,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,eAAe;IAIvB,WAAW,CAAC,OAAO,EAAE,iCAAiC,GAAG,kBAAkB;
|
|
1
|
+
{"version":3,"file":"automation-button-readout-stack.d.ts","sourceRoot":"","sources":["../../../src/components/automation-button-readout-stack/automation-button-readout-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAI7E,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,wCAAwC,CAAC;AAChD,OAAO,8CAA8C,CAAC;AACtD,OAAO,gDAAgD,CAAC;AACxD,OAAO,gDAAgD,CAAC;AACxD,OAAO,iDAAiD,CAAC;AACzD,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qBAAqB,CAAC;AAE7B,oBAAY,gCAAgC;IAC1C,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,gBAAgB;IAC1B,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACrD,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,mCAAmC;IAClD,IAAI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{
|
|
|
58
58
|
renderValueText(text) {
|
|
59
59
|
return html`<span class="value-text">${text}</span>`;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Numeric readout with hinted zeros.
|
|
63
|
+
*
|
|
64
|
+
* The minus sign occupies a digit slot, so the readout stays `nDigits` wide
|
|
65
|
+
* and the sign renders ahead of the hinted padding (`-05`, not `0-5`).
|
|
66
|
+
*/
|
|
61
67
|
renderValue(readout) {
|
|
62
68
|
const v = readout.value.toFixed(0);
|
|
69
|
+
const sign = v.startsWith("-") ? "-" : "";
|
|
70
|
+
const digits = sign ? v.slice(1) : v;
|
|
63
71
|
const zeroPadding = v.length < readout.nDigits ? "0".repeat(readout.nDigits - v.length) : "";
|
|
64
|
-
const paddedValue = zeroPadding + v;
|
|
65
72
|
let directionIcon = nothing;
|
|
66
73
|
if (readout.icon == "arrow") {
|
|
67
74
|
if (readout.direction == "up") {
|
|
@@ -109,7 +116,11 @@ let ObcAutomationButtonReadoutStack = class extends LitElement {
|
|
|
109
116
|
}
|
|
110
117
|
}
|
|
111
118
|
const content = html`
|
|
112
|
-
|
|
119
|
+
<span class="value-text"
|
|
120
|
+
>${sign}${zeroPadding ? html`<span class="hinted-zero" aria-hidden="true"
|
|
121
|
+
>${zeroPadding}</span
|
|
122
|
+
>` : nothing}${digits}</span
|
|
123
|
+
>
|
|
113
124
|
<span class="unit">${readout.unit}</span>
|
|
114
125
|
`;
|
|
115
126
|
return this.renderValueContainer("value", directionIcon, content);
|
package/dist/components/automation-button-readout-stack/automation-button-readout-stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-button-readout-stack.js","sources":["../../../src/components/automation-button-readout-stack/automation-button-readout-stack.ts"],"sourcesContent":["import {HTMLTemplateResult, LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport compentStyle from './automation-button-readout-stack.css?inline';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-arrow-up-google.js';\nimport '../../icons/icon-arrow-down-google.js';\nimport '../../icons/icon-arrow-left-google.js';\nimport '../../icons/icon-arrow-right-google.js';\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-double-left-google.js';\nimport '../../icons/icon-chevron-double-right-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-on.js';\nimport '../../icons/icon-temperature-air.js';\nimport '../button/button.js';\n\nexport enum AutomationButtonReadoutStackSize {\n small = 'small',\n regular = 'regular',\n enhanced = 'enhanced',\n}\n\nexport enum IdTagOrientation {\n top = 'top',\n bottom = 'bottom',\n}\n\nexport interface AutomationButtonReadoutStackValue {\n type: 'value';\n value: number;\n nDigits: number;\n unit: string;\n direction: 'up' | 'down' | 'left' | 'right' | 'none';\n icon: 'none' | 'arrow' | 'chevron';\n}\n\nexport interface AutomationButtonReadoutStackStateOn {\n type: 'state-on';\n value: string;\n hasIcon: boolean;\n}\n\nexport interface AutomationButtonReadoutStackStateOff {\n type: 'state-off';\n value: string;\n hasIcon: boolean;\n}\n\nexport interface AutomationButtonReadoutStackButton {\n type: 'button';\n value: number;\n hasIcon: boolean;\n unit: string;\n}\n\nexport type AutomationButtonReadoutStack =\n | AutomationButtonReadoutStackValue\n | AutomationButtonReadoutStackStateOn\n | AutomationButtonReadoutStackStateOff\n | AutomationButtonReadoutStackButton;\n\n/**\n * @experimental\n */\n@customElement('obc-automation-button-readout-stack')\nexport class ObcAutomationButtonReadoutStack extends LitElement {\n @property({type: Array, attribute: false})\n readouts: AutomationButtonReadoutStack[] = [];\n @property({type: String}) tag: string | null = null;\n @property() size: AutomationButtonReadoutStackSize =\n AutomationButtonReadoutStackSize.regular;\n @property() idTagOrientation: IdTagOrientation = IdTagOrientation.top;\n\n renderTag(): typeof nothing | HTMLTemplateResult {\n if (this.tag === null) return nothing;\n\n return html`<div class=\"tag\">${this.tag}</div>`;\n }\n\n private renderValueContainer(\n type: string,\n icon: HTMLTemplateResult | typeof nothing,\n content: HTMLTemplateResult\n ): HTMLTemplateResult {\n return html`<div class=\"readout-item ${type}\">\n ${icon}\n <div class=\"value-container\">\n <div class=\"label-container\">${content}</div>\n </div>\n </div>`;\n }\n\n private renderValueText(text: string): HTMLTemplateResult {\n return html`<span class=\"value-text\">${text}</span>`;\n }\n\n renderValue(readout: AutomationButtonReadoutStackValue): HTMLTemplateResult {\n const v = readout.value.toFixed(0);\n const zeroPadding =\n v.length < readout.nDigits ? '0'.repeat(readout.nDigits - v.length) : '';\n const paddedValue = zeroPadding + v;\n\n let directionIcon: HTMLTemplateResult | typeof nothing = nothing;\n if (readout.icon == 'arrow') {\n if (readout.direction == 'up') {\n directionIcon = html`<obi-arrow-up-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-up-google>`;\n } else if (readout.direction == 'down') {\n directionIcon = html`<obi-arrow-down-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-down-google>`;\n } else if (readout.direction == 'left') {\n directionIcon = html`<obi-arrow-left-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-left-google>`;\n } else if (readout.direction == 'right') {\n directionIcon = html`<obi-arrow-right-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-right-google>`;\n }\n } else if (readout.icon == 'chevron') {\n if (readout.direction == 'up') {\n directionIcon = html`<obi-chevron-double-up-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-up-google>`;\n } else if (readout.direction == 'down') {\n directionIcon = html`<obi-chevron-double-down-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-down-google>`;\n } else if (readout.direction == 'left') {\n directionIcon = html`<obi-chevron-double-left-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-left-google>`;\n } else if (readout.direction == 'right') {\n directionIcon = html`<obi-chevron-double-right-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-right-google>`;\n }\n }\n const content = html`\n ${this.renderValueText(paddedValue)}\n <span class=\"unit\">${readout.unit}</span>\n `;\n\n return this.renderValueContainer('value', directionIcon, content);\n }\n\n renderStateOff(\n readout: AutomationButtonReadoutStackStateOff\n ): HTMLTemplateResult {\n let offIcon: HTMLTemplateResult = html``;\n if (readout.hasIcon) {\n offIcon = html`<obi-off class=\"icon\" useCssColor></obi-off>`;\n }\n\n const content = this.renderValueText(readout.value);\n return this.renderValueContainer('state-off', offIcon, content);\n }\n\n renderStateOn(\n readout: AutomationButtonReadoutStackStateOn\n ): HTMLTemplateResult {\n let onIcon: HTMLTemplateResult = html``;\n if (readout.hasIcon) {\n onIcon = html`<obi-on class=\"icon\" useCssColor></obi-on>`;\n }\n\n const content = this.renderValueText(readout.value);\n return this.renderValueContainer('state-on', onIcon, content);\n }\n\n renderButton(\n readout: AutomationButtonReadoutStackButton\n ): HTMLTemplateResult {\n const v = readout.value.toFixed(1); // Format as 000.0\n\n let temperatureIcon: HTMLTemplateResult = html``;\n if (readout.hasIcon) {\n temperatureIcon = html`<obi-temperature-air\n class=\"icon\"\n useCssColor\n ></obi-temperature-air>`;\n }\n\n const content = html`\n ${this.renderValueText(v)}\n <span class=\"unit\">${readout.unit}</span>\n `;\n\n return html`<obc-button class=\"readout-button\" part=\"readout-button\">\n ${this.renderValueContainer('button', temperatureIcon, content)}\n </obc-button>`;\n }\n\n renderReadout(readout: AutomationButtonReadoutStack): HTMLTemplateResult {\n if (readout.type === 'value') {\n return this.renderValue(readout);\n } else if (readout.type === 'state-on') {\n return this.renderStateOn(readout);\n } else if (readout.type === 'state-off') {\n return this.renderStateOff(readout);\n } else if (readout.type === 'button') {\n return this.renderButton(readout);\n } else {\n throw new Error('Invalid readout type');\n }\n }\n\n override render() {\n const displayableReadouts = this.readouts.filter(\n (readout) =>\n readout.type === 'value' ||\n readout.type === 'state-off' ||\n readout.type === 'state-on' ||\n readout.type === 'button'\n );\n\n const renderedReadouts = displayableReadouts.map((r) =>\n this.renderReadout(r)\n );\n const tag = this.renderTag();\n const elements: unknown[] = [];\n\n if (this.idTagOrientation === IdTagOrientation.top) {\n elements.push(tag);\n elements.push(...renderedReadouts);\n } else {\n elements.push(...renderedReadouts);\n elements.push(tag);\n }\n\n return html`<div class=\"readout-stack ${this.size}\">${elements}</div>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-button-readout-stack': ObcAutomationButtonReadoutStack;\n }\n}\n"],"names":["AutomationButtonReadoutStackSize","IdTagOrientation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAK,qDAAAA,sCAAL;AACLA,oCAAA,OAAA,IAAQ;AACRA,oCAAA,SAAA,IAAU;AACVA,oCAAA,UAAA,IAAW;AAHD,SAAAA;AAAA,GAAA,oCAAA,CAAA,CAAA;AAML,IAAK,qCAAAC,sBAAL;AACLA,oBAAA,KAAA,IAAM;AACNA,oBAAA,QAAA,IAAS;AAFC,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AA2CL,IAAM,kCAAN,cAA8C,WAAW;AAAA,EAAzD,cAAA;AAAA,UAAA,GAAA,SAAA;AAEL,SAAA,WAA2C,CAAA;AACjB,SAAA,MAAqB;AACnC,SAAA,OACV;AACU,SAAA,mBAAqC;AAAA,EAAA;AAAA,EAEjD,YAAiD;AAC/C,QAAI,KAAK,QAAQ,KAAM,QAAO;AAE9B,WAAO,wBAAwB,KAAK,GAAG;AAAA,EACzC;AAAA,EAEQ,qBACN,MACA,MACA,SACoB;AACpB,WAAO,gCAAgC,IAAI;AAAA,QACvC,IAAI;AAAA;AAAA,uCAE2B,OAAO;AAAA;AAAA;AAAA,EAG5C;AAAA,EAEQ,gBAAgB,MAAkC;AACxD,WAAO,gCAAgC,IAAI;AAAA,EAC7C;AAAA,EAEA,YAAY,SAAgE;AAC1E,UAAM,IAAI,QAAQ,MAAM,QAAQ,CAAC;AACjC,UAAM,cACJ,EAAE,SAAS,QAAQ,UAAU,IAAI,OAAO,QAAQ,UAAU,EAAE,MAAM,IAAI;AACxE,UAAM,cAAc,cAAc;AAEl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kLK,SAAS,UAAU,YAAY;AAhL/C,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAD9B,gCAEX,WAAA,YAAA,CAAA;AAC0B,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,gCAGe,WAAA,OAAA,CAAA;AACd,gBAAA;AAAA,EAAX,SAAA;AAAS,GAJC,gCAIC,WAAA,QAAA,CAAA;AAEA,gBAAA;AAAA,EAAX,SAAA;AAAS,GANC,gCAMC,WAAA,oBAAA,CAAA;AAND,kCAAN,gBAAA;AAAA,EADN,cAAc,qCAAqC;AAAA,GACvC,+BAAA;"}
|
|
1
|
+
{"version":3,"file":"automation-button-readout-stack.js","sources":["../../../src/components/automation-button-readout-stack/automation-button-readout-stack.ts"],"sourcesContent":["import {HTMLTemplateResult, LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport compentStyle from './automation-button-readout-stack.css?inline';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-arrow-up-google.js';\nimport '../../icons/icon-arrow-down-google.js';\nimport '../../icons/icon-arrow-left-google.js';\nimport '../../icons/icon-arrow-right-google.js';\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-double-left-google.js';\nimport '../../icons/icon-chevron-double-right-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-on.js';\nimport '../../icons/icon-temperature-air.js';\nimport '../button/button.js';\n\nexport enum AutomationButtonReadoutStackSize {\n small = 'small',\n regular = 'regular',\n enhanced = 'enhanced',\n}\n\nexport enum IdTagOrientation {\n top = 'top',\n bottom = 'bottom',\n}\n\nexport interface AutomationButtonReadoutStackValue {\n type: 'value';\n value: number;\n nDigits: number;\n unit: string;\n direction: 'up' | 'down' | 'left' | 'right' | 'none';\n icon: 'none' | 'arrow' | 'chevron';\n}\n\nexport interface AutomationButtonReadoutStackStateOn {\n type: 'state-on';\n value: string;\n hasIcon: boolean;\n}\n\nexport interface AutomationButtonReadoutStackStateOff {\n type: 'state-off';\n value: string;\n hasIcon: boolean;\n}\n\nexport interface AutomationButtonReadoutStackButton {\n type: 'button';\n value: number;\n hasIcon: boolean;\n unit: string;\n}\n\nexport type AutomationButtonReadoutStack =\n | AutomationButtonReadoutStackValue\n | AutomationButtonReadoutStackStateOn\n | AutomationButtonReadoutStackStateOff\n | AutomationButtonReadoutStackButton;\n\n/**\n * @experimental\n */\n@customElement('obc-automation-button-readout-stack')\nexport class ObcAutomationButtonReadoutStack extends LitElement {\n @property({type: Array, attribute: false})\n readouts: AutomationButtonReadoutStack[] = [];\n @property({type: String}) tag: string | null = null;\n @property() size: AutomationButtonReadoutStackSize =\n AutomationButtonReadoutStackSize.regular;\n @property() idTagOrientation: IdTagOrientation = IdTagOrientation.top;\n\n renderTag(): typeof nothing | HTMLTemplateResult {\n if (this.tag === null) return nothing;\n\n return html`<div class=\"tag\">${this.tag}</div>`;\n }\n\n private renderValueContainer(\n type: string,\n icon: HTMLTemplateResult | typeof nothing,\n content: HTMLTemplateResult\n ): HTMLTemplateResult {\n return html`<div class=\"readout-item ${type}\">\n ${icon}\n <div class=\"value-container\">\n <div class=\"label-container\">${content}</div>\n </div>\n </div>`;\n }\n\n private renderValueText(text: string): HTMLTemplateResult {\n return html`<span class=\"value-text\">${text}</span>`;\n }\n\n /**\n * Numeric readout with hinted zeros.\n *\n * The minus sign occupies a digit slot, so the readout stays `nDigits` wide\n * and the sign renders ahead of the hinted padding (`-05`, not `0-5`).\n */\n renderValue(readout: AutomationButtonReadoutStackValue): HTMLTemplateResult {\n const v = readout.value.toFixed(0);\n const sign = v.startsWith('-') ? '-' : '';\n const digits = sign ? v.slice(1) : v;\n const zeroPadding =\n v.length < readout.nDigits ? '0'.repeat(readout.nDigits - v.length) : '';\n\n let directionIcon: HTMLTemplateResult | typeof nothing = nothing;\n if (readout.icon == 'arrow') {\n if (readout.direction == 'up') {\n directionIcon = html`<obi-arrow-up-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-up-google>`;\n } else if (readout.direction == 'down') {\n directionIcon = html`<obi-arrow-down-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-down-google>`;\n } else if (readout.direction == 'left') {\n directionIcon = html`<obi-arrow-left-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-left-google>`;\n } else if (readout.direction == 'right') {\n directionIcon = html`<obi-arrow-right-google\n class=\"icon\"\n useCssColor\n ></obi-arrow-right-google>`;\n }\n } else if (readout.icon == 'chevron') {\n if (readout.direction == 'up') {\n directionIcon = html`<obi-chevron-double-up-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-up-google>`;\n } else if (readout.direction == 'down') {\n directionIcon = html`<obi-chevron-double-down-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-down-google>`;\n } else if (readout.direction == 'left') {\n directionIcon = html`<obi-chevron-double-left-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-left-google>`;\n } else if (readout.direction == 'right') {\n directionIcon = html`<obi-chevron-double-right-google\n class=\"icon\"\n useCssColor\n ></obi-chevron-double-right-google>`;\n }\n }\n const content = html`\n <span class=\"value-text\"\n >${sign}${zeroPadding\n ? html`<span class=\"hinted-zero\" aria-hidden=\"true\"\n >${zeroPadding}</span\n >`\n : nothing}${digits}</span\n >\n <span class=\"unit\">${readout.unit}</span>\n `;\n\n return this.renderValueContainer('value', directionIcon, content);\n }\n\n renderStateOff(\n readout: AutomationButtonReadoutStackStateOff\n ): HTMLTemplateResult {\n let offIcon: HTMLTemplateResult = html``;\n if (readout.hasIcon) {\n offIcon = html`<obi-off class=\"icon\" useCssColor></obi-off>`;\n }\n\n const content = this.renderValueText(readout.value);\n return this.renderValueContainer('state-off', offIcon, content);\n }\n\n renderStateOn(\n readout: AutomationButtonReadoutStackStateOn\n ): HTMLTemplateResult {\n let onIcon: HTMLTemplateResult = html``;\n if (readout.hasIcon) {\n onIcon = html`<obi-on class=\"icon\" useCssColor></obi-on>`;\n }\n\n const content = this.renderValueText(readout.value);\n return this.renderValueContainer('state-on', onIcon, content);\n }\n\n renderButton(\n readout: AutomationButtonReadoutStackButton\n ): HTMLTemplateResult {\n const v = readout.value.toFixed(1); // Format as 000.0\n\n let temperatureIcon: HTMLTemplateResult = html``;\n if (readout.hasIcon) {\n temperatureIcon = html`<obi-temperature-air\n class=\"icon\"\n useCssColor\n ></obi-temperature-air>`;\n }\n\n const content = html`\n ${this.renderValueText(v)}\n <span class=\"unit\">${readout.unit}</span>\n `;\n\n return html`<obc-button class=\"readout-button\" part=\"readout-button\">\n ${this.renderValueContainer('button', temperatureIcon, content)}\n </obc-button>`;\n }\n\n renderReadout(readout: AutomationButtonReadoutStack): HTMLTemplateResult {\n if (readout.type === 'value') {\n return this.renderValue(readout);\n } else if (readout.type === 'state-on') {\n return this.renderStateOn(readout);\n } else if (readout.type === 'state-off') {\n return this.renderStateOff(readout);\n } else if (readout.type === 'button') {\n return this.renderButton(readout);\n } else {\n throw new Error('Invalid readout type');\n }\n }\n\n override render() {\n const displayableReadouts = this.readouts.filter(\n (readout) =>\n readout.type === 'value' ||\n readout.type === 'state-off' ||\n readout.type === 'state-on' ||\n readout.type === 'button'\n );\n\n const renderedReadouts = displayableReadouts.map((r) =>\n this.renderReadout(r)\n );\n const tag = this.renderTag();\n const elements: unknown[] = [];\n\n if (this.idTagOrientation === IdTagOrientation.top) {\n elements.push(tag);\n elements.push(...renderedReadouts);\n } else {\n elements.push(...renderedReadouts);\n elements.push(tag);\n }\n\n return html`<div class=\"readout-stack ${this.size}\">${elements}</div>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-button-readout-stack': ObcAutomationButtonReadoutStack;\n }\n}\n"],"names":["AutomationButtonReadoutStackSize","IdTagOrientation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAK,qDAAAA,sCAAL;AACLA,oCAA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;AAAA,GAHb,gCAGe,WAAA,OAAA,CAAA;AACd,gBAAA;AAAA,EAAX,SAAA;AAAS,GAJC,gCAIC,WAAA,QAAA,CAAA;AAEA,gBAAA;AAAA,EAAX,SAAA;AAAS,GANC,gCAMC,WAAA,oBAAA,CAAA;AAND,kCAAN,gBAAA;AAAA,EADN,cAAc,qCAAqC;AAAA,GACvC,+BAAA;"}
|
|
@@ -36,7 +36,7 @@ export type ObcUserMenuSignedInAction = {
|
|
|
36
36
|
* - **Multiple States:** Supports sign-in, user sign-in, loading, and signed-in layouts.
|
|
37
37
|
* - **Size Options:** Regular and small sizes for compact layouts.
|
|
38
38
|
* - **Recent Users:** Optional "Recently signed in" section for quick access.
|
|
39
|
-
* - **Navigation Actions:** Signed-in state
|
|
39
|
+
* - **Navigation Actions:** Signed-in state lists the actions it is given.
|
|
40
40
|
*
|
|
41
41
|
* ### Variants
|
|
42
42
|
* - `type`: `sign-in`, `user-sign-in`, `loading-sign-in`, `signed-in`
|
|
@@ -51,7 +51,7 @@ export type ObcUserMenuSignedInAction = {
|
|
|
51
51
|
* - `type` (`ObcUserMenuType`): Controls the layout state. Defaults to `sign-in`.
|
|
52
52
|
* - `size` (`ObcUserMenuSize`): Controls the overall size. Defaults to `regular`.
|
|
53
53
|
* - `hasRecentlySignedIn` (`boolean`): Toggles the recent users section.
|
|
54
|
-
* Defaults to `
|
|
54
|
+
* Defaults to `false`.
|
|
55
55
|
* - `username` (`string`): Current username value for sign-in layouts.
|
|
56
56
|
* - `password` (`string`): Current password value for sign-in layouts.
|
|
57
57
|
* - `usernameError` (`string`): Error message for the username field.
|
|
@@ -59,9 +59,11 @@ export type ObcUserMenuSignedInAction = {
|
|
|
59
59
|
* - `userInitials` (`string`): Initials for the primary user profile.
|
|
60
60
|
* - `userLabel` (`string`): Label for the primary user profile.
|
|
61
61
|
* - `recentUsers` (`ObcUserMenuUser[]`): List of recent users shown in the
|
|
62
|
-
* "Recently signed in" section.
|
|
62
|
+
* "Recently signed in" section. Empty renders no section.
|
|
63
63
|
* - `signedInActions` (`ObcUserMenuSignedInAction[]`): Actions shown in the
|
|
64
|
-
* signed-in navigation list.
|
|
64
|
+
* signed-in navigation list. Empty renders no actions.
|
|
65
|
+
* - `primaryActionId` (`string`): Id of the action promoted to a button in the
|
|
66
|
+
* small signed-in layout.
|
|
65
67
|
*
|
|
66
68
|
* ### Events
|
|
67
69
|
* - `sign-in-click` – Fired when a sign-in button is clicked.
|
|
@@ -103,6 +105,8 @@ export type ObcUserMenuSignedInAction = {
|
|
|
103
105
|
* @property recentUsers - Recent users for the "Recently signed in" section.
|
|
104
106
|
* @property signedInActions - Actions shown in the signed-in navigation list.
|
|
105
107
|
* @availableWhen signedInActions type==signedIn
|
|
108
|
+
* @property primaryActionId - Id of the action promoted to a button in the small signed-in layout.
|
|
109
|
+
* @availableWhen primaryActionId type==signedIn && size==small
|
|
106
110
|
* @slot signed-in-action-icon-<id> - Optional icon for a signed-in action, one per action; `<id>` is the normalized action id (shown in the `signed-in` type).
|
|
107
111
|
* @fires {CustomEvent<{username: string, password: string}>} sign-in-click - Fired when a sign-in button is clicked.
|
|
108
112
|
* @fires {CustomEvent<void>} sign-out-click - Fired when the sign-out button is clicked.
|
|
@@ -165,8 +169,13 @@ export declare class ObcUserMenu extends LitElement {
|
|
|
165
169
|
* Available when `type==signedIn`.
|
|
166
170
|
*/
|
|
167
171
|
signedInActions: ObcUserMenuSignedInAction[];
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Id of the action promoted to a button in the small signed-in layout.
|
|
174
|
+
*
|
|
175
|
+
* Available when `type==signedIn && size==small`.
|
|
176
|
+
*/
|
|
177
|
+
primaryActionId?: string;
|
|
178
|
+
private get showRecentUsers();
|
|
170
179
|
private renderTextInput;
|
|
171
180
|
private renderUserButtons;
|
|
172
181
|
private renderUserProfile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-menu.d.ts","sourceRoot":"","sources":["../../../src/components/user-menu/user-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAA2B,MAAM,KAAK,CAAC;AAKzE,OAAO,yCAAyC,CAAC;AACjD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,iCAAiC,CAAC;AACzC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAalC,oBAAY,eAAe;IACzB,MAAM,YAAY;IAClB,UAAU,iBAAiB;IAC3B,aAAa,oBAAoB;IACjC,QAAQ,cAAc;CACvB;AAED,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"user-menu.d.ts","sourceRoot":"","sources":["../../../src/components/user-menu/user-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAA2B,MAAM,KAAK,CAAC;AAKzE,OAAO,yCAAyC,CAAC;AACjD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,iCAAiC,CAAC;AACzC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAalC,oBAAY,eAAe;IACzB,MAAM,YAAY;IAClB,UAAU,iBAAiB;IAC3B,aAAa,oBAAoB;IACjC,QAAQ,cAAc;CACvB;AAED,oBAAY,eAAe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AO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,wBAAwB;IAiBhC,OAAO,CAAC,cAAc;IA2CtB,OAAO,CAAC,mBAAmB;IAkClB,MAAM;IAwCf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
|
|
@@ -48,21 +48,8 @@ let ObcUserMenu = class extends LitElement {
|
|
|
48
48
|
this.recentUsers = [];
|
|
49
49
|
this.signedInActions = [];
|
|
50
50
|
}
|
|
51
|
-
get
|
|
52
|
-
return
|
|
53
|
-
{ id: "calendar", label: msg("Calendar") },
|
|
54
|
-
{ id: "log", label: msg("Log") },
|
|
55
|
-
{ id: "preferences", label: msg("Preferences") },
|
|
56
|
-
{ id: "user-account", label: msg("User account") }
|
|
57
|
-
];
|
|
58
|
-
}
|
|
59
|
-
get defaultRecentUsers() {
|
|
60
|
-
const label = msg("Username");
|
|
61
|
-
return [
|
|
62
|
-
{ initials: "AB", label },
|
|
63
|
-
{ initials: "CD", label },
|
|
64
|
-
{ initials: "EF", label }
|
|
65
|
-
];
|
|
51
|
+
get showRecentUsers() {
|
|
52
|
+
return this.hasRecentlySignedIn && this.recentUsers.length > 0;
|
|
66
53
|
}
|
|
67
54
|
renderTextInput(placeholder, type = HTMLInputTypeAttribute.Text, value = "", onInput, errorText = "") {
|
|
68
55
|
const isPassword = type === HTMLInputTypeAttribute.Password;
|
|
@@ -83,7 +70,7 @@ let ObcUserMenu = class extends LitElement {
|
|
|
83
70
|
}
|
|
84
71
|
renderUserButtons(count, isLarge) {
|
|
85
72
|
const size = isLarge ? Size.large : Size.regular;
|
|
86
|
-
const users =
|
|
73
|
+
const users = this.recentUsers.slice(0, count);
|
|
87
74
|
return html`
|
|
88
75
|
<div
|
|
89
76
|
class=${classMap({
|
|
@@ -107,11 +94,11 @@ let ObcUserMenu = class extends LitElement {
|
|
|
107
94
|
</div>
|
|
108
95
|
`;
|
|
109
96
|
}
|
|
110
|
-
renderUserProfile(layout, size
|
|
97
|
+
renderUserProfile(layout, size) {
|
|
98
|
+
if (!this.userInitials && !this.userLabel) {
|
|
99
|
+
return nothing;
|
|
100
|
+
}
|
|
111
101
|
const userButtonSize = size === "large" ? Size.large : Size.regular;
|
|
112
|
-
const fallbackUser = this.recentUsers[0] ?? this.defaultRecentUsers[0];
|
|
113
|
-
const resolvedInitials = initials ?? this.userInitials ?? fallbackUser.initials;
|
|
114
|
-
const resolvedLabel = label ?? this.userLabel ?? fallbackUser.label;
|
|
115
102
|
return html`
|
|
116
103
|
<div
|
|
117
104
|
class=${classMap({
|
|
@@ -127,8 +114,8 @@ let ObcUserMenu = class extends LitElement {
|
|
|
127
114
|
.variant=${Variant.initials}
|
|
128
115
|
.styleType=${StyleType.normal}
|
|
129
116
|
.size=${userButtonSize}
|
|
130
|
-
.initials=${
|
|
131
|
-
.label=${
|
|
117
|
+
.initials=${this.userInitials ?? ""}
|
|
118
|
+
.label=${this.userLabel ?? ""}
|
|
132
119
|
></obc-user-button>
|
|
133
120
|
</div>
|
|
134
121
|
`;
|
|
@@ -232,7 +219,7 @@ let ObcUserMenu = class extends LitElement {
|
|
|
232
219
|
${msg("Sign in")}
|
|
233
220
|
</obc-button>
|
|
234
221
|
</div>
|
|
235
|
-
${this.
|
|
222
|
+
${this.showRecentUsers ? html`
|
|
236
223
|
<div class="recent-container">
|
|
237
224
|
<div class="title-container">
|
|
238
225
|
<div class="subtitle">${msg("Recently signed in")}</div>
|
|
@@ -272,8 +259,8 @@ let ObcUserMenu = class extends LitElement {
|
|
|
272
259
|
${msg("Sign in")}
|
|
273
260
|
</obc-button>
|
|
274
261
|
</div>
|
|
275
|
-
|
|
276
|
-
|
|
262
|
+
${this.showRecentUsers ? html`
|
|
263
|
+
<div class="divider" aria-hidden="true"></div>
|
|
277
264
|
<div class="recent-container recent">
|
|
278
265
|
<div class="title-container">
|
|
279
266
|
<div class="subtitle">${msg("Recent")}</div>
|
|
@@ -311,7 +298,7 @@ let ObcUserMenu = class extends LitElement {
|
|
|
311
298
|
</obc-button>
|
|
312
299
|
</div>
|
|
313
300
|
</div>
|
|
314
|
-
${this.
|
|
301
|
+
${this.showRecentUsers ? html`
|
|
315
302
|
<div class="recent-container">
|
|
316
303
|
<div class="title-container">
|
|
317
304
|
<div class="subtitle">${msg("Recently signed in")}</div>
|
|
@@ -347,8 +334,8 @@ let ObcUserMenu = class extends LitElement {
|
|
|
347
334
|
${msg("Sign in")}
|
|
348
335
|
</obc-button>
|
|
349
336
|
</div>
|
|
350
|
-
|
|
351
|
-
|
|
337
|
+
${this.showRecentUsers ? html`
|
|
338
|
+
<div class="divider" aria-hidden="true"></div>
|
|
352
339
|
<div class="recent-container recent">
|
|
353
340
|
<div class="title-container">
|
|
354
341
|
<div class="subtitle">${msg("Recent")}</div>
|
|
@@ -393,7 +380,6 @@ let ObcUserMenu = class extends LitElement {
|
|
|
393
380
|
`;
|
|
394
381
|
}
|
|
395
382
|
renderSignedIn() {
|
|
396
|
-
const actions = this.signedInActions.length ? this.signedInActions : this.defaultSignedInActions;
|
|
397
383
|
return html`
|
|
398
384
|
<div class="title-container">
|
|
399
385
|
<h3 class="title">${msg("User")}</h3>
|
|
@@ -402,24 +388,26 @@ let ObcUserMenu = class extends LitElement {
|
|
|
402
388
|
${this.renderUserProfile("vertical", "large")}
|
|
403
389
|
</div>
|
|
404
390
|
<div class="divider" aria-hidden="true"></div>
|
|
405
|
-
|
|
406
|
-
|
|
391
|
+
${this.signedInActions.length ? html`
|
|
392
|
+
<div class="nav-container">
|
|
393
|
+
${this.signedInActions.map((action) => {
|
|
407
394
|
const normalizedId = this.normalizeActionId(action.id);
|
|
408
395
|
return html`
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
396
|
+
<obc-navigation-item
|
|
397
|
+
.label=${action.label}
|
|
398
|
+
hasIcon
|
|
399
|
+
@click=${() => this.handleSignedInActionClick(action)}
|
|
400
|
+
>
|
|
401
|
+
<span slot="icon">
|
|
402
|
+
<slot name="signed-in-action-icon-${normalizedId}">
|
|
403
|
+
${this.getSignedInActionIcon(normalizedId)}
|
|
404
|
+
</slot>
|
|
405
|
+
</span>
|
|
406
|
+
</obc-navigation-item>
|
|
407
|
+
`;
|
|
421
408
|
})}
|
|
422
|
-
|
|
409
|
+
</div>
|
|
410
|
+
` : nothing}
|
|
423
411
|
<div class="button-container">
|
|
424
412
|
<obc-button
|
|
425
413
|
variant=${ButtonVariant.normal}
|
|
@@ -432,8 +420,9 @@ let ObcUserMenu = class extends LitElement {
|
|
|
432
420
|
`;
|
|
433
421
|
}
|
|
434
422
|
renderSignedInSmall() {
|
|
435
|
-
const
|
|
436
|
-
|
|
423
|
+
const primaryAction = this.signedInActions.find(
|
|
424
|
+
(action) => action.id === this.primaryActionId
|
|
425
|
+
);
|
|
437
426
|
return html`
|
|
438
427
|
<div class="title-container">
|
|
439
428
|
<h3 class="title">${msg("User")}</h3>
|
|
@@ -522,6 +511,9 @@ __decorateClass([
|
|
|
522
511
|
__decorateClass([
|
|
523
512
|
property({ type: Array, attribute: false })
|
|
524
513
|
], ObcUserMenu.prototype, "signedInActions", 2);
|
|
514
|
+
__decorateClass([
|
|
515
|
+
property({ type: String })
|
|
516
|
+
], ObcUserMenu.prototype, "primaryActionId", 2);
|
|
525
517
|
ObcUserMenu = __decorateClass([
|
|
526
518
|
customElement("obc-user-menu"),
|
|
527
519
|
localized()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-menu.js","sources":["../../../src/components/user-menu/user-menu.ts"],"sourcesContent":["import {LitElement, TemplateResult, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './user-menu.css?inline';\nimport '../text-input-field/text-input-field.js';\nimport '../button/button.js';\nimport '../user-button/user-button.js';\nimport '../progress-bar/progress-bar.js';\nimport '../navigation-item/navigation-item.js';\nimport '../../icons/icon-calendar-google.js';\nimport '../../icons/icon-log-open-google.js';\nimport '../../icons/icon-settings-iec.js';\nimport '../../icons/icon-user.js';\nimport {\n HTMLInputTypeAttribute,\n ObcTextInputFieldTextAlign,\n} from '../text-input-field/text-input-field.js';\nimport {ButtonVariant} from '../button/button.js';\nimport {\n ProgressBarMode,\n ProgressBarType,\n} from '../progress-bar/progress-bar.js';\nimport {Size, StyleType, Variant} from '../user-button/user-button.js';\nimport {localized, msg} from '@lit/localize';\n\nexport enum ObcUserMenuType {\n signIn = 'sign-in',\n userSignIn = 'user-sign-in',\n loadingSignIn = 'loading-sign-in',\n signedIn = 'signed-in',\n}\n\nexport enum ObcUserMenuSize {\n regular = 'regular',\n small = 'small',\n}\n\nexport type ObcUserMenuUser = {\n initials: string;\n label: string;\n};\n\nexport type ObcUserMenuSignedInAction = {\n id: string;\n label: string;\n};\n\n/**\n * `<obc-user-menu>` – A user menu component with sign-in and signed-in layouts.\n *\n * Provides multiple layouts for authentication and account access states, including\n * sign-in forms, user-specific sign-in, loading states, and signed-in navigation.\n *\n * ### Features\n * - **Multiple States:** Supports sign-in, user sign-in, loading, and signed-in layouts.\n * - **Size Options:** Regular and small sizes for compact layouts.\n * - **Recent Users:** Optional \"Recently signed in\" section for quick access.\n * - **Navigation Actions:** Signed-in state includes navigation items and actions.\n *\n * ### Variants\n * - `type`: `sign-in`, `user-sign-in`, `loading-sign-in`, `signed-in`\n * - `size`: `regular`, `small`\n *\n * ### Usage Guidelines\n * Use `obc-user-menu` in authentication or account panels where quick access to\n * sign-in, profile, or account actions is needed. The `user-sign-in` type is\n * best for fast re-auth flows; `loading-sign-in` is for pending auth states.\n *\n * ### Properties and Configuration\n * - `type` (`ObcUserMenuType`): Controls the layout state. Defaults to `sign-in`.\n * - `size` (`ObcUserMenuSize`): Controls the overall size. Defaults to `regular`.\n * - `hasRecentlySignedIn` (`boolean`): Toggles the recent users section.\n * Defaults to `true`.\n * - `username` (`string`): Current username value for sign-in layouts.\n * - `password` (`string`): Current password value for sign-in layouts.\n * - `usernameError` (`string`): Error message for the username field.\n * - `passwordError` (`string`): Error message for the password field.\n * - `userInitials` (`string`): Initials for the primary user profile.\n * - `userLabel` (`string`): Label for the primary user profile.\n * - `recentUsers` (`ObcUserMenuUser[]`): List of recent users shown in the\n * \"Recently signed in\" section.\n * - `signedInActions` (`ObcUserMenuSignedInAction[]`): Actions shown in the\n * signed-in navigation list.\n *\n * ### Events\n * - `sign-in-click` – Fired when a sign-in button is clicked.\n * - `sign-out-click` – Fired when the sign-out button is clicked.\n * - `signed-in-action-click` – Fired when a signed-in action is clicked.\n * - `recent-user-click` – Fired when a recent user button is clicked.\n *\n * ### Slots\n * - `signed-in-action-icon-{id}`: Optional icon for a signed-in action. The\n * `{id}` is the normalized action id.\n *\n * ### Example\n * ```html\n * <obc-user-menu\n * type=\"user-sign-in\"\n * size=\"small\"\n * hasRecentlySignedIn=\"false\"\n * userInitials=\"JD\"\n * userLabel=\"John Doe\"\n * ></obc-user-menu>\n * ```\n *\n * @property type - Controls the visual layout of the user menu.\n * @property size - Controls the overall size of the user menu.\n * @property hasRecentlySignedIn - Toggles the \"Recently signed in\" section visibility.\n * @availableWhen hasRecentlySignedIn type in [signIn, userSignIn]\n * @property username - Current username value for sign-in layouts.\n * @availableWhen username type==signIn\n * @property password - Current password value for sign-in layouts.\n * @availableWhen password type in [signIn, userSignIn]\n * @property usernameError - Error message for the username field.\n * @availableWhen usernameError type==signIn\n * @property passwordError - Error message for the password field.\n * @availableWhen passwordError type in [signIn, userSignIn]\n * @property userInitials - Initials for the primary user profile.\n * @availableWhen userInitials type!=signIn\n * @property userLabel - Label for the primary user profile.\n * @availableWhen userLabel type!=signIn\n * @property recentUsers - Recent users for the \"Recently signed in\" section.\n * @property signedInActions - Actions shown in the signed-in navigation list.\n * @availableWhen signedInActions type==signedIn\n * @slot signed-in-action-icon-<id> - Optional icon for a signed-in action, one per action; `<id>` is the normalized action id (shown in the `signed-in` type).\n * @fires {CustomEvent<{username: string, password: string}>} sign-in-click - Fired when a sign-in button is clicked.\n * @fires {CustomEvent<void>} sign-out-click - Fired when the sign-out button is clicked.\n * @fires {CustomEvent<{id: string, label: string}>} signed-in-action-click - Fired when a signed-in action is clicked.\n * @fires {CustomEvent<{initials: string, label: string}>} recent-user-click - Fired when a recent user button is clicked.\n * @stable\n */\n@customElement('obc-user-menu')\n@localized()\nexport class ObcUserMenu extends LitElement {\n @property({type: String}) type: ObcUserMenuType = ObcUserMenuType.signIn;\n\n @property({type: String}) size: ObcUserMenuSize = ObcUserMenuSize.regular;\n\n @property({type: Boolean})\n hasRecentlySignedIn = false;\n\n @property({type: String}) username = '';\n\n @property({type: String}) password = '';\n\n @property({type: String}) usernameError = '';\n\n @property({type: String}) passwordError = '';\n\n @property({type: String}) userInitials?: string;\n\n @property({type: String}) userLabel?: string;\n\n @property({type: Array, attribute: false})\n recentUsers: ObcUserMenuUser[] = [];\n\n @property({type: Array, attribute: false})\n signedInActions: ObcUserMenuSignedInAction[] = [];\n\n private get defaultSignedInActions() {\n return [\n {id: 'calendar', label: msg('Calendar')},\n {id: 'log', label: msg('Log')},\n {id: 'preferences', label: msg('Preferences')},\n {id: 'user-account', label: msg('User account')},\n ];\n }\n\n private get defaultRecentUsers() {\n const label = msg('Username');\n return [\n {initials: 'AB', label},\n {initials: 'CD', label},\n {initials: 'EF', label},\n ];\n }\n\n private renderTextInput(\n placeholder: string,\n type: HTMLInputTypeAttribute = HTMLInputTypeAttribute.Text,\n value = '',\n onInput?: (event: Event) => void,\n errorText = ''\n ) {\n const isPassword = type === HTMLInputTypeAttribute.Password;\n return html`\n <obc-text-input-field\n .placeholder=${placeholder}\n .type=${type}\n .textAlign=${ObcTextInputFieldTextAlign.Left}\n .value=${value}\n .error=${Boolean(errorText)}\n .errorText=${errorText}\n .required=${true}\n .hasClearButton=${!isPassword}\n @input=${onInput}\n >\n </obc-text-input-field>\n `;\n }\n\n private renderUserButtons(count: number, isLarge: boolean) {\n const size = isLarge ? Size.large : Size.regular;\n const users = (\n this.recentUsers.length ? this.recentUsers : this.defaultRecentUsers\n ).slice(0, count);\n return html`\n <div\n class=${classMap({\n users: true,\n large: isLarge,\n single: users.length === 1,\n })}\n >\n ${users.map(\n (user) => html`\n <obc-user-button\n .variant=${Variant.initials}\n .styleType=${StyleType.normal}\n .size=${size}\n .initials=${user.initials}\n .label=${user.label}\n @click=${() => this.handleRecentUserClick(user)}\n ></obc-user-button>\n `\n )}\n </div>\n `;\n }\n\n private renderUserProfile(\n layout: 'vertical' | 'horizontal',\n size: 'large' | 'regular',\n initials?: string,\n label?: string\n ) {\n const userButtonSize = size === 'large' ? Size.large : Size.regular;\n const fallbackUser = this.recentUsers[0] ?? this.defaultRecentUsers[0];\n const resolvedInitials =\n initials ?? this.userInitials ?? fallbackUser.initials;\n const resolvedLabel = label ?? this.userLabel ?? fallbackUser.label;\n return html`\n <div\n class=${classMap({\n 'user-profile': true,\n [layout]: true,\n })}\n >\n <obc-user-button\n class=${classMap({\n 'user-avatar': true,\n [`size-${size}`]: true,\n })}\n .variant=${Variant.initials}\n .styleType=${StyleType.normal}\n .size=${userButtonSize}\n .initials=${resolvedInitials}\n .label=${resolvedLabel}\n ></obc-user-button>\n </div>\n `;\n }\n\n private getSignedInActionIcon(actionId: string) {\n switch (actionId) {\n case 'calendar':\n return html`<obi-calendar-google></obi-calendar-google>`;\n case 'log':\n return html`<obi-log-open-google></obi-log-open-google>`;\n case 'preferences':\n return html`<obi-settings-iec></obi-settings-iec>`;\n case 'user-account':\n return html`<obi-user></obi-user>`;\n default:\n return nothing;\n }\n }\n\n private normalizeActionId(actionId: string) {\n return actionId\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-');\n }\n\n private handleSignedInActionClick(action: ObcUserMenuSignedInAction) {\n this.dispatchEvent(\n new CustomEvent('signed-in-action-click', {\n detail: {id: action.id, label: action.label},\n })\n );\n }\n\n private handleRecentUserClick(user: ObcUserMenuUser) {\n this.dispatchEvent(\n new CustomEvent('recent-user-click', {\n detail: {initials: user.initials, label: user.label},\n })\n );\n }\n\n private handleUsernameInput(event: Event) {\n const target = event.target as {value?: string};\n this.username = target.value ?? '';\n if (this.username) {\n this.usernameError = '';\n }\n }\n\n private handlePasswordInput(event: Event) {\n const target = event.target as {value?: string};\n this.password = target.value ?? '';\n if (this.password) {\n this.passwordError = '';\n }\n }\n\n private validateSignIn() {\n let valid = true;\n const needsUsername = this.type === ObcUserMenuType.signIn;\n\n if (needsUsername && !this.username) {\n this.usernameError = msg('Username is required');\n valid = false;\n }\n\n if (!this.password) {\n this.passwordError = msg('Password is required');\n valid = false;\n }\n\n return valid;\n }\n\n private handleSignInClick() {\n if (!this.validateSignIn()) {\n return;\n }\n this.dispatchEvent(\n new CustomEvent('sign-in-click', {\n detail: {username: this.username, password: this.password},\n })\n );\n }\n\n private handleSignOutClick() {\n this.dispatchEvent(new CustomEvent('sign-out-click'));\n }\n\n private renderSignIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"login-container\">\n ${this.renderTextInput(\n msg('Username'),\n HTMLInputTypeAttribute.Text,\n this.username,\n this.handleUsernameInput.bind(this),\n this.usernameError\n )}\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n ${this.hasRecentlySignedIn\n ? html`\n <div class=\"recent-container\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recently signed in')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, true)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderSignInSmall() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"login-container\">\n ${this.renderTextInput(\n msg('Username'),\n HTMLInputTypeAttribute.Text,\n this.username,\n this.handleUsernameInput.bind(this),\n this.usernameError\n )}\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n <div class=\"divider\" aria-hidden=\"true\"></div>\n ${this.hasRecentlySignedIn\n ? html`\n <div class=\"recent-container recent\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recent')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, false)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderUserSignIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"login-container\">\n <div class=\"user-primary\">\n ${this.renderUserProfile('vertical', 'large')}\n </div>\n <div class=\"fields\">\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n </div>\n ${this.hasRecentlySignedIn\n ? html`\n <div class=\"recent-container\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recently signed in')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, true)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderUserSignInSmall() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"user-container\">\n ${this.renderUserProfile('horizontal', 'regular')}\n </div>\n <div class=\"login-container\">\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n <div class=\"divider\" aria-hidden=\"true\"></div>\n ${this.hasRecentlySignedIn\n ? html`\n <div class=\"recent-container recent\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recent')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, false)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderLoadingSignIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"user-primary loading\">\n ${this.renderUserProfile('vertical', 'large')}\n <obc-progress-bar\n class=\"progress\"\n type=${ProgressBarType.linear}\n mode=${ProgressBarMode.indeterminate}\n .showValue=${false}\n ></obc-progress-bar>\n </div>\n `;\n }\n\n private renderLoadingSignInSmall() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"user-primary loading\">\n ${this.renderUserProfile('horizontal', 'regular')}\n <obc-progress-bar\n class=\"progress\"\n type=${ProgressBarType.linear}\n mode=${ProgressBarMode.indeterminate}\n .showValue=${false}\n ></obc-progress-bar>\n </div>\n `;\n }\n\n private renderSignedIn() {\n const actions = this.signedInActions.length\n ? this.signedInActions\n : this.defaultSignedInActions;\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('User')}</h3>\n </div>\n <div class=\"user-primary signed-in\">\n ${this.renderUserProfile('vertical', 'large')}\n </div>\n <div class=\"divider\" aria-hidden=\"true\"></div>\n <div class=\"nav-container\">\n ${actions.map((action) => {\n const normalizedId = this.normalizeActionId(action.id);\n return html`\n <obc-navigation-item\n .label=${action.label}\n hasIcon\n @click=${() => this.handleSignedInActionClick(action)}\n >\n <span slot=\"icon\">\n <slot name=\"signed-in-action-icon-${normalizedId}\">\n ${this.getSignedInActionIcon(normalizedId)}\n </slot>\n </span>\n </obc-navigation-item>\n `;\n })}\n </div>\n <div class=\"button-container\">\n <obc-button\n variant=${ButtonVariant.normal}\n fullWidth\n @click=${this.handleSignOutClick}\n >\n ${msg('Sign out')}\n </obc-button>\n </div>\n `;\n }\n\n private renderSignedInSmall() {\n const actions = this.signedInActions.length\n ? this.signedInActions\n : this.defaultSignedInActions;\n const primaryAction = actions[2];\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('User')}</h3>\n </div>\n <div class=\"user-container\">\n ${this.renderUserProfile('horizontal', 'regular')}\n </div>\n <div class=\"button-container\">\n ${primaryAction\n ? html`\n <obc-button\n variant=${ButtonVariant.normal}\n fullWidth\n @click=${() => this.handleSignedInActionClick(primaryAction)}\n >\n ${primaryAction.label}\n </obc-button>\n `\n : nothing}\n <obc-button\n variant=${ButtonVariant.normal}\n fullWidth\n @click=${this.handleSignOutClick}\n >\n ${msg('Sign out')}\n </obc-button>\n </div>\n `;\n }\n\n override render() {\n let content: TemplateResult | symbol = nothing;\n if (this.type === ObcUserMenuType.signIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderSignInSmall()\n : this.renderSignIn();\n }\n if (this.type === ObcUserMenuType.userSignIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderUserSignInSmall()\n : this.renderUserSignIn();\n }\n if (this.type === ObcUserMenuType.loadingSignIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderLoadingSignInSmall()\n : this.renderLoadingSignIn();\n }\n if (this.type === ObcUserMenuType.signedIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderSignedInSmall()\n : this.renderSignedIn();\n }\n\n return html`\n <div\n class=${classMap({\n card: true,\n [`size-${this.size}`]: true,\n [`type-${this.type}`]: true,\n })}\n >\n ${content}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\nd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AAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAhBb,YAgBe,WAAA,gBAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAlBb,YAkBe,WAAA,aAAA,CAAA;AAG1B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GApB9B,YAqBX,WAAA,eAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAvB9B,YAwBX,WAAA,mBAAA,CAAA;AAxBW,cAAN,gBAAA;AAAA,EAFN,cAAc,eAAe;AAAA,EAC7B,UAAA;AAAU,GACE,WAAA;"}
|
|
1
|
+
{"version":3,"file":"user-menu.js","sources":["../../../src/components/user-menu/user-menu.ts"],"sourcesContent":["import {LitElement, TemplateResult, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './user-menu.css?inline';\nimport '../text-input-field/text-input-field.js';\nimport '../button/button.js';\nimport '../user-button/user-button.js';\nimport '../progress-bar/progress-bar.js';\nimport '../navigation-item/navigation-item.js';\nimport '../../icons/icon-calendar-google.js';\nimport '../../icons/icon-log-open-google.js';\nimport '../../icons/icon-settings-iec.js';\nimport '../../icons/icon-user.js';\nimport {\n HTMLInputTypeAttribute,\n ObcTextInputFieldTextAlign,\n} from '../text-input-field/text-input-field.js';\nimport {ButtonVariant} from '../button/button.js';\nimport {\n ProgressBarMode,\n ProgressBarType,\n} from '../progress-bar/progress-bar.js';\nimport {Size, StyleType, Variant} from '../user-button/user-button.js';\nimport {localized, msg} from '@lit/localize';\n\nexport enum ObcUserMenuType {\n signIn = 'sign-in',\n userSignIn = 'user-sign-in',\n loadingSignIn = 'loading-sign-in',\n signedIn = 'signed-in',\n}\n\nexport enum ObcUserMenuSize {\n regular = 'regular',\n small = 'small',\n}\n\nexport type ObcUserMenuUser = {\n initials: string;\n label: string;\n};\n\nexport type ObcUserMenuSignedInAction = {\n id: string;\n label: string;\n};\n\n/**\n * `<obc-user-menu>` – A user menu component with sign-in and signed-in layouts.\n *\n * Provides multiple layouts for authentication and account access states, including\n * sign-in forms, user-specific sign-in, loading states, and signed-in navigation.\n *\n * ### Features\n * - **Multiple States:** Supports sign-in, user sign-in, loading, and signed-in layouts.\n * - **Size Options:** Regular and small sizes for compact layouts.\n * - **Recent Users:** Optional \"Recently signed in\" section for quick access.\n * - **Navigation Actions:** Signed-in state lists the actions it is given.\n *\n * ### Variants\n * - `type`: `sign-in`, `user-sign-in`, `loading-sign-in`, `signed-in`\n * - `size`: `regular`, `small`\n *\n * ### Usage Guidelines\n * Use `obc-user-menu` in authentication or account panels where quick access to\n * sign-in, profile, or account actions is needed. The `user-sign-in` type is\n * best for fast re-auth flows; `loading-sign-in` is for pending auth states.\n *\n * ### Properties and Configuration\n * - `type` (`ObcUserMenuType`): Controls the layout state. Defaults to `sign-in`.\n * - `size` (`ObcUserMenuSize`): Controls the overall size. Defaults to `regular`.\n * - `hasRecentlySignedIn` (`boolean`): Toggles the recent users section.\n * Defaults to `false`.\n * - `username` (`string`): Current username value for sign-in layouts.\n * - `password` (`string`): Current password value for sign-in layouts.\n * - `usernameError` (`string`): Error message for the username field.\n * - `passwordError` (`string`): Error message for the password field.\n * - `userInitials` (`string`): Initials for the primary user profile.\n * - `userLabel` (`string`): Label for the primary user profile.\n * - `recentUsers` (`ObcUserMenuUser[]`): List of recent users shown in the\n * \"Recently signed in\" section. Empty renders no section.\n * - `signedInActions` (`ObcUserMenuSignedInAction[]`): Actions shown in the\n * signed-in navigation list. Empty renders no actions.\n * - `primaryActionId` (`string`): Id of the action promoted to a button in the\n * small signed-in layout.\n *\n * ### Events\n * - `sign-in-click` – Fired when a sign-in button is clicked.\n * - `sign-out-click` – Fired when the sign-out button is clicked.\n * - `signed-in-action-click` – Fired when a signed-in action is clicked.\n * - `recent-user-click` – Fired when a recent user button is clicked.\n *\n * ### Slots\n * - `signed-in-action-icon-{id}`: Optional icon for a signed-in action. The\n * `{id}` is the normalized action id.\n *\n * ### Example\n * ```html\n * <obc-user-menu\n * type=\"user-sign-in\"\n * size=\"small\"\n * hasRecentlySignedIn=\"false\"\n * userInitials=\"JD\"\n * userLabel=\"John Doe\"\n * ></obc-user-menu>\n * ```\n *\n * @property type - Controls the visual layout of the user menu.\n * @property size - Controls the overall size of the user menu.\n * @property hasRecentlySignedIn - Toggles the \"Recently signed in\" section visibility.\n * @availableWhen hasRecentlySignedIn type in [signIn, userSignIn]\n * @property username - Current username value for sign-in layouts.\n * @availableWhen username type==signIn\n * @property password - Current password value for sign-in layouts.\n * @availableWhen password type in [signIn, userSignIn]\n * @property usernameError - Error message for the username field.\n * @availableWhen usernameError type==signIn\n * @property passwordError - Error message for the password field.\n * @availableWhen passwordError type in [signIn, userSignIn]\n * @property userInitials - Initials for the primary user profile.\n * @availableWhen userInitials type!=signIn\n * @property userLabel - Label for the primary user profile.\n * @availableWhen userLabel type!=signIn\n * @property recentUsers - Recent users for the \"Recently signed in\" section.\n * @property signedInActions - Actions shown in the signed-in navigation list.\n * @availableWhen signedInActions type==signedIn\n * @property primaryActionId - Id of the action promoted to a button in the small signed-in layout.\n * @availableWhen primaryActionId type==signedIn && size==small\n * @slot signed-in-action-icon-<id> - Optional icon for a signed-in action, one per action; `<id>` is the normalized action id (shown in the `signed-in` type).\n * @fires {CustomEvent<{username: string, password: string}>} sign-in-click - Fired when a sign-in button is clicked.\n * @fires {CustomEvent<void>} sign-out-click - Fired when the sign-out button is clicked.\n * @fires {CustomEvent<{id: string, label: string}>} signed-in-action-click - Fired when a signed-in action is clicked.\n * @fires {CustomEvent<{initials: string, label: string}>} recent-user-click - Fired when a recent user button is clicked.\n * @stable\n */\n@customElement('obc-user-menu')\n@localized()\nexport class ObcUserMenu extends LitElement {\n @property({type: String}) type: ObcUserMenuType = ObcUserMenuType.signIn;\n\n @property({type: String}) size: ObcUserMenuSize = ObcUserMenuSize.regular;\n\n @property({type: Boolean})\n hasRecentlySignedIn = false;\n\n @property({type: String}) username = '';\n\n @property({type: String}) password = '';\n\n @property({type: String}) usernameError = '';\n\n @property({type: String}) passwordError = '';\n\n @property({type: String}) userInitials?: string;\n\n @property({type: String}) userLabel?: string;\n\n @property({type: Array, attribute: false})\n recentUsers: ObcUserMenuUser[] = [];\n\n @property({type: Array, attribute: false})\n signedInActions: ObcUserMenuSignedInAction[] = [];\n\n @property({type: String}) primaryActionId?: string;\n\n private get showRecentUsers() {\n return this.hasRecentlySignedIn && this.recentUsers.length > 0;\n }\n\n private renderTextInput(\n placeholder: string,\n type: HTMLInputTypeAttribute = HTMLInputTypeAttribute.Text,\n value = '',\n onInput?: (event: Event) => void,\n errorText = ''\n ) {\n const isPassword = type === HTMLInputTypeAttribute.Password;\n return html`\n <obc-text-input-field\n .placeholder=${placeholder}\n .type=${type}\n .textAlign=${ObcTextInputFieldTextAlign.Left}\n .value=${value}\n .error=${Boolean(errorText)}\n .errorText=${errorText}\n .required=${true}\n .hasClearButton=${!isPassword}\n @input=${onInput}\n >\n </obc-text-input-field>\n `;\n }\n\n private renderUserButtons(count: number, isLarge: boolean) {\n const size = isLarge ? Size.large : Size.regular;\n const users = this.recentUsers.slice(0, count);\n return html`\n <div\n class=${classMap({\n users: true,\n large: isLarge,\n single: users.length === 1,\n })}\n >\n ${users.map(\n (user) => html`\n <obc-user-button\n .variant=${Variant.initials}\n .styleType=${StyleType.normal}\n .size=${size}\n .initials=${user.initials}\n .label=${user.label}\n @click=${() => this.handleRecentUserClick(user)}\n ></obc-user-button>\n `\n )}\n </div>\n `;\n }\n\n private renderUserProfile(\n layout: 'vertical' | 'horizontal',\n size: 'large' | 'regular'\n ) {\n if (!this.userInitials && !this.userLabel) {\n return nothing;\n }\n const userButtonSize = size === 'large' ? Size.large : Size.regular;\n return html`\n <div\n class=${classMap({\n 'user-profile': true,\n [layout]: true,\n })}\n >\n <obc-user-button\n class=${classMap({\n 'user-avatar': true,\n [`size-${size}`]: true,\n })}\n .variant=${Variant.initials}\n .styleType=${StyleType.normal}\n .size=${userButtonSize}\n .initials=${this.userInitials ?? ''}\n .label=${this.userLabel ?? ''}\n ></obc-user-button>\n </div>\n `;\n }\n\n private getSignedInActionIcon(actionId: string) {\n switch (actionId) {\n case 'calendar':\n return html`<obi-calendar-google></obi-calendar-google>`;\n case 'log':\n return html`<obi-log-open-google></obi-log-open-google>`;\n case 'preferences':\n return html`<obi-settings-iec></obi-settings-iec>`;\n case 'user-account':\n return html`<obi-user></obi-user>`;\n default:\n return nothing;\n }\n }\n\n private normalizeActionId(actionId: string) {\n return actionId\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-');\n }\n\n private handleSignedInActionClick(action: ObcUserMenuSignedInAction) {\n this.dispatchEvent(\n new CustomEvent('signed-in-action-click', {\n detail: {id: action.id, label: action.label},\n })\n );\n }\n\n private handleRecentUserClick(user: ObcUserMenuUser) {\n this.dispatchEvent(\n new CustomEvent('recent-user-click', {\n detail: {initials: user.initials, label: user.label},\n })\n );\n }\n\n private handleUsernameInput(event: Event) {\n const target = event.target as {value?: string};\n this.username = target.value ?? '';\n if (this.username) {\n this.usernameError = '';\n }\n }\n\n private handlePasswordInput(event: Event) {\n const target = event.target as {value?: string};\n this.password = target.value ?? '';\n if (this.password) {\n this.passwordError = '';\n }\n }\n\n private validateSignIn() {\n let valid = true;\n const needsUsername = this.type === ObcUserMenuType.signIn;\n\n if (needsUsername && !this.username) {\n this.usernameError = msg('Username is required');\n valid = false;\n }\n\n if (!this.password) {\n this.passwordError = msg('Password is required');\n valid = false;\n }\n\n return valid;\n }\n\n private handleSignInClick() {\n if (!this.validateSignIn()) {\n return;\n }\n this.dispatchEvent(\n new CustomEvent('sign-in-click', {\n detail: {username: this.username, password: this.password},\n })\n );\n }\n\n private handleSignOutClick() {\n this.dispatchEvent(new CustomEvent('sign-out-click'));\n }\n\n private renderSignIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"login-container\">\n ${this.renderTextInput(\n msg('Username'),\n HTMLInputTypeAttribute.Text,\n this.username,\n this.handleUsernameInput.bind(this),\n this.usernameError\n )}\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n ${this.showRecentUsers\n ? html`\n <div class=\"recent-container\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recently signed in')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, true)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderSignInSmall() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"login-container\">\n ${this.renderTextInput(\n msg('Username'),\n HTMLInputTypeAttribute.Text,\n this.username,\n this.handleUsernameInput.bind(this),\n this.usernameError\n )}\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n ${this.showRecentUsers\n ? html`\n <div class=\"divider\" aria-hidden=\"true\"></div>\n <div class=\"recent-container recent\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recent')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, false)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderUserSignIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"login-container\">\n <div class=\"user-primary\">\n ${this.renderUserProfile('vertical', 'large')}\n </div>\n <div class=\"fields\">\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n </div>\n ${this.showRecentUsers\n ? html`\n <div class=\"recent-container\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recently signed in')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, true)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderUserSignInSmall() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"user-container\">\n ${this.renderUserProfile('horizontal', 'regular')}\n </div>\n <div class=\"login-container\">\n ${this.renderTextInput(\n msg('Password'),\n HTMLInputTypeAttribute.Password,\n this.password,\n this.handlePasswordInput.bind(this),\n this.passwordError\n )}\n <obc-button\n variant=${ButtonVariant.raised}\n fullWidth\n @click=${this.handleSignInClick}\n >\n ${msg('Sign in')}\n </obc-button>\n </div>\n ${this.showRecentUsers\n ? html`\n <div class=\"divider\" aria-hidden=\"true\"></div>\n <div class=\"recent-container recent\">\n <div class=\"title-container\">\n <div class=\"subtitle\">${msg('Recent')}</div>\n </div>\n <div class=\"actions-container\">\n ${this.renderUserButtons(3, false)}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n\n private renderLoadingSignIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"user-primary loading\">\n ${this.renderUserProfile('vertical', 'large')}\n <obc-progress-bar\n class=\"progress\"\n type=${ProgressBarType.linear}\n mode=${ProgressBarMode.indeterminate}\n .showValue=${false}\n ></obc-progress-bar>\n </div>\n `;\n }\n\n private renderLoadingSignInSmall() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('Sign in')}</h3>\n </div>\n <div class=\"user-primary loading\">\n ${this.renderUserProfile('horizontal', 'regular')}\n <obc-progress-bar\n class=\"progress\"\n type=${ProgressBarType.linear}\n mode=${ProgressBarMode.indeterminate}\n .showValue=${false}\n ></obc-progress-bar>\n </div>\n `;\n }\n\n private renderSignedIn() {\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('User')}</h3>\n </div>\n <div class=\"user-primary signed-in\">\n ${this.renderUserProfile('vertical', 'large')}\n </div>\n <div class=\"divider\" aria-hidden=\"true\"></div>\n ${this.signedInActions.length\n ? html`\n <div class=\"nav-container\">\n ${this.signedInActions.map((action) => {\n const normalizedId = this.normalizeActionId(action.id);\n return html`\n <obc-navigation-item\n .label=${action.label}\n hasIcon\n @click=${() => this.handleSignedInActionClick(action)}\n >\n <span slot=\"icon\">\n <slot name=\"signed-in-action-icon-${normalizedId}\">\n ${this.getSignedInActionIcon(normalizedId)}\n </slot>\n </span>\n </obc-navigation-item>\n `;\n })}\n </div>\n `\n : nothing}\n <div class=\"button-container\">\n <obc-button\n variant=${ButtonVariant.normal}\n fullWidth\n @click=${this.handleSignOutClick}\n >\n ${msg('Sign out')}\n </obc-button>\n </div>\n `;\n }\n\n private renderSignedInSmall() {\n const primaryAction = this.signedInActions.find(\n (action) => action.id === this.primaryActionId\n );\n return html`\n <div class=\"title-container\">\n <h3 class=\"title\">${msg('User')}</h3>\n </div>\n <div class=\"user-container\">\n ${this.renderUserProfile('horizontal', 'regular')}\n </div>\n <div class=\"button-container\">\n ${primaryAction\n ? html`\n <obc-button\n variant=${ButtonVariant.normal}\n fullWidth\n @click=${() => this.handleSignedInActionClick(primaryAction)}\n >\n ${primaryAction.label}\n </obc-button>\n `\n : nothing}\n <obc-button\n variant=${ButtonVariant.normal}\n fullWidth\n @click=${this.handleSignOutClick}\n >\n ${msg('Sign out')}\n </obc-button>\n </div>\n `;\n }\n\n override render() {\n let content: TemplateResult | symbol = nothing;\n if (this.type === ObcUserMenuType.signIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderSignInSmall()\n : this.renderSignIn();\n }\n if (this.type === ObcUserMenuType.userSignIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderUserSignInSmall()\n : this.renderUserSignIn();\n }\n if (this.type === ObcUserMenuType.loadingSignIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderLoadingSignInSmall()\n : this.renderLoadingSignIn();\n }\n if (this.type === ObcUserMenuType.signedIn) {\n content =\n this.size === ObcUserMenuSize.small\n ? this.renderSignedInSmall()\n : this.renderSignedIn();\n }\n\n return html`\n <div\n class=${classMap({\n card: true,\n [`size-${this.size}`]: true,\n [`type-${this.type}`]: true,\n })}\n >\n ${content}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-user-menu': ObcUserMenu;\n }\n}\n"],"names":["ObcUserMenuType","ObcUserMenuSize"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAK,oCAAAA,qBAAL;AACLA,mBAAA,QAAA,IAAS;AACTA,mBAAA,YAAA,IAAa;AACbA,mBAAA,eAAA,IAAgB;AAChBA,mBAAA,UAAA,IAAW;AAJD,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;AAOL,IAAK,oCAAAC,qBAAL;AACLA,mBAAA,SAAA,IAAU;AACVA,mBAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;AAyGL,IAAM,cAAN,cAA0B,WAAW;AAAA,EAArC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,OAAwB;AAExB,SAAA,OAAwB;AAGlD,SAAA,sBAAsB;AAEI,SAAA,WAAW;AAEX,SAAA,WAAW;AAEX,SAAA,gBAAgB;AAEhB,SAAA,gBAAgB;AAO1C,SAAA,cAAiC,CAAA;AAGjC,SAAA,kBAA+C,CAAA;AAAA,EAAC;AAAA,EAIhD,IAAY,kBAAkB;AA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