@albi_scando/as-design-system-lib 1.0.0 → 1.1.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.
Files changed (25) hide show
  1. package/README.md +2 -0
  2. package/dist/as-design-system-lib.es.js +671 -2
  3. package/dist/as-design-system-lib.umd.js +46 -1
  4. package/dist/types/constants/application.constant.d.ts +1 -1
  5. package/dist/types/main.d.ts +7 -0
  6. package/dist/types/web-components/buttons/base-button/component.d.ts +137 -0
  7. package/dist/types/web-components/buttons/base-button/main.d.ts +2 -0
  8. package/dist/types/web-components/buttons/base-button/selector.d.ts +4 -0
  9. package/dist/types/web-components/buttons/confirm-button/component.d.ts +31 -0
  10. package/dist/types/web-components/buttons/confirm-button/main.d.ts +2 -0
  11. package/dist/types/web-components/buttons/confirm-button/selector.d.ts +4 -0
  12. package/dist/types/web-components/buttons/undo-button/component.d.ts +27 -0
  13. package/dist/types/web-components/buttons/undo-button/main.d.ts +2 -0
  14. package/dist/types/web-components/buttons/undo-button/selector.d.ts +4 -0
  15. package/dist/types/web-components/dialogs/base-dialog/component.d.ts +92 -0
  16. package/dist/types/web-components/dialogs/base-dialog/main.d.ts +2 -0
  17. package/dist/types/web-components/dialogs/base-dialog/selector.d.ts +4 -0
  18. package/dist/types/web-components/dialogs/confirmation-dialog/component.d.ts +65 -0
  19. package/dist/types/web-components/dialogs/confirmation-dialog/main.d.ts +2 -0
  20. package/dist/types/web-components/dialogs/confirmation-dialog/selector.d.ts +4 -0
  21. package/dist/types/web-components/dialogs/header-body-footer-dialog/component.d.ts +25 -0
  22. package/dist/types/web-components/dialogs/header-body-footer-dialog/main.d.ts +2 -0
  23. package/dist/types/web-components/dialogs/header-body-footer-dialog/selector.d.ts +4 -0
  24. package/dist/types/web-components/registry.d.ts +41 -0
  25. package/package.json +53 -32
