@kodaris/krubble-components 1.0.32 → 1.0.34

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.
@@ -265,7 +265,7 @@
265
265
  {
266
266
  "kind": "variable",
267
267
  "name": "KRDialog",
268
- "default": "class KRDialog extends i$2 { constructor() { super(...arguments); this._dialogRef = null; this._contentElement = null; this.opened = false; this.width = '560px'; this._handleDocumentKeyDown = (e) => { if (e.key === 'Escape') { this.close(); } }; } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener('keydown', this._handleDocumentKeyDown); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('opened')) { if (this.opened) { document.addEventListener('keydown', this._handleDocumentKeyDown); } else { document.removeEventListener('keydown', this._handleDocumentKeyDown); } } } /** * Opens the dialog (declarative mode). */ open() { this.opened = true; } /** * Closes the dialog. * In programmatic mode (has _dialogRef), delegates to the dialog ref. * In declarative mode, sets opened=false and dispatches close event. */ close() { if (this._dialogRef) { this._dialogRef.close(undefined); return; } this.opened = false; this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true })); } /** * Opens a dialog programmatically by creating a component and injecting it. */ static open(component, config) { // Only remove other programmatic dialogs (those with a _dialogRef) document.querySelectorAll('kr-dialog').forEach((el) => { if (el._dialogRef) { el.remove(); } }); const dialogRef = new KRDialogRef(); const dialog = document.createElement('kr-dialog'); dialogRef.setDialogElement(dialog); dialog._dialogRef = dialogRef; // Create the content component const content = new component(); content.dialogRef = dialogRef; if (config?.data) { content.data = config.data; } dialog._contentElement = content; dialog.opened = true; document.body.appendChild(dialog); return dialogRef; } _handleBackdropClick(e) { if (e.target.classList.contains('backdrop')) { this.close(); } } render() { return b ` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${o$1({ width: this.width })}> ${this._contentElement ? this._contentElement : b `<slot></slot>`} </div> `; } }",
268
+ "default": "class KRDialog extends i$2 { constructor() { super(...arguments); this._dialogRef = null; this._contentElement = null; this.opened = false; this.label = ''; this.width = '560px'; this._handleDocumentKeyDown = (e) => { if (e.key === 'Escape') { this.close(); } }; } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener('keydown', this._handleDocumentKeyDown); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('opened')) { if (this.opened) { document.addEventListener('keydown', this._handleDocumentKeyDown); } else { document.removeEventListener('keydown', this._handleDocumentKeyDown); } } } /** * Opens the dialog (declarative mode). */ open() { this.opened = true; } /** * Closes the dialog. * In programmatic mode (has _dialogRef), delegates to the dialog ref. * In declarative mode, sets opened=false and dispatches close event. */ close() { if (this._dialogRef) { this._dialogRef.close(undefined); return; } this.opened = false; this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true })); } /** * Opens a dialog programmatically by creating a component and injecting it. */ static open(component, config) { // Only remove other programmatic dialogs (those with a _dialogRef) document.querySelectorAll('kr-dialog').forEach((el) => { if (el._dialogRef) { el.remove(); } }); const dialogRef = new KRDialogRef(); const dialog = document.createElement('kr-dialog'); dialogRef.setDialogElement(dialog); dialog._dialogRef = dialogRef; // Create the content component const content = new component(); content.dialogRef = dialogRef; if (config?.data) { content.data = config.data; } if (config?.label) { dialog.label = config.label; } if (config?.width) { dialog.width = config.width; } dialog._contentElement = content; dialog.opened = true; document.body.appendChild(dialog); return dialogRef; } _handleBackdropClick(e) { if (e.target.classList.contains('backdrop')) { this.close(); } } render() { return b ` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${o$1({ width: this.width })}> ${this.label ? b `<div class=\"dialog__header\"><div class=\"dialog__header-label\">${this.label}</div></div>` : ''} ${this._contentElement ? this._contentElement : b `<slot></slot>`} </div> `; } }",
269
269
  "description": "Generic dialog component that supports both declarative and programmatic usage.\n\nDeclarative: place `<kr-dialog>` in HTML with slotted content and call `.open()` / `.close()`.\nProgrammatic: use `KRDialog.open(Component, config)` to create and show a dialog."
270
270
  },
