@sme.up/ketchup 11.0.0-SNAPSHOT-20241118162146 → 11.0.0-SNAPSHOT-20241118171002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js +5 -1
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js.map +1 -1
- package/dist/collection/components/kup-dialog/kup-dialog.js +5 -1
- package/dist/collection/components/kup-dialog/kup-dialog.js.map +1 -1
- package/dist/components/kup-autocomplete2.js +5 -1
- package/dist/components/kup-autocomplete2.js.map +1 -1
- package/dist/esm/kup-autocomplete_28.entry.js +5 -1
- package/dist/esm/kup-autocomplete_28.entry.js.map +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-4973e63b.entry.js → p-ba5d1b55.entry.js} +2 -2
- package/dist/ketchup/p-ba5d1b55.entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-4973e63b.entry.js.map +0 -1
|
@@ -137,7 +137,11 @@ export class KupDialog {
|
|
|
137
137
|
'--kup_dialog_height': this.sizeY ? this.sizeY : 'auto',
|
|
138
138
|
'--kup_dialog_width': this.sizeX ? this.sizeX : 'auto',
|
|
139
139
|
};
|
|
140
|
-
|
|
140
|
+
const headerSlot = this.rootElement.querySelector('[slot="header"]');
|
|
141
|
+
if (headerSlot) {
|
|
142
|
+
__classPrivateFieldSet(this, _KupDialog_header, headerSlot, "f");
|
|
143
|
+
}
|
|
144
|
+
return (h(Host, { key: 'cd86c206a6f003f913a288b40b41127b96cd87ea', "fade-in": true, style: style }, h("style", { key: '6c691bca16376a84bf6291273baacb60e438c671' }, __classPrivateFieldGet(this, _KupDialog_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: 'f6dcfb0a6d0a4ba1f27b08d5b67e5527d6690739', id: componentWrapperId }, this.header ? (h("div", { class: "header", ref: (el) => (__classPrivateFieldSet(this, _KupDialog_header, el, "f")) }, this.header.title ? (h("div", { class: "header__title" }, this.header.title)) : null, ((_a = this.header.icons) === null || _a === void 0 ? void 0 : _a.close) ? (h(FImage, { onClick: () => this.close(), sizeX: "1.25em", sizeY: "100%", resource: "clear", wrapperClass: "header__close" })) : null)) : headerSlot ? (h("slot", { name: "header" })) : null, h("div", { key: 'f4785e7790c9120a25e00483ca4b427d824684ed', class: "content" }, h("slot", { key: 'e32121655c6d1cb1fa6d686ef5e5306b8a5ea3a0', name: "content" })))));
|
|
141
145
|
}
|
|
142
146
|
disconnectedCallback() {
|
|
143
147
|
if (this.modal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kup-dialog.js","sourceRoot":"","sources":["../../../src/components/kup-dialog/kup-dialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,WAAW,EACX,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAM5E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAIH,cAAc,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAOnF,MAAM,OAAO,SAAS;;QA+ClB,qDAAqD;QACrD,qDAAqD;QACrD,qDAAqD;QAErD,4BAAuB,IAAI,EAAC;QAC5B,gCAAc,kBAAkB,EAAE,EAAC;QACnC,qCAAmB,CAAC,EAAC;0BAvCqB,EAAE,OAAO,EAAE,IAAI,EAAE;2BAMrC,EAAE;sBAKU,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;qBAK5B,EAAE,oBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n forceUpdate,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport { FImage } from '../../f-components/f-image/f-image';\nimport { kupManagerInstance } from '../../managers/kup-manager/kup-manager';\nimport {\n GenericObject,\n KupComponent,\n KupEventPayload,\n} from '../../types/GenericTypes';\nimport { getProps, setProps } from '../../utils/utils';\nimport { componentWrapperId } from '../../variables/GenericVariables';\nimport {\n KupDialogAutoCenter,\n KupDialogHeader,\n KupDialogModal,\n KupDialogProps,\n} from './kup-dialog-declarations';\nimport { KupDebugCategory } from '../../managers/kup-debug/kup-debug-declarations';\n\n@Component({\n tag: 'kup-dialog',\n styleUrl: 'kup-dialog.scss',\n shadow: true,\n})\nexport class KupDialog {\n /**\n * References the root HTML element of the component (<kup-dialog>).\n */\n @Element() rootElement: HTMLElement;\n\n /*-------------------------------------------------*/\n /* P r o p s */\n /*-------------------------------------------------*/\n\n /**\n * Auto centers the dialog relatively to the viewport.\n * @default \"{ onReady: true }\"\n */\n @Prop() autoCenter: KupDialogAutoCenter = { onReady: true };\n /**\n * Custom style of the component.\n * @default \"\"\n * @see https://smeup.github.io/ketchup/#/customization\n */\n @Prop() customStyle = '';\n /**\n * Header options.\n * @default \"{ icons: { close: true } }\"\n */\n @Prop() header: KupDialogHeader = { icons: { close: true } };\n /**\n * Set of options to display the dialog as a modal.\n * @default \"{ closeOnBackdropClick: true }\"\n */\n @Prop() modal: KupDialogModal = { closeOnBackdropClick: true };\n /**\n * Sets whether the dialog is resizable or not.\n * @default \"true\"\n */\n @Prop() resizable = true;\n /**\n * The width of the dialog, defaults to auto. Accepts any valid CSS format (px, %, vw, etc.).\n * @default \"auto\"\n */\n @Prop() sizeX = 'auto';\n /**\n * The height of the card, defaults to auto. Accepts any valid CSS format (px, %, vh, etc.).\n * @default \"auto\"\n */\n @Prop() sizeY = 'auto';\n\n /*-------------------------------------------------*/\n /* I n t e r n a l V a r i a b l e s */\n /*-------------------------------------------------*/\n\n #header: HTMLElement = null;\n #kupManager = kupManagerInstance();\n #recalcSafeguard = 0;\n\n /*-------------------------------------------------*/\n /* E v e n t s */\n /*-------------------------------------------------*/\n\n @Event({\n eventName: 'kup-dialog-close',\n composed: true,\n cancelable: false,\n bubbles: true,\n })\n kupClose: EventEmitter<KupEventPayload>;\n\n @Event({\n eventName: 'kup-dialog-ready',\n composed: true,\n cancelable: false,\n bubbles: true,\n })\n kupReady: EventEmitter<KupEventPayload>;\n\n /*-------------------------------------------------*/\n /* P u b l i c M e t h o d s */\n /*-------------------------------------------------*/\n\n /**\n * Closes the dialog detaching it from the DOM.\n */\n @Method()\n async close(): Promise<void> {\n this.kupClose.emit({\n comp: this,\n id: this.rootElement.id,\n });\n this.rootElement.remove();\n }\n /**\n * Used to retrieve component's props values.\n * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.\n * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.\n */\n @Method()\n async getProps(descriptions?: boolean): Promise<GenericObject> {\n return getProps(this, KupDialogProps, descriptions);\n }\n /**\n * Places the dialog at the center of the screen.\n */\n @Method()\n async recalcPosition(): Promise<void> {\n const rect = this.rootElement.getBoundingClientRect();\n if (!rect.x && !rect.y && !rect.height && !rect.width) {\n this.#kupManager.debug.logMessage(\n this,\n `recalcPosition() ran before the component finished being drawn. Running again (attempt #${\n this.#recalcSafeguard\n }).`,\n KupDebugCategory.INFO\n );\n if (this.#recalcSafeguard < 50) {\n this.#recalcSafeguard++;\n setTimeout(async () => this.recalcPosition(), 50);\n return;\n } else {\n this.#kupManager.debug.logMessage(\n this,\n `Too many attempts centering the dialog.`,\n KupDebugCategory.WARNING\n );\n }\n }\n this.#recalcSafeguard = 0;\n const left = window.innerWidth / 2 - rect.width / 2;\n const top = window.innerHeight / 2 - rect.height / 2 + window.scrollY;\n this.rootElement.style.setProperty('--kup_dialog_left', left + 'px');\n this.rootElement.style.setProperty('--kup_dialog_top', top + 'px');\n this.rootElement.removeAttribute('fade-in');\n }\n /**\n * This method is used to trigger a new render of the component.\n */\n @Method()\n async refresh(): Promise<void> {\n forceUpdate(this);\n }\n /**\n * Sets the props to the component.\n * @param {GenericObject} props - Object containing props that will be set to the component.\n */\n @Method()\n async setProps(props: GenericObject): Promise<void> {\n setProps(this, KupDialogProps, props);\n }\n\n /*-------------------------------------------------*/\n /* L i f e c y c l e H o o k s */\n /*-------------------------------------------------*/\n\n componentWillLoad() {\n this.#kupManager.debug.logLoad(this, false);\n this.#kupManager.theme.register(this);\n }\n\n componentDidLoad() {\n this.#kupManager.interact.dialogify(\n this.rootElement,\n this.#header ? this.#header : null,\n !this.resizable\n );\n if (this.autoCenter?.onReady) {\n this.recalcPosition();\n } else {\n this.rootElement.removeAttribute('fade-in');\n }\n if (this.modal) {\n this.#kupManager.interact.showModalBackdrop(\n this.modal.closeOnBackdropClick\n ? () => {\n this.close();\n }\n : null\n );\n }\n this.kupReady.emit({\n comp: this,\n id: this.rootElement.id,\n });\n this.#kupManager.debug.logLoad(this, true);\n }\n\n componentWillRender() {\n this.#kupManager.debug.logRender(this, false);\n }\n\n componentDidRender() {\n this.#kupManager.debug.logRender(this, true);\n }\n\n render() {\n const style = {\n '--kup_dialog_height': this.sizeY ? this.sizeY : 'auto',\n '--kup_dialog_width': this.sizeX ? this.sizeX : 'auto',\n };\n\n return (\n <Host fade-in style={style}>\n <style>\n {this.#kupManager.theme.setKupStyle(\n this.rootElement as KupComponent\n )}\n </style>\n <div id={componentWrapperId}>\n {this.header ? (\n <div class=\"header\" ref={(el) => (this.#header = el)}>\n {this.header.title ? (\n <div class=\"header__title\">\n {this.header.title}\n </div>\n ) : null}\n {this.header.icons?.close ? (\n <FImage\n onClick={() => this.close()}\n sizeX=\"1.25em\"\n sizeY=\"100%\"\n resource=\"clear\"\n wrapperClass=\"header__close\"\n ></FImage>\n ) : null}\n </div>\n ) : (\n <slot\n name=\"header\"\n ref={(el: HTMLElement) => (this.#header = el)}\n ></slot>\n )}\n <div class=\"content\">\n <slot name=\"content\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n\n disconnectedCallback() {\n if (this.modal) {\n this.#kupManager.interact.hideModalBackdrop();\n }\n this.#kupManager.theme.unregister(this);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"kup-dialog.js","sourceRoot":"","sources":["../../../src/components/kup-dialog/kup-dialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,WAAW,EACX,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAM5E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAIH,cAAc,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAOnF,MAAM,OAAO,SAAS;;QA+ClB,qDAAqD;QACrD,qDAAqD;QACrD,qDAAqD;QAErD,4BAAuB,IAAI,EAAC;QAC5B,gCAAc,kBAAkB,EAAE,EAAC;QACnC,qCAAmB,CAAC,EAAC;0BAvCqB,EAAE,OAAO,E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AI,CAAC,KAAK,EAAE,CAAC;YACb,uBAAA,IAAI,6BAAY,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAClD,CAAC;QACD,uBAAA,IAAI,6BAAY,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n forceUpdate,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport { FImage } from '../../f-components/f-image/f-image';\nimport { kupManagerInstance } from '../../managers/kup-manager/kup-manager';\nimport {\n GenericObject,\n KupComponent,\n KupEventPayload,\n} from '../../types/GenericTypes';\nimport { getProps, setProps } from '../../utils/utils';\nimport { componentWrapperId } from '../../variables/GenericVariables';\nimport {\n KupDialogAutoCenter,\n KupDialogHeader,\n KupDialogModal,\n KupDialogProps,\n} from './kup-dialog-declarations';\nimport { KupDebugCategory } from '../../managers/kup-debug/kup-debug-declarations';\n\n@Component({\n tag: 'kup-dialog',\n styleUrl: 'kup-dialog.scss',\n shadow: true,\n})\nexport class KupDialog {\n /**\n * References the root HTML element of the component (<kup-dialog>).\n */\n @Element() rootElement: HTMLElement;\n\n /*-------------------------------------------------*/\n /* P r o p s */\n /*-------------------------------------------------*/\n\n /**\n * Auto centers the dialog relatively to the viewport.\n * @default \"{ onReady: true }\"\n */\n @Prop() autoCenter: KupDialogAutoCenter = { onReady: true };\n /**\n * Custom style of the component.\n * @default \"\"\n * @see https://smeup.github.io/ketchup/#/customization\n */\n @Prop() customStyle = '';\n /**\n * Header options.\n * @default \"{ icons: { close: true } }\"\n */\n @Prop() header: KupDialogHeader = { icons: { close: true } };\n /**\n * Set of options to display the dialog as a modal.\n * @default \"{ closeOnBackdropClick: true }\"\n */\n @Prop() modal: KupDialogModal = { closeOnBackdropClick: true };\n /**\n * Sets whether the dialog is resizable or not.\n * @default \"true\"\n */\n @Prop() resizable = true;\n /**\n * The width of the dialog, defaults to auto. Accepts any valid CSS format (px, %, vw, etc.).\n * @default \"auto\"\n */\n @Prop() sizeX = 'auto';\n /**\n * The height of the card, defaults to auto. Accepts any valid CSS format (px, %, vh, etc.).\n * @default \"auto\"\n */\n @Prop() sizeY = 'auto';\n\n /*-------------------------------------------------*/\n /* I n t e r n a l V a r i a b l e s */\n /*-------------------------------------------------*/\n\n #header: HTMLElement = null;\n #kupManager = kupManagerInstance();\n #recalcSafeguard = 0;\n\n /*-------------------------------------------------*/\n /* E v e n t s */\n /*-------------------------------------------------*/\n\n @Event({\n eventName: 'kup-dialog-close',\n composed: true,\n cancelable: false,\n bubbles: true,\n })\n kupClose: EventEmitter<KupEventPayload>;\n\n @Event({\n eventName: 'kup-dialog-ready',\n composed: true,\n cancelable: false,\n bubbles: true,\n })\n kupReady: EventEmitter<KupEventPayload>;\n\n /*-------------------------------------------------*/\n /* P u b l i c M e t h o d s */\n /*-------------------------------------------------*/\n\n /**\n * Closes the dialog detaching it from the DOM.\n */\n @Method()\n async close(): Promise<void> {\n this.kupClose.emit({\n comp: this,\n id: this.rootElement.id,\n });\n this.rootElement.remove();\n }\n /**\n * Used to retrieve component's props values.\n * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.\n * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.\n */\n @Method()\n async getProps(descriptions?: boolean): Promise<GenericObject> {\n return getProps(this, KupDialogProps, descriptions);\n }\n /**\n * Places the dialog at the center of the screen.\n */\n @Method()\n async recalcPosition(): Promise<void> {\n const rect = this.rootElement.getBoundingClientRect();\n if (!rect.x && !rect.y && !rect.height && !rect.width) {\n this.#kupManager.debug.logMessage(\n this,\n `recalcPosition() ran before the component finished being drawn. Running again (attempt #${\n this.#recalcSafeguard\n }).`,\n KupDebugCategory.INFO\n );\n if (this.#recalcSafeguard < 50) {\n this.#recalcSafeguard++;\n setTimeout(async () => this.recalcPosition(), 50);\n return;\n } else {\n this.#kupManager.debug.logMessage(\n this,\n `Too many attempts centering the dialog.`,\n KupDebugCategory.WARNING\n );\n }\n }\n this.#recalcSafeguard = 0;\n const left = window.innerWidth / 2 - rect.width / 2;\n const top = window.innerHeight / 2 - rect.height / 2 + window.scrollY;\n this.rootElement.style.setProperty('--kup_dialog_left', left + 'px');\n this.rootElement.style.setProperty('--kup_dialog_top', top + 'px');\n this.rootElement.removeAttribute('fade-in');\n }\n /**\n * This method is used to trigger a new render of the component.\n */\n @Method()\n async refresh(): Promise<void> {\n forceUpdate(this);\n }\n /**\n * Sets the props to the component.\n * @param {GenericObject} props - Object containing props that will be set to the component.\n */\n @Method()\n async setProps(props: GenericObject): Promise<void> {\n setProps(this, KupDialogProps, props);\n }\n\n /*-------------------------------------------------*/\n /* L i f e c y c l e H o o k s */\n /*-------------------------------------------------*/\n\n componentWillLoad() {\n this.#kupManager.debug.logLoad(this, false);\n this.#kupManager.theme.register(this);\n }\n\n componentDidLoad() {\n this.#kupManager.interact.dialogify(\n this.rootElement,\n this.#header ? this.#header : null,\n !this.resizable\n );\n if (this.autoCenter?.onReady) {\n this.recalcPosition();\n } else {\n this.rootElement.removeAttribute('fade-in');\n }\n if (this.modal) {\n this.#kupManager.interact.showModalBackdrop(\n this.modal.closeOnBackdropClick\n ? () => {\n this.close();\n }\n : null\n );\n }\n this.kupReady.emit({\n comp: this,\n id: this.rootElement.id,\n });\n this.#kupManager.debug.logLoad(this, true);\n }\n\n componentWillRender() {\n this.#kupManager.debug.logRender(this, false);\n }\n\n componentDidRender() {\n this.#kupManager.debug.logRender(this, true);\n }\n\n render() {\n const style = {\n '--kup_dialog_height': this.sizeY ? this.sizeY : 'auto',\n '--kup_dialog_width': this.sizeX ? this.sizeX : 'auto',\n };\n\n const headerSlot = this.rootElement.querySelector('[slot=\"header\"]');\n if (headerSlot) {\n this.#header = headerSlot as HTMLElement;\n }\n\n return (\n <Host fade-in style={style}>\n <style>\n {this.#kupManager.theme.setKupStyle(\n this.rootElement as KupComponent\n )}\n </style>\n <div id={componentWrapperId}>\n {this.header ? (\n <div class=\"header\" ref={(el) => (this.#header = el)}>\n {this.header.title ? (\n <div class=\"header__title\">\n {this.header.title}\n </div>\n ) : null}\n {this.header.icons?.close ? (\n <FImage\n onClick={() => this.close()}\n sizeX=\"1.25em\"\n sizeY=\"100%\"\n resource=\"clear\"\n wrapperClass=\"header__close\"\n ></FImage>\n ) : null}\n </div>\n ) : headerSlot ? (\n <slot name=\"header\"></slot>\n ) : null}\n <div class=\"content\">\n <slot name=\"content\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n\n disconnectedCallback() {\n if (this.modal) {\n this.#kupManager.interact.hideModalBackdrop();\n }\n this.#kupManager.theme.unregister(this);\n }\n}\n"]}
|
|
@@ -20845,7 +20845,11 @@ const KupDialog = /*@__PURE__*/ proxyCustomElement(class KupDialog extends HTMLE
|
|
|
20845
20845
|
'--kup_dialog_height': this.sizeY ? this.sizeY : 'auto',
|
|
20846
20846
|
'--kup_dialog_width': this.sizeX ? this.sizeX : 'auto',
|
|
20847
20847
|
};
|
|
20848
|
-
|
|
20848
|
+
const headerSlot = this.rootElement.querySelector('[slot="header"]');
|
|
20849
|
+
if (headerSlot) {
|
|
20850
|
+
__classPrivateFieldSet$3(this, _KupDialog_header, headerSlot, "f");
|
|
20851
|
+
}
|
|
20852
|
+
return (h(Host, { key: 'cd86c206a6f003f913a288b40b41127b96cd87ea', "fade-in": true, style: style }, h("style", { key: '6c691bca16376a84bf6291273baacb60e438c671' }, __classPrivateFieldGet$4(this, _KupDialog_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: 'f6dcfb0a6d0a4ba1f27b08d5b67e5527d6690739', id: componentWrapperId }, this.header ? (h("div", { class: "header", ref: (el) => (__classPrivateFieldSet$3(this, _KupDialog_header, el, "f")) }, this.header.title ? (h("div", { class: "header__title" }, this.header.title)) : null, ((_a = this.header.icons) === null || _a === void 0 ? void 0 : _a.close) ? (h(FImage, { onClick: () => this.close(), sizeX: "1.25em", sizeY: "100%", resource: "clear", wrapperClass: "header__close" })) : null)) : headerSlot ? (h("slot", { name: "header" })) : null, h("div", { key: 'f4785e7790c9120a25e00483ca4b427d824684ed', class: "content" }, h("slot", { key: 'e32121655c6d1cb1fa6d686ef5e5306b8a5ea3a0', name: "content" })))));
|
|
20849
20853
|
}
|
|
20850
20854
|
disconnectedCallback() {
|
|
20851
20855
|
if (this.modal) {
|