@@ -1 +1,46 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e["as-design-system-lib"]={}))})(this,(function(e){"use strict";const i="as-design-system-lib";e.APPLICATION_NAME=i,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(i,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i["as-design-system-lib"]={}))})(this,(function(i){"use strict";const a="as-design-system-lib";class w{constructor(t=new Map){this.registerAllComponents(t)}registerAllComponents(t){Array.from(t.entries()).forEach(([r,l])=>{this.registerComponent(r,l)})}registerComponent(t,r){customElements.get(t)===void 0?(customElements.define(t,r),console.log(`Registered Web Component: ${t}`)):console.warn(`Web Component "${t}" is already registered.`)}}const S="base-button",o="",d={SHOW_MODAL:"show-modal",CLOSE:"close"};`${btoa({CUSTOM_CROSSHAIR:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
2
+ <!-- White border (underneath) -->
3
+ <line x1="16" y1="2" x2="16" y2="30" stroke="white" stroke-width="5"/>
4
+ <line x1="2" y1="16" x2="30" y2="16" stroke="white" stroke-width="5"/>
5
+
6
+ <!-- Black crosshair lines (on top) -->
7
+ <line x1="16" y1="2" x2="16" y2="30" stroke="black" stroke-width="2"/>
8
+ <line x1="2" y1="16" x2="30" y2="16" stroke="black" stroke-width="2"/>
9
+ </svg>`}.CUSTOM_CROSSHAIR)}`;const c={ANY:"any",NONE:"none"},h={CLICK:"click"},k=`<button part="button">
10
+ <slot></slot>
11
+ </button>
12
+ `,x=":where(button,input[type=button],input[type=submit],input[type=reset]),:where(input[type=file])::file-selector-button{cursor:pointer;touch-action:manipulation;font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);font-family:var(--font-family-base);letter-spacing:var(--letter-spacing-normal);line-height:var(--line-height-normal);background:var(--color-primary);color:#fff;border:var(--border-width-0) solid transparent;border-radius:var(--border-radius-lg);padding-block:var(--button-padding-block-md);padding-inline:var(--button-padding-inline-md);display:inline-flex;justify-content:center;align-items:center;text-align:center;gap:var(--gap-sm);box-shadow:var(--shadow-md);transition:all var(--transition-base);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}:where(button,input[type=button],input[type=submit],input[type=reset])>:where(svg,[data-icon]){block-size:var(--font-size-md);inline-size:var(--font-size-md);stroke:var(--icon-color, currentColor);flex-shrink:0;fill:none;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--transition-fast)}:where(button,input[type=button],input[type=submit],input[type=reset])>.material-symbols-outlined{font-size:var(--font-size-xl);font-family:Material Symbols Outlined;font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;fill:currentColor;stroke:none}:where(button,input):where(:not(:active)):focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}:where(button,input[type=button],input[type=submit],input[type=reset]):where(:not(:active):hover){background:var(--color-primary-light);box-shadow:var(--shadow-lg);transform:translateY(-1px)}:where(button,input[type=button],input[type=submit],input[type=reset]):where(:active){background:var(--color-primary-dark);box-shadow:var(--shadow-md);transform:translateY(0)}:where(button,input[type=button],input[type=submit],input[type=reset])[disabled]{opacity:.6;box-shadow:var(--shadow-none);opacity:.3;cursor:not-allowed;box-shadow:var(--_shadow-1)}:where([type=reset]):focus-visible{outline-color:currentColor}:where(input[type=file]){inline-size:100%;max-inline-size:max-content;background-color:var(--color-bg-secondary)}:where(input[type=button]),:where(input[type=file])::file-selector-button{appearance:none}:where(input[type=file])::file-selector-button{margin-inline-end:var(--button-padding-inline-md)}",p=new CSSStyleSheet;p.replaceSync(x);class e extends HTMLElement{static autofocusAttribute="autofocus";static commandAttribute="command";static commandforAttribute="commandfor";static disabledAttribute="disabled";static nameAttribute="name";static titleAttribute="title";static typeAttribute="type";static valueAttribute="value";constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(p)}static get observedAttributes(){return[e.autofocusAttribute,e.commandAttribute,e.commandforAttribute,e.disabledAttribute,e.nameAttribute,e.titleAttribute,e.typeAttribute,e.valueAttribute]}get buttonElement(){return this.shadowRoot?.querySelector("button")}get autofocus(){return this.hasAttribute(e.autofocusAttribute)}set autofocus(t){t?this.setAttribute(e.autofocusAttribute,o):this.removeAttribute(e.autofocusAttribute)}get command(){return this.getAttribute(e.commandAttribute)??o}set command(t){this.setAttribute(e.commandAttribute,t)}get commandfor(){return this.getAttribute(e.commandforAttribute)??o}set commandfor(t){t!==o?this.setAttribute(e.commandforAttribute,t):this.removeAttribute(e.commandforAttribute)}get disabled(){return this.hasAttribute(e.disabledAttribute)}set disabled(t){t?this.setAttribute(e.disabledAttribute,o):this.removeAttribute(e.disabledAttribute)}get name(){return this.getAttribute(e.nameAttribute)??o}set name(t){t!==o?this.setAttribute(e.nameAttribute,t):this.removeAttribute(e.nameAttribute)}get headline(){return this.getAttribute(e.titleAttribute)??o}set headline(t){t!==o?this.setAttribute(e.titleAttribute,t):this.removeAttribute(e.titleAttribute)}get type(){return this.getAttribute(e.typeAttribute)??"button"}set type(t){t!==o?this.setAttribute(e.typeAttribute,t):this.removeAttribute(e.typeAttribute)}get value(){return this.getAttribute(e.valueAttribute)??"button"}set value(t){t!==o?this.setAttribute(e.valueAttribute,t):this.removeAttribute(e.valueAttribute)}connectedCallback(){this._render(),this._addEventListeners()}disconnectedCallback(){this._removeEventListeners()}attributeChangedCallback(t,r,l){l!==r&&this._syncAttribute(t)}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=k,this._syncAttributes())}_addEventListeners(){this.addEventListener(h.CLICK,this._handleClick)}_removeEventListeners(){this.removeEventListener(h.CLICK,this._handleClick)}_handleClick=()=>{if(this.command===o||this.commandfor===o)return;const t=document.getElementById(this.commandfor);if(t===null)return;const r=t;switch(this.command){case d.SHOW_MODAL:r.showModal?.();break;case d.CLOSE:r.close?.();break}};_syncAttribute(t){const r=this.buttonElement;this.hasAttribute(t)?r.setAttribute(t,this.getAttribute(t)??o):r.removeAttribute(t)}_syncAttributes(){e.observedAttributes.forEach(t=>{this._syncAttribute(t)})}}const E="undo-button",L=`<button title="Undo" part="button">
13
+ <span class="material-symbols-outlined">undo</span>
14
+ <span>Undo</span>
15
+ </button>
16
+ `,R=":host{display:inline-block}button[part=button]{background:var(--color-warning);color:#fff;font-weight:var(--font-weight-medium);padding-block:var(--button-padding-block-md);padding-inline:var(--button-padding-inline-md);border-radius:var(--border-radius-lg);border:none;box-shadow:var(--shadow-md);transition:all var(--transition-base);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--gap-sm)}button[part=button]:hover{background:linear-gradient(135deg,var(--color-warning),var(--color-warning));opacity:.9;box-shadow:var(--shadow-lg);transform:translateY(-2px)}button[part=button]:active{transform:translateY(0);box-shadow:var(--shadow-sm)}button[part=button]:focus-visible{outline:2px solid var(--color-warning);outline-offset:2px}button[part=button]:disabled{opacity:.5;cursor:not-allowed;transform:none}",g=new CSSStyleSheet;g.replaceSync(R);class C extends e{constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(g),this.command=d.CLOSE,this.title="Undo"}static get observedAttributes(){return e.observedAttributes}connectedCallback(){this._render(),this._setCommandForAttribute(),this._addEventListeners()}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=L,this._syncAttributes())}_setCommandForAttribute(){let t=this.getRootNode();"host"in t&&t.host!==null&&t.host!==void 0&&(t=t.host);const r=t instanceof Element?t.closest("base-dialog")??t.closest("confirmation-dialog"):null;r!==null&&(this.commandfor=r.id)}}const M=`<button title="Confirm" part="button">
17
+ <span class="material-symbols-outlined">check</span>
18
+ <span>Confirm</span>
19
+ </button>
20
+ `,_=":host{display:inline-block}button[part=button]{background:var(--color-success);color:#fff;font-weight:var(--font-weight-medium);padding-block:var(--button-padding-block-md);padding-inline:var(--button-padding-inline-md);border-radius:var(--border-radius-lg);border:none;box-shadow:var(--shadow-md);transition:all var(--transition-base);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--gap-sm)}button[part=button]:hover{background:linear-gradient(135deg,var(--color-success),var(--color-success));opacity:.9;box-shadow:var(--shadow-lg);transform:translateY(-2px)}button[part=button]:active{transform:translateY(0);box-shadow:var(--shadow-sm)}button[part=button]:focus-visible{outline:2px solid var(--color-success);outline-offset:2px}button[part=button]:disabled{opacity:.5;cursor:not-allowed;transform:none}",m=new CSSStyleSheet;m.replaceSync(_);class T extends e{constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(m),this.command=d.CLOSE,this.title="Confirm"}static get observedAttributes(){return e.observedAttributes}connectedCallback(){this._render(),this._setCommandForAttribute(),this._addEventListeners()}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=M,this._syncAttributes())}_setCommandForAttribute(){let t=this.getRootNode();"host"in t&&t.host!==null&&t.host!==void 0&&(t=t.host);const r=t instanceof Element?t.closest("base-dialog")??t.closest("confirmation-dialog"):null;r!==null&&(this.commandfor=r.id)}}const H="confirm-button",$="base-dialog",O=`<dialog part="dialog">
21
+ <slot></slot>
22
+ </dialog>
23
+ `,I="dialog{background-color:var(--color-bg-primary);color:var(--color-text-primary);border:var(--border-width-0) solid transparent;border-radius:var(--border-radius-2xl);padding:var(--spacing-8);max-width:90vw;max-height:90vh;font-size:var(--font-size-md);font-family:var(--font-family-base);line-height:var(--line-height-normal);box-shadow:var(--shadow-2xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:dialogSlideIn var(--transition-base) ease-out}dialog::backdrop{background:#00000080;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:backdropFadeIn var(--transition-base) ease-out}@keyframes dialogSlideIn{0%{opacity:0;transform:scale(.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes backdropFadeIn{0%{opacity:0}to{opacity:1}}",f=new CSSStyleSheet;f.replaceSync(I);class n extends HTMLElement{static closedByAttribute="closedby";_closedBy=c.ANY;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(f)}static get observedAttributes(){return[n.closedByAttribute]}get dialogElement(){return this.shadowRoot?.querySelector("dialog")}get command(){return this.getAttribute(n.closedByAttribute)??c.ANY}get closedBy(){return this._closedBy}set closedBy(t){this._closedBy=t,this.setAttribute(n.closedByAttribute,t)}connectedCallback(){this._render(),this._addEventListeners()}disconnectedCallback(){this._removeEventListeners()}attributeChangedCallback(t,r,l){const A=this.dialogElement;A!=null&&l!==r&&this._syncAttribute(t)}_addEventListeners(){}_removeEventListeners(){}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=O,this._syncAttributes())}_syncAttribute(t){const r=this.dialogElement;r!=null&&(this.hasAttribute(t)===!0?r.setAttribute(t,this.getAttribute(t)??o):r.removeAttribute(t))}_syncAttributes(){n.observedAttributes.forEach(t=>{this._syncAttribute(t)})}show(){this.dialogElement.show()}showModal(){this.dialogElement.showModal()}close(t){this.dialogElement.close(t)}}const z="confirmation-dialog",N=`<dialog part="dialog">
24
+ <header part="header">
25
+ <h2></h2>
26
+ </header>
27
+ <div part="body">
28
+ <p></p>
29
+ </div>
30
+ <footer part="footer">
31
+ <confirm-button></confirm-button>
32
+ <undo-button></undo-button>
33
+ </footer>
34
+ </dialog>
35
+ `,W="section.header{display:flex;flex-direction:column;gap:var(--gap-md);padding-bottom:var(--spacing-4);border-bottom:var(--border-width-1) solid var(--color-border-tertiary)}section.footer{display:flex;gap:var(--gap-md);justify-content:flex-end;padding-top:var(--spacing-6);border-top:var(--border-width-1) solid var(--color-border-tertiary)}h2{margin:0;font-size:var(--font-size-2xl);font-weight:var(--font-weight-bold);color:var(--color-text-primary);letter-spacing:var(--letter-spacing-normal);line-height:var(--line-height-tight)}p{margin:0;font-size:var(--font-size-md);color:var(--color-text-secondary);line-height:var(--line-height-relaxed);letter-spacing:var(--letter-spacing-normal)}",Y=`<dialog part="dialog">
36
+ <header part="header">
37
+ <slot name="header"></slot>
38
+ </header>
39
+ <div part="body">
40
+ <slot name="body"></slot>
41
+ </div>
42
+ <footer part="footer">
43
+ <slot name="footer"></slot>
44
+ </footer>
45
+ </dialog>
46
+ `,F="dialog{background-color:var(--color-bg-primary);color:var(--color-text-primary);border:var(--border-width-0) solid transparent;border-radius:var(--border-radius-2xl);padding:0;max-width:90vw;max-height:90vh;font-size:var(--font-size-md);font-family:var(--font-family-base);line-height:var(--line-height-normal);box-shadow:var(--shadow-2xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:dialogSlideIn var(--transition-base) ease-out}dialog[part=dialog] header[part=header],dialog[part=dialog] div[part=body],dialog[part=dialog] footer[part=footer]{padding:var(--spacing-8)}dialog[part=dialog] header[part=header]{border-bottom:var(--border-width-1) solid var(--color-border-tertiary);padding-bottom:var(--spacing-6)}dialog[part=dialog] footer[part=footer]{border-top:var(--border-width-1) solid var(--color-border-tertiary);padding-top:var(--spacing-6);display:flex;gap:var(--gap-lg);justify-content:flex-end}dialog::backdrop{background:#00000080;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:backdropFadeIn var(--transition-base) ease-out}@keyframes dialogSlideIn{0%{opacity:0;transform:scale(.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes backdropFadeIn{0%{opacity:0}to{opacity:1}}",y=new CSSStyleSheet;y.replaceSync(F);class u extends n{constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(y)}static get observedAttributes(){return n.observedAttributes}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=Y,this._syncAttributes())}}const v=new CSSStyleSheet;v.replaceSync(W);class s extends u{_text=o;_headline=o;static textAttribute="text";static headlineAttribute="headline";constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(v)}static get observedAttributes(){return[...u.observedAttributes,s.textAttribute,s.headlineAttribute]}get headline(){return this._headline}set headline(t){this._headline=t,this.setAttribute(s.headlineAttribute,t)}get text(){return this._text}set text(t){this._text=t,this.setAttribute(s.textAttribute,t)}connectedCallback(){this._render(),this._addEventListeners(),this.closedBy=c.NONE}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=N,this._syncAttributes())}_syncAttribute(t){if(s.observedAttributes.includes(t))switch(t){case s.headlineAttribute:{this._headline=this.getAttribute(t)??o;const r=this.shadowRoot?.querySelector("h2");r!=null&&(r.textContent=this._headline);break}case s.textAttribute:{this._text=this.getAttribute(t)??o;const r=this.shadowRoot?.querySelector("p");r!=null&&(r.textContent=this._text);break}default:super._syncAttribute(t)}else super._syncAttribute(t)}_syncAttributes(){super._syncAttributes(),s.observedAttributes.forEach(t=>{this._syncAttribute(t)})}}const j="header-body-footer-dialog";i.APPLICATION_NAME=a,i.BaseButtonComponent=e,i.BaseDialogComponent=n,i.ConfirmButtonComponent=T,i.ConfirmationDialogComponent=s,i.HeaderBodyFooterDialogComponent=u,i.UndoButtonComponent=C,i.WebComponentsRegistry=w,i.baseButtonWebComponentSelector=S,i.baseDialogWebComponentSelector=$,i.confirmButtonWebComponentSelector=H,i.confirmationDialogWebComponentSelector=z,i.headerBodyFooterDialogWebComponentSelector=j,i.undoButtonWebComponentSelector=E,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The name of the application.
3
3
  */
4
- export declare const APPLICATION_NAME: string;
4
+ export declare const APPLICATION_NAME = "as-design-system-lib";
@@ -1,2 +1,9 @@
1
1
  import { APPLICATION_NAME } from './constants/application.constant.ts';
2
2
  export { APPLICATION_NAME };
3
+ export { WebComponentsRegistry } from './web-components/registry.ts';
4
+ export * from './web-components/buttons/base-button/main.ts';
5
+ export * from './web-components/buttons/undo-button/main.ts';
6
+ export * from './web-components/buttons/confirm-button/main.ts';
7
+ export * from './web-components/dialogs/base-dialog/main.ts';
8
+ export * from './web-components/dialogs/confirmation-dialog/main.ts';
9
+ export * from './web-components/dialogs/header-body-footer-dialog/main.ts';
@@ -0,0 +1,137 @@
1
+ import { ButtonCommand } from '@albi_scando/as-const-lib';
2
+ export declare class BaseButtonComponent extends HTMLElement {
3
+ /**
4
+ * @see HTMLButtonElement.autofocus
5
+ */
6
+ private static autofocusAttribute;
7
+ /**
8
+ * @see HTMLButtonElement.command
9
+ */
10
+ private static commandAttribute;
11
+ /**
12
+ * @see HTMLButtonElement.commandfor
13
+ */
14
+ private static commandforAttribute;
15
+ /**
16
+ * @see HTMLButtonElement.disabled
17
+ */
18
+ private static disabledAttribute;
19
+ /**
20
+ * @see HTMLButtonElement.name
21
+ */
22
+ private static nameAttribute;
23
+ /**
24
+ * @see HTMLButtonElement.headline
25
+ */
26
+ private static titleAttribute;
27
+ /**
28
+ * @see HTMLButtonElement.type
29
+ */
30
+ private static typeAttribute;
31
+ /**
32
+ * @see HTMLButtonElement.value
33
+ */
34
+ private static valueAttribute;
35
+ /**
36
+ * @constructor
37
+ * @ignore
38
+ */
39
+ constructor();
40
+ /**
41
+ * Specifies which attributes should be observed for changes.
42
+ */
43
+ static get observedAttributes(): string[];
44
+ get buttonElement(): HTMLButtonElement;
45
+ get autofocus(): boolean;
46
+ set autofocus(value: boolean);
47
+ get command(): string;
48
+ set command(value: ButtonCommand);
49
+ get commandfor(): string;
50
+ set commandfor(value: string);
51
+ get disabled(): boolean;
52
+ set disabled(value: boolean);
53
+ get name(): string;
54
+ set name(value: string);
55
+ get headline(): string;
56
+ set headline(value: string);
57
+ get type(): string;
58
+ set type(value: string);
59
+ get value(): string;
60
+ set value(value: string);
61
+ /**
62
+ * Lifecycle hook invoked when the component is inserted into the DOM.
63
+ *
64
+ * @returns {void}
65
+ */
66
+ connectedCallback(): void;
67
+ /**
68
+ * Lifecycle hook invoked when the component is removed from the DOM.
69
+ * Cleans up side effects created during `connectedCallback`.
70
+ *
71
+ * @returns {void}
72
+ */
73
+ disconnectedCallback(): void;
74
+ /**
75
+ * Lifecycle hook invoked whenever an observed attribute changes.
76
+ *
77
+ * @param name - The name of the attribute that changed
78
+ * @param oldValue - The previous value (or null if added)
79
+ * @param newValue - The new value (or null if removed)
80
+ * @returns {void}
81
+ */
82
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
83
+ /**
84
+ * Renders the component's HTML structure.
85
+ * Syncs host attributes to the internal button element.
86
+ */
87
+ protected _render(): void;
88
+ /**
89
+ * Adds event listeners to the component.
90
+ *
91
+ * @returns {void}
92
+ */
93
+ protected _addEventListeners(): void;
94
+ /**
95
+ * Removes event listeners from the component.
96
+ *
97
+ * @returns {void}
98
+ */
99
+ protected _removeEventListeners(): void;
100
+ /**
101
+ * Handles the internal button click event and executes the configured command.
102
+ *
103
+ * This method reads the `command` and `commandfor` attributes defined on the
104
+ * host element and performs the corresponding action on the target element.
105
+ *
106
+ * Behavior:
107
+ * - If either `command` or `commandfor` is missing, no action is performed.
108
+ * - The target element is resolved via `document.getElementById()`
109
+ * using the `commandfor` value.
110
+ * - If the target exists and supports the requested method, the command is executed.
111
+ *
112
+ * This enables declarative command wiring between components, similar in spirit
113
+ * to native HTML behavior, while keeping components loosely coupled.
114
+ *
115
+ * @remarks
116
+ * The target element is assumed to expose compatible public methods
117
+ * (e.g., `showModal()` or `close()`). Optional chaining is used to
118
+ * safely invoke them without throwing runtime errors.
119
+ *
120
+ * @returns {void}
121
+ */
122
+ protected _handleClick: () => void;
123
+ /**
124
+ * Syncs a single attribute from host to button element.
125
+ *
126
+ * @param name - The attribute name to sync
127
+ * @returns {void}
128
+ */
129
+ protected _syncAttribute(name: string): void;
130
+ /**
131
+ * Syncs all observed attributes from host to button element.
132
+ * Called during initial render.
133
+ *
134
+ * @returns {void}
135
+ */
136
+ protected _syncAttributes(): void;
137
+ }
@@ -0,0 +1,2 @@
1
+ export { selector as baseButtonWebComponentSelector } from './selector.ts';
2
+ export * from './component.ts';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @see BaseButtonComponent selector.
3
+ */
4
+ export declare const selector = "base-button";
@@ -0,0 +1,31 @@
1
+ import { BaseButtonComponent } from '../base-button/component';
2
+ /**
3
+ * ConfirmButtonComponent extends BaseButtonComponent with a styled confirm button.
4
+ * It renders a native <button> element directly instead of nesting base-button.
5
+ */
6
+ export declare class ConfirmButtonComponent extends BaseButtonComponent {
7
+ /**
8
+ * @constructor
9
+ * @ignore
10
+ */
11
+ constructor();
12
+ /**
13
+ * Specifies which attributes should be observed for changes.
14
+ */
15
+ static get observedAttributes(): string[];
16
+ /**
17
+ * Lifecycle hook invoked when the component is inserted into the DOM.
18
+ */
19
+ connectedCallback(): void;
20
+ /**
21
+ * Renders the component's HTML structure.
22
+ */
23
+ protected _render(): void;
24
+ /**
25
+ * It finds the closest parent dialog and
26
+ * sets the commandfor attribute to its ID.
27
+ *
28
+ * @returns {void}
29
+ */
30
+ private _setCommandForAttribute;
31
+ }
@@ -0,0 +1,2 @@
1
+ export { ConfirmButtonComponent } from './component';
2
+ export { selector as confirmButtonWebComponentSelector } from './selector';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @see ConfirmButtonComponent selector.
3
+ */
4
+ export declare const selector = "confirm-button";
@@ -0,0 +1,27 @@
1
+ import { BaseButtonComponent } from '../base-button/component';
2
+ export declare class UndoButtonComponent extends BaseButtonComponent {
3
+ /**
4
+ * @constructor
5
+ * @ignore
6
+ */
7
+ constructor();
8
+ /**
9
+ * Specifies which attributes should be observed for changes.
10
+ */
11
+ static get observedAttributes(): string[];
12
+ /**
13
+ * Lifecycle hook invoked when the component is inserted into the DOM.
14
+ */
15
+ connectedCallback(): void;
16
+ /**
17
+ * Renders the component's HTML structure.
18
+ */
19
+ protected _render(): void;
20
+ /**
21
+ * It finds the closest parent dialog and
22
+ * sets the commandfor attribute to its ID.
23
+ *
24
+ * @returns {void}
25
+ */
26
+ private _setCommandForAttribute;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { selector as undoButtonWebComponentSelector } from './selector.ts';
2
+ export * from './component.ts';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @see UndoButtonComponent selector
3
+ */
4
+ export declare const selector = "undo-button";
@@ -0,0 +1,92 @@
1
+ import { DialogClosedBy } from '@albi_scando/as-const-lib';
2
+ export declare class BaseDialogComponent extends HTMLElement {
3
+ /**
4
+ * @see HTMLDialogElement.closedBy
5
+ */
6
+ private static closedByAttribute;
7
+ /**
8
+ * Defines how the dialog can be closed.
9
+ * @see DialogClosedBy
10
+ */
11
+ private _closedBy;
12
+ /**
13
+ * @constructor
14
+ * @ignore
15
+ */
16
+ constructor();
17
+ /**
18
+ * Specifies which attributes should be observed for changes.
19
+ */
20
+ static get observedAttributes(): string[];
21
+ get dialogElement(): HTMLDialogElement;
22
+ get command(): string;
23
+ get closedBy(): DialogClosedBy;
24
+ set closedBy(value: DialogClosedBy);
25
+ /**
26
+ * Lifecycle
27
+ * hook invoked when the component is inserted into the DOM.
28
+ *
29
+ * @returns {void}
30
+ */
31
+ connectedCallback(): void;
32
+ /**
33
+ * Lifecycle hook invoked when the component is removed from the DOM.
34
+ * Cleans up side effects created during `connectedCallback`.
35
+ *
36
+ * @returns {void}
37
+ */
38
+ disconnectedCallback(): void;
39
+ /**
40
+ * Lifecycle hook invoked whenever an observed attribute changes.
41
+ *
42
+ * @param name - The name of the attribute that changed
43
+ * @param oldValue - The previous value (or null if added)
44
+ * @param newValue - The new value (or null if removed)
45
+ * @returns {void}
46
+ */
47
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
48
+ /**
49
+ * Adds event listeners to the component.
50
+ *
51
+ * @returns {void}
52
+ */
53
+ protected _addEventListeners(): void;
54
+ /**
55
+ * Removes event listeners from the component.
56
+ *
57
+ * @returns {void}
58
+ */
59
+ protected _removeEventListeners(): void;
60
+ /**
61
+ * Renders the component's HTML structure.
62
+ *
63
+ * @returns {void}
64
+ */
65
+ protected _render(): void;
66
+ /**
67
+ * Syncs a single attribute from host to dialog element.
68
+ *
69
+ * @param name - The attribute name to sync
70
+ * @returns {void}
71
+ */
72
+ protected _syncAttribute(name: string): void;
73
+ /**
74
+ * Syncs all observed attributes from host to dialog element.
75
+ * Called during initial render.
76
+ *
77
+ * @returns {void}
78
+ */
79
+ protected _syncAttributes(): void;
80
+ /**
81
+ * @see HTMLDialogElement.show
82
+ */
83
+ show(): void;
84
+ /**
85
+ * @see HTMLDialogElement.showModal
86
+ */
87
+ showModal(): void;
88
+ /**
89
+ * @see HTMLDialogElement.close
90
+ */
91
+ close(returnValue?: string): void;
92
+ }
@@ -0,0 +1,2 @@
1
+ export { selector as baseDialogWebComponentSelector } from './selector.ts';
2
+ export * from './component.ts';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @see BaseDialogComponent selector.
3
+ */
4
+ export declare const selector = "base-dialog";
@@ -0,0 +1,65 @@
1
+ import { HeaderBodyFooterDialogComponent } from '../header-body-footer-dialog/component';
2
+ /**
3
+ * ConfirmationDialogComponent extends HeaderBodyFooterDialogComponent and adds
4
+ * a specific UI with a title, text content, and confirm/undo buttons.
5
+ *
6
+ * It manages the title and text attributes and syncs them to the DOM elements.
7
+ */
8
+ export declare class ConfirmationDialogComponent extends HeaderBodyFooterDialogComponent {
9
+ /**
10
+ * The text content of the confirmation dialog.
11
+ */
12
+ private _text;
13
+ /**
14
+ * The title of the confirmation dialog.
15
+ */
16
+ private _headline;
17
+ /**
18
+ * The name of the attribute that holds the dialog's text content.
19
+ */
20
+ private static textAttribute;
21
+ /**
22
+ * The name of the attribute that holds the dialog's title.
23
+ */
24
+ private static headlineAttribute;
25
+ /**
26
+ * @constructor
27
+ */
28
+ constructor();
29
+ /**
30
+ * Specifies which attributes should be observed for changes.
31
+ * Adds text and title to parent's observed attributes.
32
+ */
33
+ static get observedAttributes(): string[];
34
+ get headline(): string;
35
+ set headline(value: string);
36
+ get text(): string;
37
+ set text(value: string);
38
+ /**
39
+ * Lifecycle hook invoked when the component is inserted into the DOM.
40
+ *
41
+ * @returns {void}
42
+ */
43
+ connectedCallback(): void;
44
+ /**
45
+ * Renders the component's HTML structure.
46
+ * Overrides parent to provide the confirmation dialog specific layout.
47
+ *
48
+ * @returns {void}
49
+ */
50
+ protected _render(): void;
51
+ /**
52
+ * Syncs a single attribute from host to the DOM elements.
53
+ *
54
+ * @param name - The attribute name to sync
55
+ * @returns {void}
56
+ */
57
+ protected _syncAttribute(name: string): void;
58
+ /**
59
+ * Syncs all observed attributes from host to DOM elements.
60
+ * Called during initial render.
61
+ *
62
+ * @returns {void}
63
+ */
64
+ protected _syncAttributes(): void;
65
+ }
@@ -0,0 +1,2 @@
1
+ export { selector as confirmationDialogWebComponentSelector } from './selector.ts';
2
+ export * from './component.ts';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @see ConfirmationDialogComponent selector.
3
+ */
4
+ export declare const selector = "confirmation-dialog";
@@ -0,0 +1,25 @@
1
+ import { BaseDialogComponent } from '../base-dialog/component';
2
+ /**
3
+ * HeaderBodyFooterDialogComponent extends BaseDialogComponent and adds a
4
+ * structured layout with three sections: header, body, and footer.
5
+ * Each section can be populated via named slots.
6
+ */
7
+ export declare class HeaderBodyFooterDialogComponent extends BaseDialogComponent {
8
+ /**
9
+ * @constructor
10
+ * @ignore
11
+ */
12
+ constructor();
13
+ /**
14
+ * Specifies which attributes should be observed for changes.
15
+ * Uses parent's attributes since we're extending the base dialog.
16
+ */
17
+ static get observedAttributes(): string[];
18
+ /**
19
+ * Renders the component's HTML structure.
20
+ * Overrides parent to provide the 3-section layout inside the dialog.
21
+ *
22
+ * @returns {void}
23
+ */
24
+ protected _render(): void;
25
+ }
@@ -0,0 +1,2 @@
1
+ export { selector as headerBodyFooterDialogWebComponentSelector } from './selector.ts';
2
+ export * from './component.ts';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @see HeaderBodyFooterDialogComponent selector.
3
+ */
4
+ export declare const selector = "header-body-footer-dialog";
@@ -0,0 +1,41 @@
1
+ /**
2
+ * A registry class that helps register custom web components with the browser.
3
+ * It registers all provided web components in a map, ensuring that no component
4
+ * is registered more than once. The class provides methods for registering individual
5
+ * components as well as batches of components.
6
+ *
7
+ * @example
8
+ * const registry = new WebComponentsRegistry(new Map([
9
+ * ['my-custom-component-1', MyCustomComponent1Class],
10
+ * ['my-custom-component-2', MyCustomComponent2Class],
11
+ * ]));
12
+ */
13
+ export declare class WebComponentsRegistry {
14
+ /**
15
+ * Creates an instance of WebComponentsRegistry.
16
+ * Registers all custom elements provided in the map of components.
17
+ *
18
+ * @param {Map<string, CustomElementConstructor>} customElements - A map of component selectors (string keys)
19
+ * and their corresponding custom element constructors. If no map is provided, an empty map is used.
20
+ */
21
+ constructor(customElements?: Map<string, CustomElementConstructor>);
22
+ /**
23
+ * Registers all the components provided in the map.
24
+ * It iterates over the map entries and registers each component individually.
25
+ *
26
+ * @param {Map<string, CustomElementConstructor>} customElements - A map of component selectors (string keys)
27
+ * and their corresponding custom element constructors.
28
+ * @returns {void}
29
+ */
30
+ private registerAllComponents;
31
+ /**
32
+ * Registers an individual custom component with the browser.
33
+ * If the component is not already registered, it defines the component and logs a message.
34
+ * If the component is already registered, a warning is logged.
35
+ *
36
+ * @param {string} selector - The selector (tag name) of the custom component to be registered.
37
+ * @param {CustomElementConstructor} component - The constructor of the custom component to be registered.
38
+ * @returns {void}
39
+ */
40
+ private registerComponent;
41
+ }