271
271
  {
@@ -586,7 +586,7 @@
586
586
  {
587
587
  "kind": "variable",
588
588
  "name": "He",
589
- "default": "class extends re{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.width=\"560px\",this._handleDocumentKeyDown=e=>{\"Escape\"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"keydown\",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has(\"opened\")&&(this.opened?document.addEventListener(\"keydown\",this._handleDocumentKeyDown):document.removeEventListener(\"keydown\",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent(\"close\",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll(\"kr-dialog\").forEach((e=>{e._dialogRef&&e.remove()}));const i=new Be,o=document.createElement(\"kr-dialog\");i.setDialogElement(o),o._dialogRef=i;const s=new e;return s.dialogRef=i,t?.data&&(s.data=t.data),o._contentElement=s,o.opened=!0,document.body.appendChild(o),i}_handleBackdropClick(e){e.target.classList.contains(\"backdrop\")&&this.close()}render(){return H` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${je({width:this.width})}> ${this._contentElement?this._contentElement:H`<slot></slot>`} </div> `}}"
589
+ "default": "class extends re{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label=\"\",this.width=\"560px\",this._handleDocumentKeyDown=e=>{\"Escape\"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"keydown\",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has(\"opened\")&&(this.opened?document.addEventListener(\"keydown\",this._handleDocumentKeyDown):document.removeEventListener(\"keydown\",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent(\"close\",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll(\"kr-dialog\").forEach((e=>{e._dialogRef&&e.remove()}));const i=new Be,o=document.createElement(\"kr-dialog\");i.setDialogElement(o),o._dialogRef=i;const s=new e;return s.dialogRef=i,t?.data&&(s.data=t.data),t?.label&&(o.label=t.label),t?.width&&(o.width=t.width),o._contentElement=s,o.opened=!0,document.body.appendChild(o),i}_handleBackdropClick(e){e.target.classList.contains(\"backdrop\")&&this.close()}render(){return H` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${je({width:this.width})}> ${this.label?H`<div class=\"dialog__header\"><div class=\"dialog__header-label\">${this.label}</div></div>`:\"\"} ${this._contentElement?this._contentElement:H`<slot></slot>`} </div> `}}"
590
590
  },
591
591
  {
592
592
  "kind": "variable",
@@ -1282,7 +1282,7 @@
1282
1282
  {
1283
1283
  "kind": "variable",
1284
1284
  "name": "KRDialog",
1285
- "default": "class KRDialog extends LitElement { constructor() { super(...arguments); this._dialogRef = null; this._contentElement = null; this.opened = false; this.width = '560px'; this._handleDocumentKeyDown = (e) => { if (e.key === 'Escape') { this.close(); } }; } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener('keydown', this._handleDocumentKeyDown); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('opened')) { if (this.opened) { document.addEventListener('keydown', this._handleDocumentKeyDown); } else { document.removeEventListener('keydown', this._handleDocumentKeyDown); } } } /** * Opens the dialog (declarative mode). */ open() { this.opened = true; } /** * Closes the dialog. * In programmatic mode (has _dialogRef), delegates to the dialog ref. * In declarative mode, sets opened=false and dispatches close event. */ close() { if (this._dialogRef) { this._dialogRef.close(undefined); return; } this.opened = false; this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true })); } /** * Opens a dialog programmatically by creating a component and injecting it. */ static open(component, config) { // Only remove other programmatic dialogs (those with a _dialogRef) document.querySelectorAll('kr-dialog').forEach((el) => { if (el._dialogRef) { el.remove(); } }); const dialogRef = new KRDialogRef(); const dialog = document.createElement('kr-dialog'); dialogRef.setDialogElement(dialog); dialog._dialogRef = dialogRef; // Create the content component const content = new component(); content.dialogRef = dialogRef; if (config?.data) { content.data = config.data; } dialog._contentElement = content; dialog.opened = true; document.body.appendChild(dialog); return dialogRef; } _handleBackdropClick(e) { if (e.target.classList.contains('backdrop')) { this.close(); } } render() { return html ` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${styleMap({ width: this.width })}> ${this._contentElement ? this._contentElement : html `<slot></slot>`} </div> `; } }",
1285
+ "default": "class KRDialog extends LitElement { constructor() { super(...arguments); this._dialogRef = null; this._contentElement = null; this.opened = false; this.label = ''; this.width = '560px'; this._handleDocumentKeyDown = (e) => { if (e.key === 'Escape') { this.close(); } }; } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener('keydown', this._handleDocumentKeyDown); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('opened')) { if (this.opened) { document.addEventListener('keydown', this._handleDocumentKeyDown); } else { document.removeEventListener('keydown', this._handleDocumentKeyDown); } } } /** * Opens the dialog (declarative mode). */ open() { this.opened = true; } /** * Closes the dialog. * In programmatic mode (has _dialogRef), delegates to the dialog ref. * In declarative mode, sets opened=false and dispatches close event. */ close() { if (this._dialogRef) { this._dialogRef.close(undefined); return; } this.opened = false; this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true })); } /** * Opens a dialog programmatically by creating a component and injecting it. */ static open(component, config) { // Only remove other programmatic dialogs (those with a _dialogRef) document.querySelectorAll('kr-dialog').forEach((el) => { if (el._dialogRef) { el.remove(); } }); const dialogRef = new KRDialogRef(); const dialog = document.createElement('kr-dialog'); dialogRef.setDialogElement(dialog); dialog._dialogRef = dialogRef; // Create the content component const content = new component(); content.dialogRef = dialogRef; if (config?.data) { content.data = config.data; } if (config?.label) { dialog.label = config.label; } if (config?.width) { dialog.width = config.width; } dialog._contentElement = content; dialog.opened = true; document.body.appendChild(dialog); return dialogRef; } _handleBackdropClick(e) { if (e.target.classList.contains('backdrop')) { this.close(); } } render() { return html ` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${styleMap({ width: this.width })}> ${this.label ? html `<div class=\"dialog__header\"><div class=\"dialog__header-label\">${this.label}</div></div>` : ''} ${this._contentElement ? this._contentElement : html `<slot></slot>`} </div> `; } }",
1286
1286
  "description": "Generic dialog component that supports both declarative and programmatic usage.\n\nDeclarative: place `<kr-dialog>` in HTML with slotted content and call `.open()` / `.close()`.\nProgrammatic: use `KRDialog.open(Component, config)` to create and show a dialog."
1287
1287
  }
1288
1288
  ],
@@ -2522,6 +2522,15 @@
2522
2522
  "attribute": "opened",
2523
2523
  "reflects": true
2524
2524
  },
