@sme.up/ketchup 9.4.0 → 9.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{f-button-4bef0f8e.js → f-button-b76723c7.js} +1 -1
- package/dist/cjs/{f-cell-5e0a400e.js → f-cell-0238450e.js} +5 -5
- package/dist/cjs/{f-chip-9159b2a5.js → f-chip-aad323a5.js} +2 -2
- package/dist/cjs/{f-image-b9074ea8.js → f-image-a049cb94.js} +1 -1
- package/dist/cjs/{f-paginator-utils-bfa0fa70.js → f-paginator-utils-3c1c8cf4.js} +2 -2
- package/dist/cjs/{f-text-field-bd197af7.js → f-text-field-d045c000.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +133 -19
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +6 -6
- package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-5106d5c6.js → kup-manager-ef4342bb.js} +494 -242
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/card.js +46 -0
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +9 -0
- package/dist/collection/components/kup-card/built-in/kup-card-openai.js +74 -0
- package/dist/collection/components/kup-card/kup-card-declarations.js +1 -0
- package/dist/collection/components/kup-card/kup-card.css +86 -0
- package/dist/collection/components/kup-card/kup-card.js +6 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +10 -2
- package/dist/collection/components/kup-dialog/kup-dialog.css +3 -3
- package/dist/collection/components/kup-dialog/kup-dialog.js +19 -5
- package/dist/collection/components/kup-image/assets/svg/open-ai.svg +1 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +7 -0
- package/dist/collection/managers/kup-openai/kup-openai-declarations.js +1 -0
- package/dist/collection/managers/kup-openai/kup-openai.js +248 -0
- package/dist/components/kup-autocomplete2.js +784 -545
- package/dist/components/kup-manager.js +494 -242
- package/dist/esm/{f-button-4d7a0b09.js → f-button-e5a13d96.js} +1 -1
- package/dist/esm/{f-cell-0bf956b8.js → f-cell-44737d32.js} +5 -5
- package/dist/esm/{f-chip-91249dc2.js → f-chip-4ba1fb6c.js} +2 -2
- package/dist/esm/{f-image-d666df65.js → f-image-17dd7557.js} +1 -1
- package/dist/esm/{f-paginator-utils-b5be40ee.js → f-paginator-utils-c0925f43.js} +2 -2
- package/dist/esm/{f-text-field-00a4d490.js → f-text-field-97929753.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +133 -19
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +4 -4
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +6 -6
- package/dist/esm/kup-dashboard.entry.js +4 -4
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +3 -3
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +6 -6
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-7f0372fb.js → kup-manager-21e2ce65.js} +494 -242
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/assets/svg/open-ai.svg +1 -0
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-00cc3d95.entry.js +1 -0
- package/dist/ketchup/{p-f5b5b35d.entry.js → p-04861e0f.entry.js} +1 -1
- package/dist/ketchup/{p-491c3cd0.entry.js → p-0bdd3eb4.entry.js} +1 -1
- package/dist/ketchup/{p-9fdd98be.entry.js → p-15c3d2c4.entry.js} +1 -1
- package/dist/ketchup/{p-1ecff2b9.entry.js → p-265c1bac.entry.js} +1 -1
- package/dist/ketchup/{p-b51b1000.entry.js → p-3172b2d6.entry.js} +1 -1
- package/dist/ketchup/{p-19be646f.entry.js → p-4528e07a.entry.js} +1 -1
- package/dist/ketchup/{p-e8f5b996.entry.js → p-4b141cad.entry.js} +1 -1
- package/dist/ketchup/{p-16c23ab7.entry.js → p-4dbcd9cf.entry.js} +1 -1
- package/dist/ketchup/{p-01401fba.entry.js → p-62fe8b61.entry.js} +1 -1
- package/dist/ketchup/{p-466d3604.entry.js → p-65984a13.entry.js} +1 -1
- package/dist/ketchup/{p-1180f9e0.entry.js → p-6e2a9054.entry.js} +1 -1
- package/dist/ketchup/p-7e1d9192.js +29 -0
- package/dist/ketchup/{p-28dcc98b.js → p-859aa987.js} +1 -1
- package/dist/ketchup/{p-96678597.entry.js → p-88efeed0.entry.js} +1 -1
- package/dist/ketchup/p-89f09a1c.entry.js +9 -0
- package/dist/ketchup/p-91180bd4.entry.js +1 -0
- package/dist/ketchup/{p-d5a9924b.entry.js → p-9868af74.entry.js} +1 -1
- package/dist/ketchup/p-9bdc7491.js +1 -0
- package/dist/ketchup/{p-1e77ddec.js → p-9bf00c9c.js} +1 -1
- package/dist/ketchup/{p-378bbbcf.js → p-9e68a4c0.js} +1 -1
- package/dist/ketchup/{p-3ba32190.entry.js → p-aecf6437.entry.js} +1 -1
- package/dist/ketchup/{p-31a3eb96.entry.js → p-bc0a2875.entry.js} +1 -1
- package/dist/ketchup/{p-bbc121a2.entry.js → p-da3b5277.entry.js} +1 -1
- package/dist/ketchup/{p-8e04781a.js → p-de755f71.js} +1 -1
- package/dist/ketchup/{p-6d51125a.js → p-e50650d0.js} +1 -1
- package/dist/ketchup/{p-abdbd35e.entry.js → p-ec469a38.entry.js} +1 -1
- package/dist/ketchup/{p-f0b3d110.entry.js → p-ee382e52.entry.js} +1 -1
- package/dist/ketchup/{p-613ef7fa.entry.js → p-f8069901.entry.js} +1 -1
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +6 -0
- package/dist/types/components/kup-card/built-in/kup-card-openai.d.ts +3 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +20 -1
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +3 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +2 -0
- package/dist/types/managers/kup-openai/kup-openai-declarations.d.ts +4 -0
- package/dist/types/managers/kup-openai/kup-openai.d.ts +29 -0
- package/package.json +1 -1
- package/dist/ketchup/p-8c835b19.entry.js +0 -1
- package/dist/ketchup/p-91ee68b1.js +0 -29
- package/dist/ketchup/p-bfa85d01.js +0 -1
- package/dist/ketchup/p-d6aa3b78.entry.js +0 -1
- package/dist/ketchup/p-e4657f9b.entry.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,f as i,h as s,H as e,d as o}from"./p-cd9a4274.js";import{k as a,g as c,s as n,l as r,d as h,ai as l,N as u,aj as p,U as d,c as b}from"./p-
|
|
1
|
+
import{r as t,f as i,h as s,H as e,d as o}from"./p-cd9a4274.js";import{k as a,g as c,s as n,l as r,d as h,ai as l,N as u,aj as p,U as d,c as b}from"./p-7e1d9192.js";import{F as m}from"./p-c634eb82.js";import{F as k}from"./p-9e68a4c0.js";import{c as g}from"./p-635bb4b3.js";import"./p-c23731ca.js";var f,x;!function(t){t.customStyle="Custom style of the component.",t.data="Sets the data that will be used to display different components."}(f||(f={})),function(t){t.BOX="Box",t.BUTTON_LIST="Button List",t.CHART="Chart",t.CHIP="Chip",t.ECHART="Echart",t.DATATABLE="Datatable",t.JSON="JSON",t.TREE="Tree"}(x||(x={}));const y=class{constructor(i){t(this,i),this.dragHandler=null,this.kupManager=a(),this.textArea=null,this.wrapperRef=null,this.display=x.DATATABLE,this.customStyle="",this.data=null}async getProps(t){return c(this,f,t)}async refresh(){i(this)}async setProps(t){n(this,f,t)}comboboxProps(){const t=[];for(const i in x)Object.prototype.hasOwnProperty.call(x,i)&&t.push({id:x[i],selected:!1,value:x[i]});return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:!1,inputType:"text",label:this.kupManager.language.translate(r.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:!0,"onKup-combobox-itemclick":t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0),i=[],e={};if(this.display===x.JSON)e.initialValue=this.data?JSON.stringify(this.data,null,2):"",e.textArea=!0,i.push(s("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},e,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})));else if(t)switch(this.display){case x.BOX:e.data=this.data,i.push(s("kup-box",Object.assign({},e)));break;case x.BUTTON_LIST:e.data=this.data,i.push(s("kup-button-list",Object.assign({},e)));break;case x.CHIP:e.data=this.data,i.push(s("kup-chip",Object.assign({},e)));break;case x.CHART:case x.ECHART:e.data=this.data,e.series=[],e.axis=null;for(let t=0;t<this.data.columns.length;t++){const i=this.data.columns[t];i.obj&&this.kupManager.objects.isNumber(i.obj)||null!==e.axis?e.series.push(this.display===x.CHART?{code:i.name,decode:i.title}:i.name):e.axis=i.name}0===e.series.length&&this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",h.WARNING),e.axis||this.kupManager.debug.logMessage(this,"No axis for the chart!",h.WARNING),i.push(s(this.display===x.CHART?"kup-chart":"kup-echart",Object.assign({},e)));break;case x.DATATABLE:e.data=this.data,e.autoFillMissingCells=!0,i.push(s("kup-data-table",Object.assign({},e)));break;case x.TREE:e.data=this.data,i.push(s("kup-tree",Object.assign({class:"kup-full-width"},e)));break;default:return void this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",h.ERROR)}else i.push(s("div",{class:"empty"},s(k,{sizeY:"100px",resource:"move_to_inbox"}),s("div",{class:"empty-text"},this.kupManager.language.translate(r.DROP_YOUR_DATA))));return i}updateData(t){{const i=Object.assign({},this.data),s=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null,e=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(s&&s.name?i.columns?this.data.columns.find((t=>t.name===s.name))||i.columns.push(s):i.columns=[s]:this.kupManager.debug.logMessage(this,"Invalid column received.",h.WARNING),e&&(i.rows?i.rows.push(e):i.rows=[e]),this.data=i,this.data&&this.textArea)try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(l,(t=>this.updateData(t))),this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle"),this.kupManager.interact.dialogify(this.rootElement,this.dragHandler),this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${u}],[${p}]`},{dispatcher:this.rootElement,type:d.MAGICBOX}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return s(e,null,s("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{id:g},s("div",{class:"magic-box-wrapper"},s("div",{class:"actions",id:"drag-handle"},s("kup-combobox",Object.assign({},this.comboboxProps())),s("kup-button",{styling:m.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),s("kup-button",{id:"close-dialog",customStyle:`:host{${b.PRIMARY}: var(${b.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),s("div",{class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};y.style=":host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-color);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";export{y as kup_magic_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as o,H as s,d as r}from"./p-cd9a4274.js";import{k as h,g as a,s as n}from"./p-
|
|
1
|
+
import{r as t,c as e,f as i,h as o,H as s,d as r}from"./p-cd9a4274.js";import{k as h,g as a,s as n}from"./p-7e1d9192.js";import{c as p}from"./p-635bb4b3.js";import"./p-c23731ca.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var c,f,d,u,m,w,b=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},v=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),c.set(this,null),f.set(this,h()),d.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return a(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){v(this,c,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,b(this,c,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){b(this,f,"f").debug.logLoad(this,!1),b(this,f,"f").theme.register(this),this.setObserver()}componentDidLoad(){b(this,f,"f").debug.logLoad(this,!0)}componentWillRender(){b(this,f,"f").debug.logRender(this,!1)}componentDidRender(){b(this,f,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!b(this,m,"f")&&v(this,m,!0,"f"),o(s,null,o("style",null,b(this,f,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{v(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>v(this,d,t,"f"),onLoad:()=>{b(this,d,"f").naturalWidth>b(this,d,"f").naturalHeight?b(this,w,"f").classList.add("horizontal"):b(this,w,"f").classList.add("vertical"),b(this,c,"f").observe(this.rootElement),b(this,d,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),b(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>v(this,u,t,"f"),onLoad:()=>{b(this,d,"f").classList.add("placeholder--fade-out"),b(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;b(this,f,"f").theme.unregister(this),null===(t=b(this,c,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};c=new WeakMap,f=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
|
|
@@ -37,3 +37,9 @@ export declare function create5(component: KupCard): VNode;
|
|
|
37
37
|
* @returns {VNode} 6th built-in layout virtual node.
|
|
38
38
|
*/
|
|
39
39
|
export declare function create6(component: KupCard): VNode;
|
|
40
|
+
/**
|
|
41
|
+
* 7th built-in layout, Open AI interface.
|
|
42
|
+
* @param {KupCard} component - Card component.
|
|
43
|
+
* @returns {VNode} 7th built-in layout virtual node.
|
|
44
|
+
*/
|
|
45
|
+
export declare function create7(component: KupCard): VNode;
|
|
@@ -3,6 +3,8 @@ import { KupObj } from '../../managers/kup-objects/kup-objects-declarations';
|
|
|
3
3
|
import { SourceEvent } from '../kup-date-picker/kup-date-picker-declarations';
|
|
4
4
|
import Picker from 'vanilla-picker';
|
|
5
5
|
import { KupDataColumn, KupDataDataset } from '../../managers/kup-data/kup-data-declarations';
|
|
6
|
+
import { KupTextFieldEventPayload } from '../kup-text-field/kup-text-field-declarations';
|
|
7
|
+
import { KupTextFieldCustomEvent } from '../../components';
|
|
6
8
|
/**
|
|
7
9
|
* Props of the kup-card component.
|
|
8
10
|
* Used to export every prop in an object.
|
|
@@ -60,6 +62,22 @@ export interface KupCardBuiltInMessageBoxOptions {
|
|
|
60
62
|
confirmCb?: (e: MouseEvent) => unknown;
|
|
61
63
|
text?: string;
|
|
62
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Options of the built-in Open AI interface.
|
|
67
|
+
*/
|
|
68
|
+
export interface KupCardBuiltInOpenAIOptions {
|
|
69
|
+
authCb?: (event: KupTextFieldCustomEvent<KupTextFieldEventPayload>) => void;
|
|
70
|
+
messages?: KupCardBuiltInOpenAIMessages[];
|
|
71
|
+
state?: 'authentication' | 'connecting' | 'error' | 'ready';
|
|
72
|
+
submitCb?: (disableCb: (status: boolean) => void, inputArea?: HTMLKupTextFieldElement) => void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Message interface of the Open AI interface.
|
|
76
|
+
*/
|
|
77
|
+
export interface KupCardBuiltInOpenAIMessages {
|
|
78
|
+
text: string;
|
|
79
|
+
type: 'request' | 'response';
|
|
80
|
+
}
|
|
63
81
|
/**
|
|
64
82
|
* Options of the built-in column drop menu.
|
|
65
83
|
*/
|
|
@@ -153,7 +171,7 @@ export interface KupCardData {
|
|
|
153
171
|
image?: GenericObject[];
|
|
154
172
|
list?: GenericObject[];
|
|
155
173
|
object?: KupObj[];
|
|
156
|
-
options?: KupCardBuiltInCalendarOptions | KupCardBuiltInClockOptions | KupCardColumnDropMenuOptions | KupCardColorPickerOptions | KupCardBuiltInNumericOptions | KupCardBuiltInMessageBoxOptions;
|
|
174
|
+
options?: KupCardBuiltInCalendarOptions | KupCardBuiltInClockOptions | KupCardColumnDropMenuOptions | KupCardColorPickerOptions | KupCardBuiltInNumericOptions | KupCardBuiltInMessageBoxOptions | KupCardBuiltInOpenAIOptions;
|
|
157
175
|
progressbar?: GenericObject[];
|
|
158
176
|
switch?: GenericObject[];
|
|
159
177
|
tabbar?: GenericObject[];
|
|
@@ -200,6 +218,7 @@ export declare enum KupCardIds {
|
|
|
200
218
|
* Recurring CSS classes.
|
|
201
219
|
*/
|
|
202
220
|
export declare enum KupCardCSSClasses {
|
|
221
|
+
AUTOSCROLL = "autoscroll",
|
|
203
222
|
BUILT_IN_CARD = "built-in-card",
|
|
204
223
|
CARD_VIEW = "card-view",
|
|
205
224
|
CLICKABLE_LINK = "clickable-link",
|
|
@@ -22,6 +22,7 @@ import type { ResizeObserver } from 'resize-observer';
|
|
|
22
22
|
import { KupMathLocales } from '../kup-math/kup-math-declarations';
|
|
23
23
|
import { KupTooltipCallbacks } from '../kup-tooltip/kup-tooltip-declarations';
|
|
24
24
|
import { Options } from 'html2canvas';
|
|
25
|
+
import { KupOpenAI } from '../kup-openai/kup-openai';
|
|
25
26
|
/**
|
|
26
27
|
* Interface used to define the HTML element with Ketchup specific properties.
|
|
27
28
|
*/
|
|
@@ -40,6 +41,7 @@ export interface KupManager {
|
|
|
40
41
|
interact: KupInteract;
|
|
41
42
|
language: KupLanguage;
|
|
42
43
|
magicBox: HTMLKupMagicBoxElement;
|
|
44
|
+
openAI: KupOpenAI;
|
|
43
45
|
math: KupMath;
|
|
44
46
|
objects: KupObjects;
|
|
45
47
|
overrides?: KupManagerInitialization;
|
|
@@ -88,6 +90,7 @@ export interface KupManagerInitialization {
|
|
|
88
90
|
scrollOnHover?: KupManagerScrollOnHoverSettings;
|
|
89
91
|
theme?: KupManagerThemeSettings;
|
|
90
92
|
tooltip?: KupManagerTooltipSettings;
|
|
93
|
+
openAIUrl?: string;
|
|
91
94
|
}
|
|
92
95
|
/**
|
|
93
96
|
* KupDates initialization settings.
|
|
@@ -15,6 +15,7 @@ import { KupSearch } from '../kup-search/kup-search';
|
|
|
15
15
|
import { KupMath } from '../kup-math/kup-math';
|
|
16
16
|
import { KupTooltip } from '../kup-tooltip/kup-tooltip';
|
|
17
17
|
import { Options } from 'html2canvas';
|
|
18
|
+
import { KupOpenAI } from '../kup-openai/kup-openai';
|
|
18
19
|
/**
|
|
19
20
|
* This class controls every other Ketchup utility suite.
|
|
20
21
|
* @module KupManager
|
|
@@ -27,6 +28,7 @@ export declare class KupManager {
|
|
|
27
28
|
interact: KupInteract;
|
|
28
29
|
language: KupLanguage;
|
|
29
30
|
magicBox: HTMLKupMagicBoxElement;
|
|
31
|
+
openAI: KupOpenAI;
|
|
30
32
|
math: KupMath;
|
|
31
33
|
objects: KupObjects;
|
|
32
34
|
overrides?: KupManagerInitialization;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { KupDataTableDataset, KupTextFieldCustomEvent, KupTextFieldEventPayload } from '../../components';
|
|
2
|
+
import { KupCardBuiltInOpenAIOptions } from '../../components/kup-card/kup-card-declarations';
|
|
3
|
+
import { KupOpenAISessionInfo } from './kup-openai-declarations';
|
|
4
|
+
export declare class KupOpenAI {
|
|
5
|
+
#private;
|
|
6
|
+
card: HTMLKupCardElement;
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
data: KupDataTableDataset;
|
|
9
|
+
dialog: HTMLKupDialogElement;
|
|
10
|
+
sessionInfo: KupOpenAISessionInfo;
|
|
11
|
+
url: string;
|
|
12
|
+
/**
|
|
13
|
+
* Initializes KupOpenAI.
|
|
14
|
+
*/
|
|
15
|
+
constructor(url: string);
|
|
16
|
+
getCardOptions(): KupCardBuiltInOpenAIOptions;
|
|
17
|
+
/**
|
|
18
|
+
* Shows the component
|
|
19
|
+
* @param data
|
|
20
|
+
* @param options
|
|
21
|
+
*/
|
|
22
|
+
show(data: KupDataTableDataset): void;
|
|
23
|
+
/**
|
|
24
|
+
* Hides the component.
|
|
25
|
+
*/
|
|
26
|
+
hide(): void;
|
|
27
|
+
auth(event: KupTextFieldCustomEvent<KupTextFieldEventPayload>): Promise<void>;
|
|
28
|
+
chat(disableInteractivity: any, inputArea: HTMLKupTextFieldElement): Promise<void>;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,f as n,h as l,H as a,d as t}from"./p-cd9a4274.js";import{k as e,g as r,s,d}from"./p-91ee68b1.js";import{c as o}from"./p-635bb4b3.js";import"./p-c23731ca.js";var p;!function(i){i.columns="The number of columns displayed by the grid, the default behavior is 12.",i.customStyle="Custom style of the component. For more information: https://ketchup.smeup.com/ketchup-showcase/#/customization",i.singleLine="When set to true, forces the content on a single line."}(p||(p={}));const u=class{constructor(n){i(this,n),this.kupManager=e(),this.columns=12,this.customStyle="",this.singleLine=!1}async getProps(i){return r(this,p,i)}async refresh(){n(this)}async setProps(i){s(this,p,i)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const i=this.rootElement.children;if(!i||0===i.length)return void this.kupManager.debug.logMessage(this,"Missing slots, not rendering!",d.WARNING);const n=[];for(let a=0;a<i.length;a++){let t=null;if(this.singleLine)t=l("slot",{name:`${a}`});else{const n=i[a].span||i[a].getAttribute("span")||1;t=l("div",{class:`layout-grid__cell layout-grid__cell--span-${n}`},l("slot",{name:`${a}`}))}n.push(t)}const t={};return this.columns&&12!==this.columns&&(t["--kup_grid_columns"]=this.columns),l(a,{style:t},l("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),l("div",{id:o},l("div",{class:this.singleLine?"flex-layout":"layout-grid"},l("div",{class:this.singleLine?"flex-layout__inner":"layout-grid__inner"},n))))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return t(this)}};u.style=":host{--kup_grid_font_size:var(--kup-grid-font-size, var(--kup-font-size));--kup_grid_gap:var(--kup-grid-gap, 24px);--kup_grid_gap_mobile:var(--kup-grid-gap-mobile, 16px);--kup_grid_padding:var(--kup-grid-padding, 24px);display:block;font-size:var(--kup_grid_font_size);height:100%;width:100%}#kup-component{height:100%;width:100%}.layout-grid{box-sizing:border-box;margin:0px auto;padding:var(--kup_grid_padding)}.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap);grid-template-columns:repeat(var(--kup_grid_columns, 12), minmax(0px, 1fr))}.layout-grid .layout-grid__inner .layout-grid__cell{box-sizing:border-box;display:flex;justify-content:center;margin:0px;width:auto}.layout-grid__cell--span-1{grid-column-end:span 1}.layout-grid__cell--span-2{grid-column-end:span 2}.layout-grid__cell--span-3{grid-column-end:span 3}.layout-grid__cell--span-4{grid-column-end:span 4}.layout-grid__cell--span-5{grid-column-end:span 5}.layout-grid__cell--span-6{grid-column-end:span 6}.layout-grid__cell--span-7{grid-column-end:span 7}.layout-grid__cell--span-8{grid-column-end:span 8}.layout-grid__cell--span-9{grid-column-end:span 9}.layout-grid__cell--span-10{grid-column-end:span 10}.layout-grid__cell--span-11{grid-column-end:span 11}.layout-grid__cell--span-12{grid-column-end:span 12}.layout-grid__cell--span-13{grid-column-end:span 13}.layout-grid__cell--span-14{grid-column-end:span 14}.layout-grid__cell--span-15{grid-column-end:span 15}.layout-grid__cell--span-16{grid-column-end:span 16}.layout-grid__cell--span-17{grid-column-end:span 17}.layout-grid__cell--span-18{grid-column-end:span 18}.layout-grid__cell--span-19{grid-column-end:span 19}.layout-grid__cell--span-20{grid-column-end:span 20}.layout-grid__cell--span-21{grid-column-end:span 21}.layout-grid__cell--span-22{grid-column-end:span 22}.layout-grid__cell--span-23{grid-column-end:span 23}.layout-grid__cell--span-24{grid-column-end:span 24}.flex-layout,.flex-layout__inner{height:100%;align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap}.flex-layout__inner{width:auto}.flex-layout__inner *{display:block;margin:0 1.5em}.flex-layout__inner .flex-layout__cell{display:flex}.flex-layout__inner .flex-layout__cell *{justify-content:center;margin:auto}@media (min-width: 600px) and (max-width: 839px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 8), minmax(0px, 1fr))}}@media (max-width: 599px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 4), minmax(0px, 1fr))}}:host(.kup-full-width) .flex-layout__inner{width:100%}:host(.kup-full-width) .flex-layout__inner *{margin:auto}:host(.kup-full-width.scalable-cards) .flex-layout__inner{width:100%}:host(.kup-full-width.scalable-cards) .flex-layout__inner *{margin:0;height:100%;width:100%}";export{u as kup_grid}
|