@sme.up/ketchup 8.3.2 → 8.3.3
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-be5c564a.js → f-button-7687085a.js} +3 -3
- package/dist/cjs/{f-cell-d034bcb0.js → f-cell-37ef6f00.js} +6 -6
- package/dist/cjs/{f-checkbox-cff77b2c.js → f-checkbox-758d1d34.js} +1 -1
- package/dist/cjs/{f-chip-bc678bf1.js → f-chip-cf59bdb3.js} +3 -3
- package/dist/cjs/{f-image-8542c984.js → f-image-1245b0cf.js} +2 -2
- package/dist/cjs/{f-paginator-utils-f48afc35.js → f-paginator-utils-b1af2a8f.js} +4 -4
- package/dist/cjs/{f-text-field-acfc1717.js → f-text-field-9c745112.js} +2 -2
- package/dist/cjs/{f-text-field-mdc-d38d80b5.js → f-text-field-mdc-b1fa6fd6.js} +1 -1
- package/dist/cjs/{index-a9a3b467.js → index-eac07680.js} +4 -11
- package/dist/cjs/ketchup.cjs.js +3 -6
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +16 -16
- package/dist/cjs/kup-box.cjs.entry.js +14 -14
- package/dist/cjs/kup-calendar.cjs.entry.js +15 -9
- package/dist/cjs/kup-cell.cjs.entry.js +8 -8
- package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
- package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
- package/dist/cjs/kup-dashboard.cjs.entry.js +10 -10
- package/dist/cjs/kup-drawer.cjs.entry.js +3 -3
- package/dist/cjs/kup-echart.cjs.entry.js +27 -15
- package/dist/cjs/kup-family-tree.cjs.entry.js +6 -6
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +11 -11
- package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
- package/dist/cjs/kup-magic-box.cjs.entry.js +5 -5
- package/dist/cjs/{kup-manager-b3677c1d.js → kup-manager-38caaef3.js} +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +6 -6
- package/dist/cjs/kup-photo-frame.cjs.entry.js +3 -3
- package/dist/cjs/kup-planner.cjs.entry.js +26 -18
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
- package/dist/cjs/loader.cjs.js +3 -12
- package/dist/collection/assets/data-table.js +0 -44
- package/dist/collection/assets/echart.js +168 -90
- package/dist/collection/collection-manifest.json +50 -50
- package/dist/collection/components/kup-accordion/kup-accordion.js +28 -18
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +47 -29
- package/dist/collection/components/kup-badge/kup-badge.js +21 -14
- package/dist/collection/components/kup-box/kup-box.js +62 -41
- package/dist/collection/components/kup-button/kup-button.js +26 -17
- package/dist/collection/components/kup-button-list/kup-button-list.e2e.js +1 -1
- package/dist/collection/components/kup-button-list/kup-button-list.js +24 -16
- package/dist/collection/components/kup-calendar/kup-calendar-declarations.js +2 -1
- package/dist/collection/components/kup-calendar/kup-calendar.css +13 -0
- package/dist/collection/components/kup-calendar/kup-calendar.js +73 -35
- package/dist/collection/components/kup-card/box/kup-card-box.js +3 -3
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +7 -7
- package/dist/collection/components/kup-card/built-in/kup-card-calendar.js +6 -6
- package/dist/collection/components/kup-card/built-in/kup-card-clock.js +5 -5
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +4 -4
- package/dist/collection/components/kup-card/built-in/kup-card-message-box.js +4 -4
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +2 -2
- package/dist/collection/components/kup-card/collapsible/kup-card-collapsible.js +5 -5
- package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +5 -5
- package/dist/collection/components/kup-card/free/kup-card-free.js +2 -2
- package/dist/collection/components/kup-card/kup-card-helper.js +5 -5
- package/dist/collection/components/kup-card/kup-card.js +42 -30
- package/dist/collection/components/kup-card/scalable/kup-card-scalable.js +4 -4
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +9 -9
- package/dist/collection/components/kup-cell/kup-cell.js +27 -18
- package/dist/collection/components/kup-chart/kup-chart-builder.js +5 -5
- package/dist/collection/components/kup-chart/kup-chart.js +47 -28
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +22 -14
- package/dist/collection/components/kup-chip/kup-chip.js +32 -20
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +30 -20
- package/dist/collection/components/kup-combobox/kup-combobox.js +47 -29
- package/dist/collection/components/kup-dash/kup-dash.js +2 -2
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +11 -7
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +26 -19
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +4 -4
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +2 -2
- package/dist/collection/components/kup-data-table/kup-data-table.js +178 -106
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +42 -26
- package/dist/collection/components/kup-dialog/kup-dialog.js +30 -18
- package/dist/collection/components/kup-drawer/kup-drawer.e2e.js +1 -1
- package/dist/collection/components/kup-drawer/kup-drawer.js +29 -17
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +42 -26
- package/dist/collection/components/kup-echart/kup-echart.js +64 -37
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +42 -26
- package/dist/collection/components/kup-form/kup-form.js +32 -21
- package/dist/collection/components/kup-gauge/kup-gauge.js +18 -13
- package/dist/collection/components/kup-grid/kup-grid.js +16 -11
- package/dist/collection/components/kup-iframe/kup-iframe.js +21 -13
- package/dist/collection/components/kup-image/canvas/kup-image-canvas-declarations.js +1 -1
- package/dist/collection/components/kup-image/canvas/kup-image-canvas-helper.js +1 -1
- package/dist/collection/components/kup-image/canvas/kup-image-canvas.js +2 -2
- package/dist/collection/components/kup-image/kup-image.js +27 -18
- package/dist/collection/components/kup-image-list/kup-image-list.js +35 -24
- package/dist/collection/components/kup-lazy/kup-lazy.js +25 -15
- package/dist/collection/components/kup-list/kup-list-helper.js +1 -1
- package/dist/collection/components/kup-list/kup-list.js +45 -27
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +23 -17
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +23 -14
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +40 -24
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +23 -14
- package/dist/collection/components/kup-planner/kup-planner-helper.js +3 -3
- package/dist/collection/components/kup-planner/kup-planner.css +277 -277
- package/dist/collection/components/kup-planner/kup-planner.js +51 -33
- package/dist/collection/components/kup-probe/kup-probe.js +7 -5
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +15 -10
- package/dist/collection/components/kup-qlik/kup-qlik.js +8 -5
- package/dist/collection/components/kup-radio/kup-radio.js +23 -14
- package/dist/collection/components/kup-rating/kup-rating.js +17 -11
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +26 -16
- package/dist/collection/components/kup-spinner/kup-spinner.js +17 -11
- package/dist/collection/components/kup-state/mock-store.js +1 -1
- package/dist/collection/components/kup-switch/kup-switch.js +22 -14
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +31 -20
- package/dist/collection/components/kup-text-field/kup-text-field.js +40 -24
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +47 -29
- package/dist/collection/components/kup-tree/kup-tree.js +104 -63
- package/dist/collection/f-components/f-button/f-button.js +3 -3
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +1 -1
- package/dist/collection/f-components/f-cell/f-cell.js +12 -12
- package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -1
- package/dist/collection/f-components/f-chip/f-chip.js +5 -5
- package/dist/collection/f-components/f-image/f-image.js +3 -3
- package/dist/collection/f-components/f-paginator/f-paginator.js +5 -5
- package/dist/collection/f-components/f-switch/f-switch.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +2 -2
- package/dist/collection/f-components/f-text-field/f-text-field.js +2 -2
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +4 -4
- package/dist/collection/managers/kup-data/kup-data-column-helper.js +3 -3
- package/dist/collection/managers/kup-data/kup-data.js +8 -8
- package/dist/collection/managers/kup-dates/kup-dates.js +11 -11
- package/dist/collection/managers/kup-debug/kup-debug.js +3 -3
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +2 -2
- package/dist/collection/managers/kup-interact/kup-interact.js +2 -2
- package/dist/collection/managers/kup-language/kup-language.js +3 -3
- package/dist/collection/managers/kup-manager/kup-manager.js +20 -20
- package/dist/collection/managers/kup-math/kup-math-helper.js +1 -1
- package/dist/collection/managers/kup-math/kup-math.js +11 -11
- package/dist/collection/managers/kup-objects/kup-objects.js +1 -1
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +1 -1
- package/dist/collection/managers/kup-search/kup-search.js +2 -2
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -1
- package/dist/collection/managers/kup-theme/kup-theme.js +15 -15
- package/dist/collection/managers/kup-toolbar/kup-toolbar.js +1 -1
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +1 -1
- package/dist/collection/utils/cell-utils.js +1 -1
- package/dist/collection/utils/filters/filters-column-menu.js +3 -3
- package/dist/collection/utils/filters/filters-rows.js +6 -6
- package/dist/collection/utils/filters/filters-tree-items.js +4 -4
- package/dist/collection/utils/filters/filters.js +3 -3
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +12 -12
- package/dist/collection/utils/utils.js +1 -1
- package/dist/components/kup-autocomplete2.js +3 -3
- package/dist/components/kup-calendar.js +9 -2
- package/dist/components/kup-echart2.js +24 -12
- package/dist/components/kup-planner.js +20 -12
- package/dist/esm/{f-button-3b97025a.js → f-button-e54ce8d5.js} +3 -3
- package/dist/esm/{f-cell-ae537010.js → f-cell-4149a05d.js} +6 -6
- package/dist/esm/{f-checkbox-91358c27.js → f-checkbox-7b113dd8.js} +1 -1
- package/dist/esm/{f-chip-69df7df4.js → f-chip-c3c86f7b.js} +3 -3
- package/dist/esm/{f-image-705c1694.js → f-image-adceee49.js} +2 -2
- package/dist/esm/{f-paginator-utils-b7009f00.js → f-paginator-utils-e559dac8.js} +4 -4
- package/dist/esm/{f-text-field-fa349928.js → f-text-field-aa4497a8.js} +2 -2
- package/dist/esm/{f-text-field-mdc-a1b4a919.js → f-text-field-mdc-32a1ffd9.js} +1 -1
- package/dist/esm/{index-bb15ce14.js → index-d413187a.js} +5 -11
- package/dist/esm/ketchup.js +4 -7
- package/dist/esm/kup-accordion.entry.js +5 -5
- package/dist/esm/kup-autocomplete_27.entry.js +16 -16
- package/dist/esm/kup-box.entry.js +14 -14
- package/dist/esm/kup-calendar.entry.js +15 -9
- package/dist/esm/kup-cell.entry.js +8 -8
- package/dist/esm/kup-dash-list.entry.js +2 -2
- package/dist/esm/kup-dash_2.entry.js +3 -3
- package/dist/esm/kup-dashboard.entry.js +10 -10
- package/dist/esm/kup-drawer.entry.js +3 -3
- package/dist/esm/kup-echart.entry.js +27 -15
- package/dist/esm/kup-family-tree.entry.js +6 -6
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +11 -11
- package/dist/esm/kup-lazy.entry.js +3 -3
- package/dist/esm/kup-magic-box.entry.js +5 -5
- package/dist/esm/{kup-manager-bad7bec3.js → kup-manager-a4153fb2.js} +1 -1
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +6 -6
- package/dist/esm/kup-photo-frame.entry.js +3 -3
- package/dist/esm/kup-planner.entry.js +26 -18
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +6 -6
- package/dist/esm/loader.js +4 -13
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-a8eccd10.entry.js → p-0848391f.entry.js} +1 -1
- package/dist/ketchup/{p-aa373c37.entry.js → p-23d54fb2.entry.js} +1 -1
- package/dist/ketchup/{p-e6cf7db3.entry.js → p-25d45dc9.entry.js} +1 -1
- package/dist/ketchup/{p-e1f0ade4.entry.js → p-2739b7ac.entry.js} +1 -1
- package/dist/ketchup/p-283ca113.entry.js +1 -0
- package/dist/ketchup/{p-afa2af1e.js → p-2f0798d3.js} +1 -1
- package/dist/ketchup/{p-be89bc7b.entry.js → p-3081ed82.entry.js} +1 -1
- package/dist/ketchup/{p-c455cc67.entry.js → p-384137d7.entry.js} +2 -2
- package/dist/ketchup/{p-ef21d377.entry.js → p-3972b97c.entry.js} +1 -1
- package/dist/ketchup/{p-31da4bae.entry.js → p-3bbcae45.entry.js} +1 -1
- package/dist/ketchup/{p-68c5029f.entry.js → p-3c44e838.entry.js} +1 -1
- package/dist/ketchup/{p-fefa9ae4.entry.js → p-3d671241.entry.js} +1 -1
- package/dist/ketchup/{p-4c79ea53.entry.js → p-44b5c573.entry.js} +1 -1
- package/dist/ketchup/{p-82b5fac1.js → p-47752f3b.js} +1 -1
- package/dist/ketchup/{p-0b24a2ed.entry.js → p-5ce0e645.entry.js} +1 -1
- package/dist/ketchup/{p-55182fcf.js → p-698442ed.js} +1 -1
- package/dist/ketchup/{p-fb03f2f5.js → p-6d9ffb32.js} +1 -1
- package/dist/ketchup/{p-fd1323da.js → p-7360a410.js} +1 -1
- package/dist/ketchup/{p-af50bc6b.entry.js → p-b415fe84.entry.js} +1 -1
- package/dist/ketchup/{p-ee39977d.entry.js → p-b623c774.entry.js} +1 -1
- package/dist/ketchup/{p-2587abcf.entry.js → p-b8fcbcc9.entry.js} +1 -1
- package/dist/ketchup/{p-1ad1cf92.entry.js → p-be864593.entry.js} +2 -2
- package/dist/ketchup/{p-15ffcd21.entry.js → p-c0878519.entry.js} +1 -1
- package/dist/ketchup/{p-bd21cdea.entry.js → p-c39ddeae.entry.js} +1 -1
- package/dist/ketchup/{p-fb0b5466.js → p-d680bdde.js} +1 -1
- package/dist/ketchup/{p-3879be61.js → p-d817be2a.js} +1 -1
- package/dist/ketchup/{p-bd5ece4c.js → p-e76b646c.js} +1 -1
- package/dist/ketchup/{p-7664a38d.entry.js → p-e917200c.entry.js} +2 -2
- package/dist/ketchup/{p-b3eeb140.entry.js → p-eec864dd.entry.js} +1 -1
- package/dist/ketchup/{p-6c995fb2.entry.js → p-f3c8c1da.entry.js} +1 -1
- package/dist/ketchup/{p-68cd7d9a.js → p-f79d544a.js} +1 -1
- package/dist/ketchup/p-fd75d5bf.js +2 -0
- package/dist/loader/index.d.ts +1 -1
- package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +2 -1
- package/dist/types/components/kup-calendar/kup-calendar.d.ts +5 -0
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -1
- package/package.json +5 -5
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/ketchup/p-15e6bfaf.entry.js +0 -1
- package/dist/ketchup/p-b5deb573.js +0 -2
- /package/dist/cjs/{GenericVariables-9cd88034.js → GenericVariables-1d52ba57.js} +0 -0
- /package/dist/cjs/{component-2c7ddef7.js → component-24811409.js} +0 -0
- /package/dist/cjs/{f-button-declarations-76b4fb4c.js → f-button-declarations-3fd791a8.js} +0 -0
- /package/dist/esm/{GenericVariables-6dfdd433.js → GenericVariables-d8d0541e.js} +0 -0
- /package/dist/esm/{component-e86c51ea.js → component-cc25b031.js} +0 -0
- /package/dist/esm/{f-button-declarations-fd4965d1.js → f-button-declarations-8a009df1.js} +0 -0
- /package/dist/ketchup/{p-6507e9eb.js → p-124f3f42.js} +0 -0
- /package/dist/ketchup/{p-ad2e21d2.js → p-635bb4b3.js} +0 -0
- /package/dist/ketchup/{p-0fd98ab4.js → p-b00f3575.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,f as i,h as o,H as
|
|
1
|
+
import{r as t,c as s,f as i,h as o,H as n,g as a}from"./p-fd75d5bf.js";import{k as e,g as r,s as c}from"./p-e76b646c.js";import{c as l}from"./p-635bb4b3.js";import{F as p}from"./p-47752f3b.js";import"./p-b00f3575.js";import"./p-d817be2a.js";const h="snackbar";var b;!function(t){t.actionButton="Set of FButton props to set the action button.",t.closeButton="When true, the hide button will be displayed.",t.customStyle="Custom style of the component.",t.text="Sets the textual content of the snackbar.",t.timeout="Defaults at null, when set the snackbar will automatically disappear after the specified amount of milliseconds."}(b||(b={}));const u=class{constructor(i){t(this,i),this.kupActionClick=s(this,"kup-snackbar-actionclick",6),this.kupTimeoutComplete=s(this,"kup-snackbar-timeoutcomplete",6),this.kupManager=e(),this.visible=!1,this.actionButton=null,this.closeButton=!0,this.customStyle="",this.text="",this.timeout=null}onKupActionClick(){this.hide(),this.kupActionClick.emit({comp:this,id:this.rootElement.id})}onKupTimeoutComplete(){this.kupTimeoutComplete.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,b,t)}async hide(){this.visible=!1}async refresh(){i(this)}async setProps(t){c(this,b,t)}async show(){this.visible=!0}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.timeout&&this.visible&&setTimeout((()=>{this.hide(),this.onKupTimeoutComplete()}),this.timeout),this.kupManager.debug.logRender(this,!0)}render(){return o(n,{"kup-visible":this.visible},o("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{id:l},o("div",{class:h},o("div",{class:`${h}__text`},this.text),this.actionButton||this.closeButton?o("div",{class:`${h}__buttons`},this.actionButton?o("div",{class:`${h}__action`},o(p,Object.assign({},this.actionButton,{onClick:()=>this.onKupActionClick()}))):null,this.closeButton?o("div",{class:`${h}__close`},o(p,{icon:"close",onClick:()=>this.hide()})):null):null)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}};u.style=":host{animation:snackbar-show 125ms;bottom:0;box-sizing:border-box;display:block;left:0;outline:none;pointer-events:none;position:fixed;transition:opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;width:100%;z-index:calc(var(--kup-navbar-zindex) + 1)}:host(:not([kup-visible])){display:none}#kup-component{box-sizing:border-box;display:flex;justify-content:center;height:100%;padding:8px;width:100%}.snackbar{align-items:center;background:var(--kup-navbar-background-color);border-radius:5px;box-shadow:var(--kup-box-shadow);color:var(--kup-navbar-color);display:flex;justify-content:space-between;max-width:672px;min-height:48px;min-width:344px}.snackbar__text{padding:14px 16px;pointer-events:all;word-break:break-word}.snackbar__buttons{--kup-button-primary-color:var(--kup-navbar-color);--kup-button-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-button-primary-color-h:var(--kup-navbar-color-h);--kup-button-primary-color-s:var(--kup-navbar-color-s);--kup-button-primary-color-l:var(--kup-navbar-color-l);align-items:center;display:flex;justify-content:flex-end;margin-right:8px;pointer-events:all;width:max-content}.snackbar__close{--kup-button-font-size:11px;margin-left:8px;pointer-events:all}@keyframes snackbar-show{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}:host(.kup-top){bottom:unset;top:var(--kup-navbar-height, 0)}";export{u as kup_snackbar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,f as e,h as a,H as s,g as r}from"./p-
|
|
1
|
+
import{r as i,c as t,f as e,h as a,H as s,g as r}from"./p-fd75d5bf.js";import{k as o,g as n,s as l,m,d as p}from"./p-e76b646c.js";import{c}from"./p-635bb4b3.js";import{F as h}from"./p-d817be2a.js";import{F as g}from"./p-47752f3b.js";import{F as _}from"./p-b00f3575.js";import{F as u}from"./p-f79d544a.js";import{M as d}from"./p-124f3f42.js";import"./p-7360a410.js";import"./p-d680bdde.js";import"./p-698442ed.js";var f;!function(i){i.customStyle="Custom style of the component.",i.data="Actual data of the component",i.ripple="When enabled displays Material's ripple effect on clicked items."}(f||(f={}));class k{constructor(){this.load=!1}toDebugString(){return"image-list state"}}var b,v,w,y,x,j,C,M=function(i,t,e,a){if("a"===e&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?a:"a"===e?a.call(i):a?a.value:t.get(i)};const W=class{constructor(e){i(this,e),this.kupClick=t(this,"kup-imagelist-click",6),this.kupContextMenu=t(this,"kup-imagelist-contextmenu",6),this.kupDblClick=t(this,"kup-imagelist-dblclick",6),b.add(this),this.state=new k,this.kupManager=o(),v.set(this,[]),w.set(this,o()),y.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=M(this,w,"f").data.node.getParent(this.data,this.currentNode),this.currentNode||(this.navigationBarToggled=!1)},styling:_.FLAT,wrapperClass:"navigation-bar__back"}),x.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null,this.navigationBarToggled=!1},styling:_.FLAT,wrapperClass:"navigation-bar__top"}),this.currentNode=null,this.navigationBarToggled=!1,this.customStyle="",this.data=[],this.ripple=!0,this.selectedNode=[],this.stateId="",this.store=void 0}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);null!=i&&(this.currentNode=this.kupManager.data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath))}}persistState(){if(this.store&&this.stateId){let i=!1,t=this.currentNode?this.currentNode.id:"";if(this.kupManager.objects.deepEqual(this.state.selectedTreeNodePath,t)||(this.state.selectedTreeNodePath=t,i=!0),!this.state.load)return void(this.state.load=!0);i&&this.store.persistState(this.stateId,this.state)}}onKupClick(i){i.children&&i.children.length>0&&(this.currentNode=i),this.kupClick.emit({comp:this,id:this.rootElement.id,node:i})}onKupContextMenu(i,t){i.preventDefault(),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,node:t})}onKupDblClick(i){for(let i=0;i<M(this,v,"f").length;i++)clearTimeout(M(this,v,"f")[i]);(function(i,t,e,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?i!==t||!s:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===a?s.call(i,e):s?s.value=e:t.set(i,e)})(this,v,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,node:i})}selectNode(i){i&&0!=i.length&&(this.currentNode=this.kupManager.data.node.find(this.data,i))}async getProps(i){return n(this,f,i)}async refresh(){e(this)}async setProps(i){l(this,f,i)}componentWillLoad(){M(this,w,"f").debug.logLoad(this,!1),M(this,w,"f").language.register(this),M(this,w,"f").theme.register(this)}componentDidLoad(){M(this,w,"f").debug.logLoad(this,!0)}componentWillRender(){M(this,w,"f").debug.logRender(this,!1)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const t=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(t)for(let i=0;i<t.length;i++)d.attachTo(t[i])}this.persistState(),M(this,w,"f").debug.logRender(this,!0)}render(){const i=!!this.currentNode;return a(s,null,a("style",null,M(this,w,"f").theme.setKupStyle(this.rootElement)),a("div",{id:c},a("div",{class:"navigation-bar"},i?a("div",{class:"navigation-bar__wrapper "+(this.navigationBarToggled?"navigation-bar__wrapper--active":"")},a("div",{class:"navigation-bar__title",onClick:()=>{this.navigationBarToggled=!this.navigationBarToggled}},a(h,{fit:!0,resource:this.currentNode.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"navigation-bar__title__image"}),a("div",{class:"navigation-bar__title__label"},this.currentNode.value)),a(g,Object.assign({},M(this,y,"f"),{label:M(this,w,"f").language.translate(m.BACK)})),a(g,Object.assign({},M(this,x,"f"),{label:M(this,w,"f").language.translate(m.TOP)}))):null),a("div",{class:"image-list"},...M(this,b,"m",C).call(this))))}disconnectedCallback(){M(this,w,"f").language.unregister(this),M(this,w,"f").theme.unregister(this)}get rootElement(){return r(this)}static get watchers(){return{selectedNode:["selectNode"]}}};v=new WeakMap,w=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakSet,j=function(i){const t=a(h,Object.assign({},{fit:!0,resource:i.icon,title:i.title,wrapperClass:"image-list__image"})),e=a("div",{class:"image-list__label"},i.value);return a(u,{cell:{value:i.value,icon:i.icon,obj:i.obj},column:{name:"IMAGE",title:"Image"},component:this,density:p.NONE,row:Object.assign({},i)},a("div",{class:"image-list__wrapper"},t,e))},C=function(){const i=[],t=this.currentNode?this.currentNode.children:this.data;for(let e=0;t&&e<t.length;e++){const s=t[e],r=a("div",{onClick:()=>{M(this,v,"f").push(setTimeout((()=>this.onKupClick(s)),300))},onContextMenu:i=>this.onKupContextMenu(i,s),onDblClick:()=>this.onKupDblClick(s),class:{"image-list__item":!0,"mdc-ripple-surface":!!this.ripple}},M(this,b,"m",j).call(this,s));i.push(r)}return i},W.style=":host{--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, 0.5em);--kup_imagelist_image_margin:var(--kup-imagelist-image-margin, 1em auto);--kup_imagelist_image_min_height:var(--kup-imagelist-image-min-height, 64px);--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n 8px\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-color)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{font-size:1.2em;font-weight:bold;letter-spacing:0.12em;overflow:hidden;padding:0 0.5em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup_imagelist_columns, 4), minmax(0px, 1fr));margin-top:1em;width:100%}.image-list .f-cell{height:100%;width:100%}.image-list__item{border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__image.f-image{margin:var(--kup_imagelist_image_margin)}.image-list__image.f-image .f-image__icon{min-height:var(--kup_imagelist_image_min_height)}.image-list__label{color:var(--kup_imagelist_text_color);letter-spacing:0.12em;margin:var(--kup_imagelist_label_margin);overflow:hidden;text-align:center;text-overflow:ellipsis}.image-list .mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.image-list .mdc-ripple-surface:before,.image-list .mdc-ripple-surface:after{background-color:var(--kup_imagelist_primary_color)}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";export{W as kup_image_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as r,f as c,h as i,H as a,g as n}from"./p-
|
|
1
|
+
import{r as o,c as r,f as c,h as i,H as a,g as n}from"./p-fd75d5bf.js";import{k as t,g as e,s as d,b as p,K as s}from"./p-e76b646c.js";import{F as l}from"./p-d817be2a.js";import{c as u}from"./p-635bb4b3.js";import{M as _}from"./p-124f3f42.js";var k;!function(o){o.customStyle="Custom style of the component. For more information: https://ketchup.smeup.com/ketchup-showcase/#/customization",o.data="Data of the accordion.",o.ripple="When enabled displays Material's ripple effect on item headers."}(k||(k={}));const h=class{constructor(c){o(this,c),this.kupAccordionItemSelected=r(this,"kup-accordion-itemselected",6),this.kupManager=t(),this.slotsNames=[],this.selectedItems=[],this.customStyle="",this.data=null,this.ripple=!0}applyRipple(){const o=this.rootElement.shadowRoot;if(o&&this.ripple){const r=o.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(r)for(let o=0;o<r.length;o++)_.attachTo(r[o])}}async collapseAll(){const o=[];for(let r=0;r<this.data.columns.length;r++){const c=this.data.columns[r].name;!this.isItemExpandible(c)&&this.isItemSelected(c)&&o.push(c)}this.selectedItems=o}async expandAll(){const o=[];for(let r=0;r<this.data.columns.length;r++){const c=this.data.columns[r].name;this.isItemExpandible(c)&&o.push(c)}this.selectedItems=o}async getProps(o){return e(this,k,o)}async refresh(){c(this)}async setProps(o){d(this,k,o)}async toggleItem(o){const r=this.isItemExpandible(o),c=[...this.selectedItems];c.includes(o)?c.splice(c.indexOf(o),1):c.push(o),this.selectedItems=c,r||this.kupAccordionItemSelected.emit({comp:this,id:this.rootElement.id,itemName:o})}isItemExpandible(o){return this.slotsNames.includes(o)}isItemSelected(o){return this.selectedItems.includes(o)}renderItems(){const o=[],r=Array.prototype.slice.call(this.rootElement.children,0);this.slotsNames=[];for(let o=0;o<r.length;o++)this.slotsNames.push(r[o].slot);for(let r=0;r<this.data.columns.length;r++){const c=this.data.columns[r],a=c.name,n=this.isItemSelected(a),t=this.isItemExpandible(a),e={"accordion-item__content":!0,"accordion-item__content--selected":!!n};o.push(i("div",{class:"accordion-item"},i("div",{title:c.title,class:{"accordion-item__header":!0,"accordion-item__header--selected":!(t||!n),"accordion-item__header--expanded":!(!t||!n),"mdc-ripple-surface":!!this.ripple},onClick:()=>this.toggleItem(a)},c.icon?i(l,{color:`var(${p.ICON})`,resource:c.icon,sizeX:"1.5em",sizeY:"1.5em",wrapperClass:"accordion-item__icon"}):null,i("span",{class:"accordion-item__text"},c.title),t?i("span",{class:`accordion-item__dropdown kup-icon ${s.DROPDOWN.replace("--","")}`}):null),i("div",{class:e},i("slot",{name:c.name}))))}return o}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.applyRipple(),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const o=this.rootElement.shadowRoot;if(o){const r=o.querySelectorAll(".mdc-ripple-surface");if(r)for(let o=0;o<r.length;o++)_.attachTo(r[o])}this.kupManager.debug.logRender(this,!0)}render(){const o=this.data&&this.data.columns?this.renderItems():null;return i(a,null,i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:u},i("div",{class:"accordion"},o)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{ripple:["applyRipple"]}}};h.style=":host{--kup_accordion_background_color:var(\n --kup-accordion-background-color,\n var(--kup-background-color)\n );--kup_accordion_border:var(\n --kup-accordion-border,\n 1px solid var(--kup-border-color)\n );--kup_accordion_border_radius:var(--kup-accordion-border-radius, 4px);--kup-accordion_dropdown_icon_color:var(\n --kup-accordion-dropdown-icon-color,\n var(--kup-icon-color)\n );--kup_accordion_font_family:var(\n --kup-accordion-font-family,\n var(--kup-font-family)\n );--kup_accordion_font_size:var(\n --kup-accordion-font-size,\n var(--kup-font-size)\n );--kup_accordion_hover_background_color:var(\n --kup-accordion-hover-background-color,\n var(--kup-hover-background-color)\n );--kup_accordion_hover_color:var(\n --kup-accordion-hover-color,\n var(--kup-hover-color)\n );--kup_accordion_padding:var(--kup-accordion-padding, 1em 1.5em);--kup_accordion_primary_color:var(\n --kup-accordion-primary-color,\n var(--kup-primary-color)\n );--kup_accordion_primary_color_rgb:var(\n --kup-accordion-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_accordion_text_color:var(\n --kup-accordion-text-color,\n var(--kup-text-color)\n );--kup_accordion_text_on_primary_color:var(\n --kup-accordion-text-on-primary-color,\n var(--kup-text-on-primary-color)\n );--kup_accordion_transition:var(--kup-accordion-transition, 80ms);display:block;font-family:var(--kup_accordion_font_family);font-size:var(--kup_accordion_font_size)}.accordion{background-color:var(--kup_accordion_background_color);border-bottom:var(--kup_accordion_border);border-radius:var(--kup_accordion_border_radius);border-top:var(--kup_accordion_border);display:flex;flex-wrap:wrap;flex-direction:column;width:100%}.accordion-item{border-left:var(--kup_accordion_border);border-right:var(--kup_accordion_border);box-sizing:border-box;width:100%}.accordion-item--visible{display:block}.accordion-item:not(:first-of-type){border-top:var(--kup_accordion_border)}.accordion-item__header{align-items:center;border:none;box-sizing:border-box;color:var(--kup_accordion_text_color);cursor:pointer;display:flex;line-height:1.75em;outline:none;padding:var(--kup_accordion_padding);text-align:left;transition:background-color var(--kup_accordion_transition), color var(--kup_accordion_transition);width:100%}.accordion-item__header:hover:not(.accordion-item__header--selected){color:var(--kup_accordion_hover_color);background-color:var(--kup_accordion_hover_background_color)}.accordion-item__header--expanded{color:var(--kup_accordion_hover_color);background-color:var(--kup_accordion_hover_background_color)}.accordion-item__header--expanded .accordion-item__dropdown{transform:rotate(-180deg)}.accordion-item__header--selected{background-color:rgba(var(--kup_accordion_primary_color_rgb), 0.175)}.accordion-item__text{margin-right:0.5em;overflow:hidden;text-overflow:ellipsis;white-space:pre}.accordion-item__text--highlighted{color:var(--kup_accordion_text_on_primary_color);background-color:var(--kup_accordion_primary_color)}.accordion-item__icon{margin-left:0;margin-right:0.5em}.accordion-item__dropdown{background-color:var(--kup-accordion_dropdown_icon_color);height:1.5em;margin-left:auto;margin-right:0;min-width:1.5em;width:1.5em;transition:transform var(--kup_accordion_transition)}.accordion-item__content{animation:fade-in 0.25s ease-out;display:none}.accordion-item__content--selected{display:block}.mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.mdc-ripple-surface:before,.mdc-ripple-surface:after{background-color:var(--kup_accordion_primary_color)}.kup-icon.kup-dropdown-icon{-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}:host(.kup-borderless){--kup-accordion-border:none}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-danger){--kup-accordion-primary-color:var(--kup-danger-color);--kup-accordion-primary-color-rgb:var(--kup-danger-color-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-info){--kup-accordion-primary-color:var(--kup-info-color);--kup-accordion-primary-color-rgb:var(--kup-info-color-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-secondary){--kup-accordion-primary-color:var(--kup-secondary-color);--kup-accordion-primary-color-rgb:var(--kup-secondary-color-rgb);--kup-accordion-text-on-primary-color:var(--kup-text-on-secondary-color)}:host(.kup-success){--kup-accordion-primary-color:var(--kup-success-color);--kup-accordion-primary-color-rgb:var(--kup-success-color-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-warning){--kup-accordion-primary-color:var(--kup-warning-color);--kup-accordion-primary-color-rgb:var(--kup-warning-color-rgb);--kup-accordion-text-on-primary-color:white}";export{h as kup_accordion}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-b5deb573.js";import{F as o}from"./p-82b5fac1.js";import{F as s}from"./p-0fd98ab4.js";import{F as _}from"./p-3879be61.js";import{k as n,g as m,s as f,m as h,Q as c}from"./p-bd5ece4c.js";import{c as u}from"./p-ad2e21d2.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,b,x,w,j,C,E,T,W,M,S,z,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},$=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),b.set(this,[]),x.set(this,n()),w.set(this,(t=>{const e=t.clientX-H(this,v,"f"),i=t.clientY-H(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,C,"f").clientWidth,e=H(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;H(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){H(this,x,"f").debug.logLoad(this,!1),H(this,x,"f").language.register(this),H(this,x,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,x,"f").debug.logRender(this,!1)}componentDidRender(){H(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),H(this,x,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},r("style",null,H(this,x,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,x,"f").language.unregister(this),H(this,x,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${H(this,x,"f").language.translate(h.EXPAND)}/${H(this,x,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;H(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,c)?p:H(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>H(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>H(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?H(this,d,"m",S).call(this,t):H(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>H(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",z).call(this,this.data.rows):r("div",null,H(this,x,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),H(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];a.tagName&&(a.classList.contains("family-tree__item__expand")&&(i=a),"TD"===a.tagName.toUpperCase())&&(r=a)}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,b,"f").push(this.rootElement),H(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),H(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
|
|
1
|
+
import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-fd75d5bf.js";import{F as o}from"./p-47752f3b.js";import{F as s}from"./p-b00f3575.js";import{F as _}from"./p-d817be2a.js";import{k as n,g as m,s as f,m as h,Q as c}from"./p-e76b646c.js";import{c as u}from"./p-635bb4b3.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,b,x,w,j,C,E,T,W,M,S,z,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},$=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),b.set(this,[]),x.set(this,n()),w.set(this,(t=>{const e=t.clientX-H(this,v,"f"),i=t.clientY-H(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,C,"f").clientWidth,e=H(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;H(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){H(this,x,"f").debug.logLoad(this,!1),H(this,x,"f").language.register(this),H(this,x,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,x,"f").debug.logRender(this,!1)}componentDidRender(){H(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),H(this,x,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},r("style",null,H(this,x,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,x,"f").language.unregister(this),H(this,x,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${H(this,x,"f").language.translate(h.EXPAND)}/${H(this,x,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;H(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,c)?p:H(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>H(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>H(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?H(this,d,"m",S).call(this,t):H(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>H(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",z).call(this,this.data.rows):r("div",null,H(this,x,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),H(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];a.tagName&&(a.classList.contains("family-tree__item__expand")&&(i=a),"TD"===a.tagName.toUpperCase())&&(r=a)}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,b,"f").push(this.rootElement),H(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),H(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as n}from"./p-
|
|
1
|
+
import{h as n}from"./p-fd75d5bf.js";import{F as t}from"./p-b00f3575.js";import{F as o}from"./p-d817be2a.js";const e=(e,u)=>{if(e.styling||(e.styling=t.RAISED),!e.label&&!e.icon)return;const i=!!(e.styling.toLowerCase()===t.ICON||e.styling.toLowerCase()===t.RAISED&&e.icon&&null==e.label);return n("div",Object.assign({class:`f-button ${e.danger?"kup-danger":""} ${e.fullHeight?"kup-full-height":""} ${e.fullWidth?"kup-full-width":""} ${e.info?"kup-info":""} ${e.large?"kup-large":""} ${e.pulsating?"kup-pulsating":""} ${e.shaped?"kup-shaped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),i?function(t){const e={color:t.disabled?"var(--kup_button_disabled_color)":"var(--kup_button_primary_color)",sizeX:t.large?"calc(1.75em * 1.5)":"1.75em",sizeY:t.large?"calc(1.75em * 1.5)":"1.75em"};return n("button",{type:t.buttonType?t.buttonType:"button",class:{"icon-button":!0,"button--disabled":!!t.disabled,"icon-button--on":!(!t.toggable||!t.checked),toggable:!!t.toggable,"button--with-spinner":!(!t.showSpinner||t.disabled)},disabled:t.disabled,onClick:t.onClick,style:{"--kup_button_spinner_height":e.sizeY,"--kup_button_spinner_width":e.sizeX},value:t.checked?"on":"off","aria-label":t.title},!t.showSpinner||t.disabled?n(o,Object.assign({},e,{resource:t.toggable&&!t.checked?t.iconOff?t.iconOff:t.icon+"_border":t.icon,wrapperClass:"icon-button__icon kup-icon"})):null,t.toggable&&!t.showSpinner?n(o,Object.assign({},e,{resource:t.icon,wrapperClass:"icon-button__icon icon-button__icon--on kup-icon"})):null,t.showSpinner&&!t.disabled?n("div",{class:"icon-button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e):function(e){const u=e.styling.toLowerCase()===t.FLAT,i=e.styling.toLowerCase()===t.FLOATING,s=e.styling.toLowerCase()===t.ICON,r=e.styling.toLowerCase()===t.OUTLINED,l=!(u||i||r||s),a={color:e.disabled?"var(--kup_button_disabled_color)":r||u?"var(--kup_button_primary_color)":"var(--kup_button_text_on_primary_color)",resource:e.icon,sizeX:i?"1.75em":"1.475em",sizeY:i?"1.75em":"1.475em",wrapperClass:"button__icon kup-icon"};e.showSpinner&&(a.wrapperClass+=" content--hidden");const c={button__label:!0,"content--hidden":!(!e.showSpinner||e.disabled)};return n("button",{type:e.buttonType?e.buttonType:"button",class:{button:!0,"button--disabled":!!e.disabled,"button--floating":!!i,"button--outlined":!!r,"button--raised":!!l,"button--no-label":!e.label||" "===e.label,"button--with-spinner":!(!e.showSpinner||e.disabled)},disabled:e.disabled,onBlur:e.onBlur,onClick:e.onClick,onFocus:e.onFocus,style:{"--kup_button_spinner_height":a.sizeY},"aria-label":e.title},e.trailingIcon?[n("span",{class:c},e.label),e.icon?n(o,Object.assign({},a)):void 0]:[e.icon?n(o,Object.assign({},a)):void 0,n("span",{class:c},e.label)],e.showSpinner&&!e.disabled?n("div",{class:"button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e),u)};export{e as F}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as t,h as i}from"./p-
|
|
1
|
+
import{r as s,c as t,h as i}from"./p-fd75d5bf.js";import{k as l,af as h}from"./p-e76b646c.js";const e=class{constructor(i){s(this,i),this.dashClick=t(this,"kup-dash-click",7),this.kupManager=l(),this.layout="1",this.fontsize="",this.active=!1,this.columnsNumber=1,this.fullWidth=!0,this.horizontal=!1,this.iconColor=[],this.valueColor=[],this.textColor=[],this.data=void 0}render(){let s=[];var t=0;return this.data.rows.forEach((l=>{let e="",o="",d="",n="",c="",r="",a={color:this.iconColor[t]?this.kupManager.theme.colorCheck(this.iconColor[t]).hexColor:null},v={color:this.textColor[t]?this.kupManager.theme.colorCheck(this.textColor[t]).hexColor:null},u={color:this.valueColor[t]?this.kupManager.theme.colorCheck(this.valueColor[t]).hexColor:null};if(e=this.data.columns[0]?i("div",{slot:"icon"},i("icon",{class:l.cells[this.data.columns[0].name].obj.k,style:a})):i("div",{slot:"icon"}),o=this.data.columns[1]?i("div",{slot:"unit",style:u},l.cells[this.data.columns[1].name].obj.k," "):i("div",{slot:"unit"}),d=this.data.columns[2]?i("div",{slot:"descr",style:v},l.cells[this.data.columns[2].name].obj.k):i("div",{slot:"descr"}),this.data.columns[3]){let s=this.data.columns[3];s.obj=l.cells[this.data.columns[3].name].obj;let t=h(s,l.cells[this.data.columns[3].name]);n=i("div",{slot:"value",style:u},t)}else n=i("div",{slot:"value"});if(this.data.columns[5]){let s=this.data.columns[5];s.obj=l.cells[this.data.columns[5].name].obj;let t=h(s,l.cells[this.data.columns[5].name]);this.data.columns[6]&&l.cells[this.data.columns[6].name].obj.k&&(t+=this.kupManager.math.decimalSeparator()),c=i("div",{slot:"value-int",style:u},t)}else c=i("div",{slot:"value-int"});r=this.data.columns[6]?i("div",{slot:"value-dec",style:u},l.cells[this.data.columns[6].name].obj.k):i("div",{slot:"value-dec"});const p=i("kup-dash",{layout:this.layout,fontsize:this.fontsize,index:t,active:this.active,slot:String(t)},e,o,d,n,c,r);s.push(p),t++})),i("div",null,i("link",{href:"https://cdn.materialdesignicons.com/4.5.95/css/materialdesignicons.min.css",rel:"stylesheet",type:"text/css"}),i("kup-grid",{columns:this.columnsNumber,singleLine:this.horizontal,class:this.fullWidth?"kup-full-width":""},s))}};e.style=".horizontal{display:inline-block;min-width:300px;max-width:100%;overflow:visible;white-space:nowrap;border:solid;border-width:1px;margin:2px}";export{e as kup_dash_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as c}from"./p-
|
|
1
|
+
import{h as c}from"./p-fd75d5bf.js";import{F as i}from"./p-d817be2a.js";import{K as s,m as e,b as n}from"./p-e76b646c.js";var p;!function(c){c.CHOICE="choice",c.FILTER="filter",c.INPUT="input",c.STANDARD="standard"}(p||(p={}));const l=document.documentElement,a=a=>{a.type||(a.type=p.STANDARD);const r=a.type.toLowerCase()===p.CHOICE,t=a.type.toLowerCase()===p.FILTER,o=a.type.toLowerCase()===p.INPUT,d={"chip-set":!0,"chip-set--choice":!!r,"chip-set--filter":!!t,"chip-set--input":!!o};return c("div",Object.assign({class:`f-chip ${a.danger?"kup-danger":""} ${a.info?"kup-info":""} ${a.secondary?"kup-secondary":""} ${a.success?"kup-success":""} ${a.warning?"kup-warning":""} ${a.wrapperClass?a.wrapperClass:""}`},a.dataSet,{id:a.id,title:a.title}),c("div",{class:d,role:"grid"},function(p,a,r,t){const o=[];for(let u=0;p.data&&u<p.data.length;u++){const _=[];function d(n,a){const r=!!(n.children&&n.children.length>0),t=!(!r||!n.isExpanded),o={"--kup_chip_indent_offset":a.toString()};if(_.push(c("div",{class:"chip-set__wrapper "+(r&&!t?"chip-set__wrapper--hidden-children":"")},c("div",{class:"chip-set__indent",style:o}),r?c(i,{onClick:p.onExpansionClick&&p.onExpansionClick[u]?p.onExpansionClick[u].bind(p.onExpansionClick[u],n):null,resource:`${s.DROPDOWN}`,sizeX:"18px",sizeY:"18px",title:l.ketchup.language.translate(e.EXPAND)+"/"+l.ketchup.language.translate(e.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):a?c(i,{resource:"blank",sizeX:"18px",sizeY:"18px",wrapperClass:"dropdown-icon"}):null,h(n))),t)for(let c=0;c<n.children.length;c++)n.children[c]&&d(n.children[c],a+1)}function h(e){let l="chip "+(e.icon&&!e.value?"chip--only-icon":""),o=[],d="chip__icon chip__icon--leading";return(r||a)&&e.checked&&(l+=" chip--selected",r&&(d+=" chip__icon--leading-hidden")),e.icon&&o.push(c(i,Object.assign({},{color:a&&e.checked?`var(${n.PRIMARY})`:`var(${n.TEXT})`,resource:e.icon,sizeX:"18px",sizeY:"18px",wrapperClass:d}))),r&&o.push(c("span",{class:"chip__checkmark"},c("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},c("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})))),c("div",{class:l,"data-value":e.id,onClick:p.onClick&&p.onClick[u]?p.onClick[u].bind(p.onClick[u],e):null,role:"row",title:e.title?e.title:""},c("span",{class:"chip-set__indent"}),o,c("span",{role:"gridcell"},c("span",{role:"button",tabindex:u,class:"chip__primary-action",value:e.id,checked:e.checked,onBlur:p.onBlur&&p.onBlur[u]?p.onBlur[u].bind(p.onBlur[u],e):null,onFocus:p.onFocus&&p.onFocus[u]?p.onFocus[u].bind(p.onFocus[u],e):null},c("span",{class:"chip__text"},p.displayId?e.id+" - "+e.value:e.value))),t?c("span",{role:"gridcell"},c("span",{tabindex:"-1",class:`kup-icon chip__icon ${s.CLEAR.replace("--","")}`,onClick:p.onIconClick&&p.onIconClick[u]?p.onIconClick[u].bind(p.onIconClick[u],e):null})):null)}d(p.data[u],0),o.push(c("div",{class:"chip-set__item"},..._))}return o}(a,r,t,o)))};export{p as F,a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as c}from"./p-
|
|
1
|
+
import{h as c}from"./p-fd75d5bf.js";const e=e=>{const o={"data-indeterminate":!!e.indeterminate},a={checkbox:!0,"checkbox--checked":!(!e.checked||e.indeterminate),"checkbox--disabled":!!e.disabled,"checkbox--indeterminate":!!e.indeterminate};return c("div",Object.assign({class:`f-checkbox ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),c("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},c("div",{class:a},c("input",Object.assign({type:"checkbox",class:"checkbox__native-control",checked:e.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus},o,{value:e.checked?"on":"off"})),c("div",{class:"checkbox__background",onClick:e.onChange},c("svg",{class:"checkbox__checkmark",viewBox:"0 0 24 24"},c("path",{class:"checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),c("div",{class:"checkbox__mixedmark"}))),e.label?c("label",null,e.label):void 0))};export{e as F}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,h as t,g as h}from"./p-
|
|
1
|
+
import{r as i,h as t,g as h}from"./p-fd75d5bf.js";import{k as o}from"./p-e76b646c.js";const e=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((h=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),h(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((h=>{this.divlist=[],i.rows.forEach((i=>{let h=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,h.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},h))})),h(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,h=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},h={"--lyo_obj-height":this.defobjsize},t("div",{class:i,style:h},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return h(this)}};e.style=".kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-color, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{e as kup_qlik}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as s,h as e,H as o,g as n}from"./p-
|
|
1
|
+
import{r as t,c as i,f as s,h as e,H as o,g as n}from"./p-fd75d5bf.js";import{F as r}from"./p-47752f3b.js";import{F as h}from"./p-7360a410.js";import{F as a}from"./p-d680bdde.js";import{F as l}from"./p-6d9ffb32.js";import{k as c,g as d,s as u,al as m,m as p,V as f,c as g}from"./p-e76b646c.js";import{c as b}from"./p-635bb4b3.js";import"./p-b00f3575.js";import"./p-d817be2a.js";import"./p-124f3f42.js";var x;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the component.",t.enableDesign="When set to true, the component is in design mode and it is draggable."}(x||(x={}));const y=class{constructor(s){t(this,s),this.kupSave=i(this,"kup-dashboard-save",6),this.kupManager=c(),this.internalData=null,this.internalDataBackup=null,this.resetInternalData=!1,this.customStyle="",this.data=null,this.enableDesign=!1}onKupSave(){this.kupSave.emit({comp:this,id:this.rootElement.id,data:this.internalData})}dataChanged(){this.resetData()}async getProps(t){return d(this,x,t)}async refresh(){s(this)}async setProps(t){u(this,x,t)}buildGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)}))}buildHeader(){const t={icon:"cancel",label:this.kupManager.language.translate(m.RESET),secondary:!0,onClick:()=>{this.resetData()}},i={icon:"save",label:this.kupManager.language.translate(m.SAVE),onClick:()=>this.onKupSave()};return e("div",{class:"header"},this.enableDesign?e(r,Object.assign({},t)):void 0,this.enableDesign?e(r,Object.assign({},i)):void 0)}buildForm(t,i){return t?e("div",{class:{form:!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout,"form-dropzone":this.enableDesign&&t&&null!=t.sections&&t.sections.length>0},style:this.getGridStyle(t),ref:s=>{s&&(s.kupData={parent:i,form:t})}},t.sections.map((i=>this.buildSection(i,t)))):e("div",null,this.kupManager.language.translate(p.EMPTY_DATA))}buildSectionHeader(t,i){const s={value:t.dim,label:this.kupManager.language.translate(m.DIMENSION),onChange:i=>{const{target:s}=i;t.dim=s.value,this.refresh()}},o={icon:"add",slim:!0,onClick:()=>{t.sections||(t.sections=[]),t.sections.push({id:t.id+(t.sections.length+1),loaded:t.loaded,layout:t.layout}),this.resetData(this.internalData)}},n={icon:"remove",slim:!0,secondary:!0,onClick:()=>{const s=i.sections.indexOf(t);i.sections.splice(s,1),this.resetData(this.internalData)}},l={checked:t.loaded,label:this.kupManager.language.translate(m.LOADED),onChange:()=>{t.loaded=!t.loaded,this.refresh()}},c={checked:"column"==t.layout,label:this.kupManager.language.translate(m.VERTICAL),onChange:()=>{t.layout="column"==t.layout?"row":"column",this.refresh()}};return e("div",{class:"section-header"},e("div",null,t.id," - ",t.layout),e("div",null,e("div",{class:"section-header-actions"},e(a,Object.assign({},s)),e(h,Object.assign({},l)),e(h,Object.assign({},c)),e(r,Object.assign({},o)),e(r,Object.assign({},n)))))}buildSection(t,i){const s={"section-body":!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout};return e("div",{class:{section:!0,"section-draggable":this.enableDesign,"section-dropzone":this.enableDesign},ref:s=>{s&&(s.kupData={parent:i,section:t})}},this.enableDesign?this.buildSectionHeader(t,i):void 0,e("div",{class:s,style:this.getGridStyle(t)},this.enableDesign||!t.loaded||t.sections&&0!=t.sections.length?void 0:e("slot",{name:t.id}),t.sections&&(t.loaded||this.enableDesign)?t.sections.map((i=>this.buildSection(i,t))):void 0))}calcSectionPosition(t,i,s,e,o){let n=e;for(let e=0;e<o.length;e++){const r=o[e].getBoundingClientRect();if(s&&t<r.y){n=e;break}if(!s&&i<r.x){n=e;break}}return n}didRenderInteractables(){try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-draggable").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.draggable(t,null,null,f.CLONE)}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-dropzone").forEach((i=>t.push(i))),this.rootElement.shadowRoot.querySelectorAll(".form-dropzone").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.dropzone(t,{ondropdeactivate:()=>{this.removeSectionPlaceHolder()},ondropmove:t=>{this.removeSectionPlaceHolder(),this.dragEnter(t.dragEvent.clientY,t.dragEvent.clientX,t.currentTarget)}},null,{drop:t=>{this.dropped(t,t.currentTarget,t.relatedTarget)}})}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}}dragEnter(t,i,s){if(s.kupData.form){const e=this.calcSectionPosition(t,i,"column"==s.kupData.form.layout,s.kupData.form.sections.length,s.children);this.setSectionPlaceHolder(s,e)}else if(s.kupData.section){const e=this.calcSectionPosition(t,i,"column"==s.kupData.section.layout,s.kupData.section.sections.length,s.lastElementChild.children);this.setSectionPlaceHolder(s.lastElementChild,e)}}dropped(t,i,s){const e=s.kupData.parent.sections.indexOf(s.kupData.section);if(s.kupData.parent.sections.splice(e,1),i.kupData.form){i.kupData.form.sections||(i.kupData.form.sections=[]);const e=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.form.layout,i.kupData.form.sections.length,i.children);i.kupData.form.sections.splice(e,0,s.kupData.section),s.kupData.parent=i.kupData.form}else if(i.kupData.section){if(!i.kupData.section.sections||0==i.kupData.section.sections.length){const t=JSON.parse(JSON.stringify(i.kupData.section));t.dim=null,s.kupData.section.dim=null,i.kupData.section.id=this.buildGuid(),i.kupData.section.sections=[],i.kupData.section.sections.push(t)}const e=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.section.layout,i.kupData.section.sections.length,i.lastElementChild.children);i.kupData.section.sections.splice(e,0,s.kupData.section),s.kupData.parent=i.kupData.section}this.resetData(this.internalData)}getGridStyle(t){let i={};if(t.sections){let s="";t.sections.forEach((t=>{s+=this.enableDesign||!t.dim?" 1fr":t.dim.indexOf("%")<0?" "+t.dim+"px":" "+t.dim})),"column"==t.layout&&(i.gridTemplateRows=s),"row"==t.layout&&(i.gridTemplateColumns=s)}return i}setSectionPlaceHolder(t,i){const s=document.createElement("div");s.className="section-placeholder",t.insertBefore(s,t.childNodes[i])}removeSectionPlaceHolder(){const t=this.rootElement.shadowRoot.querySelector(".section-placeholder");t&&t.parentElement.removeChild(t)}resetData(t=null){t&&(this.internalDataBackup=t),this.resetInternalData=!0,setTimeout((()=>{this.internalDataBackup&&(this.internalData=this.internalDataBackup,this.internalDataBackup=null),this.resetInternalData=!1}),250)}unregisterInteractables(){this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-dropzone"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-draggable"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".form-dropzone")))}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.resetInternalData?(this.internalData=null,this.unregisterInteractables()):this.internalData||(this.internalData=JSON.parse(JSON.stringify(this.data)))}componentDidRender(){this.kupManager.debug.logRender(this,!0);const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");i&&i.forEach((t=>{l(t)}))}this.didRenderInteractables()}render(){return e(o,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:b},this.buildHeader(),this.buildForm(this.internalData,null)))}disconnectedCallback(){this.unregisterInteractables(),this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};y.style=":host{width:100%;height:100%}#kup-component{height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;height:100%}.form-dropzone{padding:1em;grid-gap:0.5em;border:1px solid var(--kup-primary-color);height:auto}.section{display:flex;flex-direction:column;overflow:auto}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color)}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.section-placeholder{background-color:rgba(var(--kup-secondary-color-rgb), 0.5);min-height:1em;min-width:1em}.component{height:fit-content;padding:1em;margin:0.5em}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";export{y as kup_dashboard}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as s,h as e,H as o,g as h}from"./p-
|
|
1
|
+
import{r as t,c as i,f as s,h as e,H as o,g as h}from"./p-fd75d5bf.js";import{k as n,g as r,s as a,c as d}from"./p-e76b646c.js";var c;!function(t){t.buttonData="Props of the button (when isButton is set to true).",t.isButton="The component will be rendered as a button, which opens the link associated to the iframe in another tab when clicked.",t.src="The address the iframe should be referencing to."}(c||(c={}));const p=class{constructor(s){t(this,s),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=n(),this.buttonData={},this.isButton=!1,this.src=void 0}onKupIframeError(){this.kupIframeError.emit({comp:this,id:this.rootElement.id})}onKupIframeLoad(){this.kupIframeLoad.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,c,t)}async refresh(){s(this)}async setProps(t){a(this,c,t)}openInNew(){window.open(this.src,"_blank")}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){if(null!=this.src&&""!==this.src)return this.buttonData.icon||(this.buttonData.icon="open_in_new"),this.buttonData.label||(this.buttonData.label="Open in new tab"),this.isButton?e(o,{"is-button":!0},e("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):e(o,{"is-iframe":!0},e("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",d.WARNING)}get rootElement(){return h(this)}};p.style="iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{p as kup_iframe}
|