2525
+ {
2526
+ "kind": "field",
2527
+ "name": "label",
2528
+ "type": {
2529
+ "text": "string"
2530
+ },
2531
+ "default": "''",
2532
+ "attribute": "label"
2533
+ },
2525
2534
  {
2526
2535
  "kind": "field",
2527
2536
  "name": "width",
@@ -2604,6 +2613,14 @@
2604
2613
  "default": "false",
2605
2614
  "fieldName": "opened"
2606
2615
  },
2616
+ {
2617
+ "name": "label",
2618
+ "type": {
2619
+ "text": "string"
2620
+ },
2621
+ "default": "''",
2622
+ "fieldName": "label"
2623
+ },
2607
2624
  {
2608
2625
  "name": "width",
2609
2626
  "type": {
@@ -1,6 +1,8 @@
1
1
  import { LitElement } from 'lit';
2
2
  export interface KRDialogConfig<T = unknown> {
3
3
  data?: T;
4
+ label?: string;
5
+ width?: string;
4
6
  }
5
7
  export declare class KRDialogHeader extends LitElement {
6
8
  static styles: import("lit").CSSResult;
@@ -58,6 +60,7 @@ export declare class KRDialog extends LitElement {
58
60
  private _dialogRef;
59
61
  private _contentElement;
60
62
  opened: boolean;
63
+ label: string;
61
64
  width: string;
62
65
  disconnectedCallback(): void;
63
66
  updated(changedProperties: Map<string, unknown>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,MAAM,W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AAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAWxD;;OAEG;IACH,IAAI;IAIJ;;;;OAIG;IACH,KAAK;IASL;;OAEG;IACH,MAAM,CAAC,IAAI,CACT,SAAS,EAAE,UAAU,UAAU,EAC/B,MAAM,CAAC,EAAE,cAAc,GACtB,WAAW;IAmCd,OAAO,CAAC,sBAAsB,CAI5B;IAEF,OAAO,CAAC,oBAAoB;IAMnB,MAAM;CAShB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;QACtB,kBAAkB,EAAE,cAAc,CAAC;QACnC,mBAAmB,EAAE,eAAe,CAAC;QACrC,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -128,6 +128,7 @@ let KRDialog = class KRDialog extends LitElement {
128
128
  this._dialogRef = null;
129
129
  this._contentElement = null;
130
130
  this.opened = false;
131
+ this.label = '';
131
132
  this.width = '560px';
132
133
  this._handleDocumentKeyDown = (e) => {
133
134
  if (e.key === 'Escape') {
@@ -189,6 +190,12 @@ let KRDialog = class KRDialog extends LitElement {
189
190
  if (config?.data) {
190
191
  content.data = config.data;
191
192
  }
193
+ if (config?.label) {
194
+ dialog.label = config.label;
195
+ }
196
+ if (config?.width) {
197
+ dialog.width = config.width;
198
+ }
192
199
  dialog._contentElement = content;
193
200
  dialog.opened = true;
194
201
  document.body.appendChild(dialog);
@@ -203,6 +210,7 @@ let KRDialog = class KRDialog extends LitElement {
203
210
  return html `
204
211
  <div class="backdrop" @click=${this._handleBackdropClick}></div>
205
212
  <div class="dialog" style=${styleMap({ width: this.width })}>
213
+ ${this.label ? html `<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>` : ''}
206
214
  ${this._contentElement ? this._contentElement : html `<slot></slot>`}
207
215
  </div>
208
216
  `;
@@ -251,6 +259,21 @@ KRDialog.styles = css `
251
259
  flex: 1 1 auto;
252
260
  overflow: auto;
253
261
  }
262
+
263
+ .dialog__header {
264
+ display: flex;
265
+ padding: 0 24px;
266
+ align-items: center;
267
+ height: 64px;
268
+ flex-shrink: 0;
269
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
270
+ }
271
+
272
+ .dialog__header-label {
273
+ margin: 0;
274
+ font-size: 18px;
275
+ font-weight: 600;
276
+ }
254
277
  `;
255
278
  __decorate([
256
279
  state()
@@ -258,6 +281,9 @@ __decorate([
258
281
  __decorate([
259
282
  property({ type: Boolean, reflect: true })
260
283
  ], KRDialog.prototype, "opened", void 0);
284
+ __decorate([
285
+ property({ type: String })
286
+ ], KRDialog.prototype, "label", void 0);
261
287
  __decorate([
262
288
  property({ type: String })
263
289
  ], KRDialog.prototype, "width", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/dialog/dialog.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAOhD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAkBnC,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAnBe,qBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;GAe3B,AAfqB,CAepB;AAhBS,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAqB1B;;AAGM,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAUpC,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAXe,sBAAM,GAAG,GAAG,CAAA;;;;;;;GAO3B,AAPqB,CAOpB;AARS,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAa3B;;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C,IAAI,CAAA,eAAe;;KAEtE,CAAC;IACJ,CAAC;;AA5Ke,eAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0D3B,AA1DqB,CA0DpB;AAKM;IADP,KAAK,EAAE;iDAC0C;AAGlD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC5B;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACX;AAzEL,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA8KpB"}
@@ -1494,6 +1494,7 @@ let KRDialog = class KRDialog extends i$2 {
1494
1494
  this._dialogRef = null;
1495
1495
  this._contentElement = null;
1496
1496
  this.opened = false;
1497
+ this.label = '';
1497
1498
  this.width = '560px';
1498
1499
  this._handleDocumentKeyDown = (e) => {
1499
1500
  if (e.key === 'Escape') {
@@ -1555,6 +1556,12 @@ let KRDialog = class KRDialog extends i$2 {
1555
1556
  if (config?.data) {
1556
1557
  content.data = config.data;
1557
1558
  }
1559
+ if (config?.label) {
1560
+ dialog.label = config.label;
1561
+ }
1562
+ if (config?.width) {
1563
+ dialog.width = config.width;
1564
+ }
1558
1565
  dialog._contentElement = content;
1559
1566
  dialog.opened = true;
1560
1567
  document.body.appendChild(dialog);
@@ -1569,6 +1576,7 @@ let KRDialog = class KRDialog extends i$2 {
1569
1576
  return b `
1570
1577
  <div class="backdrop" @click=${this._handleBackdropClick}></div>
1571
1578
  <div class="dialog" style=${o$1({ width: this.width })}>
1579
+ ${this.label ? b `<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>` : ''}
1572
1580
  ${this._contentElement ? this._contentElement : b `<slot></slot>`}
1573
1581
  </div>
1574
1582
  `;
@@ -1617,6 +1625,21 @@ KRDialog.styles = i$5 `
1617
1625
  flex: 1 1 auto;
1618
1626
  overflow: auto;
1619
1627
  }
1628
+
1629
+ .dialog__header {
1630
+ display: flex;
1631
+ padding: 0 24px;
1632
+ align-items: center;
1633
+ height: 64px;
1634
+ flex-shrink: 0;
1635
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1636
+ }
1637
+
1638
+ .dialog__header-label {
1639
+ margin: 0;
1640
+ font-size: 18px;
1641
+ font-weight: 600;
1642
+ }
1620
1643
  `;
1621
1644
  __decorate$b([
1622
1645
  r$1()
@@ -1624,6 +1647,9 @@ __decorate$b([
1624
1647
  __decorate$b([
1625
1648
  n$1({ type: Boolean, reflect: true })
1626
1649
  ], KRDialog.prototype, "opened", void 0);
1650
+ __decorate$b([
1651
+ n$1({ type: String })
1652
+ ], KRDialog.prototype, "label", void 0);
1627
1653
  __decorate$b([
1628
1654
  n$1({ type: String })
1629
1655
  ], KRDialog.prototype, "width", void 0);