@sme.up/ketchup 11.0.0-SNAPSHOT-20250129133724 → 11.0.0-SNAPSHOT-20250129154329
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-cell-6a44d289.js → f-cell-c92ee30f.js} +10 -6
- package/dist/cjs/{f-chip-0cf9aa65.js → f-chip-989e4a7c.js} +1 -1
- package/dist/cjs/{f-object-field-bdc84b8c.js → f-object-field-09e4efbe.js} +2 -2
- package/dist/cjs/{f-paginator-utils-8a6562a8.js → f-paginator-utils-5c5258b6.js} +1 -1
- package/dist/cjs/{f-text-field-0ba5b010.js → f-text-field-0e8abf2d.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js +9 -9
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +5 -5
- package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
- package/dist/cjs/{kup-data-table-helper-45809a34.js → kup-data-table-helper-9bdab206.js} +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-htm.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +5 -5
- package/dist/cjs/kup-input-panel.cjs.entry.js +5 -5
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
- package/dist/cjs/{kup-manager-577da7ec.js → kup-manager-81c69767.js} +7 -6
- 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-object-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-pdf.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 +1 -1
- package/dist/cjs/kup-txt.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography.cjs.entry.js +1 -1
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +2 -2
- package/dist/collection/f-components/f-cell/f-cell.js +6 -2
- package/dist/collection/utils/filters/filters-declarations.js +2 -1
- package/dist/collection/utils/filters/filters.js +5 -5
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/kup-accordion.js +2 -2
- package/dist/components/kup-activity-timeline.js +2 -2
- package/dist/components/kup-autocomplete.js +1 -1
- package/dist/components/kup-badge.js +1 -1
- package/dist/components/kup-box.js +1 -1
- package/dist/components/kup-button-list.js +1 -1
- package/dist/components/kup-button.js +1 -1
- package/dist/components/kup-calendar.js +2 -2
- package/dist/components/kup-card-list.js +3 -3
- package/dist/components/kup-card.js +1 -1
- package/dist/components/kup-cell.js +2 -2
- package/dist/components/kup-chart.js +1 -1
- package/dist/components/kup-checkbox.js +1 -1
- package/dist/components/kup-chip.js +1 -1
- package/dist/components/kup-color-picker.js +1 -1
- package/dist/components/kup-combobox.js +1 -1
- package/dist/components/kup-dashboard.js +2 -2
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-drawer.js +2 -2
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-echart.js +1 -1
- package/dist/components/kup-editor.js +1 -1
- package/dist/components/kup-family-tree.js +3 -3
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-grid.js +1 -1
- package/dist/components/kup-htm.js +2 -2
- package/dist/components/kup-iframe.js +2 -2
- package/dist/components/kup-image-list.js +2 -2
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-input-panel.js +3 -3
- package/dist/components/kup-lazy.js +2 -2
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-nav-bar.js +2 -2
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-object-field.js +2 -2
- package/dist/components/kup-pdf.js +2 -2
- package/dist/components/kup-planner.js +2 -2
- package/dist/components/kup-probe.js +2 -2
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-qlik.js +2 -2
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +2 -2
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-toolbar.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/components/kup-txt.js +2 -2
- package/dist/components/kup-typography-list.js +2 -2
- package/dist/components/kup-typography.js +2 -2
- package/dist/components/{p-27005da8.js → p-0bc76b35.js} +7 -6
- package/dist/components/{p-0cbdfe38.js → p-0e2af9fb.js} +2 -2
- package/dist/components/{p-94e89d81.js → p-1ebe08cf.js} +2 -2
- package/dist/components/{p-9e382ae3.js → p-2443bfd1.js} +2 -2
- package/dist/components/{p-8933ce00.js → p-603e02cc.js} +2 -2
- package/dist/components/{p-94a659ba.js → p-ff0974f2.js} +9 -5
- package/dist/esm/{f-cell-00a8bbea.js → f-cell-471f3823.js} +10 -6
- package/dist/esm/{f-chip-c18c9dbe.js → f-chip-04238fd5.js} +1 -1
- package/dist/esm/{f-object-field-4ffbdea3.js → f-object-field-2659a043.js} +2 -2
- package/dist/esm/{f-paginator-utils-ff6255f2.js → f-paginator-utils-9439ac85.js} +1 -1
- package/dist/esm/{f-text-field-c6f94648.js → f-text-field-1c6d8e63.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kup-accordion.entry.js +1 -1
- package/dist/esm/kup-activity-timeline.entry.js +2 -2
- package/dist/esm/kup-autocomplete_28.entry.js +9 -9
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +2 -2
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +5 -5
- package/dist/esm/kup-dashboard.entry.js +2 -2
- package/dist/esm/{kup-data-table-helper-c6706fc8.js → kup-data-table-helper-093863e9.js} +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +1 -1
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-htm.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +5 -5
- package/dist/esm/kup-input-panel.entry.js +5 -5
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-3a2bce62.js → kup-manager-8ffa68fa.js} +7 -6
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-object-field.entry.js +3 -3
- package/dist/esm/kup-pdf.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 +1 -1
- package/dist/esm/kup-txt.entry.js +1 -1
- package/dist/esm/kup-typography-list.entry.js +1 -1
- package/dist/esm/kup-typography.entry.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-98ecd58a.entry.js → p-05629399.entry.js} +1 -1
- package/dist/ketchup/{p-074dca27.entry.js → p-05e0b624.entry.js} +1 -1
- package/dist/ketchup/{p-4f7f37d8.js → p-10216a69.js} +1 -1
- package/dist/ketchup/{p-bffe2f25.entry.js → p-12720400.entry.js} +1 -1
- package/dist/ketchup/{p-6958c8b9.entry.js → p-1ae7fe64.entry.js} +1 -1
- package/dist/ketchup/{p-b8ba1576.js → p-1c6d91d8.js} +1 -1
- package/dist/ketchup/{p-d987d2ef.entry.js → p-1d3fcf9f.entry.js} +1 -1
- package/dist/ketchup/{p-90379022.entry.js → p-236941a4.entry.js} +1 -1
- package/dist/ketchup/{p-3bdaa6dc.entry.js → p-2cee8c62.entry.js} +1 -1
- package/dist/ketchup/{p-4df33b4b.entry.js → p-3697ec80.entry.js} +1 -1
- package/dist/ketchup/{p-44ddf701.entry.js → p-40530402.entry.js} +1 -1
- package/dist/ketchup/{p-9021cdff.entry.js → p-4057552a.entry.js} +1 -1
- package/dist/ketchup/p-42ad5758.js +1 -0
- package/dist/ketchup/{p-2115a342.entry.js → p-45c25549.entry.js} +1 -1
- package/dist/ketchup/{p-c1be5310.entry.js → p-5a70586a.entry.js} +1 -1
- package/dist/ketchup/{p-dfef9eff.entry.js → p-5b653b11.entry.js} +1 -1
- package/dist/ketchup/{p-cbb1a9a9.entry.js → p-6bc93c78.entry.js} +1 -1
- package/dist/ketchup/{p-d49a913c.entry.js → p-77ce2545.entry.js} +1 -1
- package/dist/ketchup/{p-4308417c.entry.js → p-8468952e.entry.js} +1 -1
- package/dist/ketchup/{p-f1d8429d.entry.js → p-8ca95fbc.entry.js} +1 -1
- package/dist/ketchup/p-8e98c42a.js +1 -0
- package/dist/ketchup/{p-dc0ad9f2.entry.js → p-93bba1d3.entry.js} +1 -1
- package/dist/ketchup/{p-92d8400c.entry.js → p-9fe8bf02.entry.js} +1 -1
- package/dist/ketchup/{p-7a206956.entry.js → p-a1ed41d2.entry.js} +1 -1
- package/dist/ketchup/{p-26204ba1.entry.js → p-b0406293.entry.js} +1 -1
- package/dist/ketchup/{p-a69a94e6.entry.js → p-b4d78c50.entry.js} +1 -1
- package/dist/ketchup/{p-81031736.entry.js → p-bcf38793.entry.js} +1 -1
- package/dist/ketchup/{p-1e14e55b.entry.js → p-bf2a65de.entry.js} +1 -1
- package/dist/ketchup/{p-b3d22966.js → p-bf9f371e.js} +1 -1
- package/dist/ketchup/{p-736d7763.entry.js → p-c756d98d.entry.js} +1 -1
- package/dist/ketchup/{p-84cb2ab9.entry.js → p-c794396d.entry.js} +1 -1
- package/dist/ketchup/{p-6fcea055.entry.js → p-c7f4c6ae.entry.js} +1 -1
- package/dist/ketchup/{p-3f10ba95.entry.js → p-c982e15b.entry.js} +1 -1
- package/dist/ketchup/{p-8a6aa580.entry.js → p-d63ed956.entry.js} +1 -1
- package/dist/ketchup/{p-2b86ed1b.js → p-d8c03fb0.js} +1 -1
- package/dist/ketchup/{p-53a2c80a.entry.js → p-ec044e93.entry.js} +1 -1
- package/dist/ketchup/{p-ef906d70.js → p-f7245913.js} +1 -1
- package/dist/types/utils/filters/filters-declarations.d.ts +2 -1
- package/package.json +1 -1
- package/dist/ketchup/p-ac893be0.js +0 -1
- package/dist/ketchup/p-c02e91a6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,D as t,B as n,ac as l,v as o,x as r,ad as i,ae as s,M as u,N as a,F as c,af as f,ag as d,ah as h,ai as b,aj as m,a3 as p}from"./p-b8ba1576.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(t={},n,l){if(null==t||null==l)return;let o=t[n];if(null==o)return;null==o.checkBoxes&&(o.checkBoxes=[]);let r=e.indexOfValueInValuesArray(o.checkBoxes,l);if(r>=0){let e=[];for(let t=0;t<o.checkBoxes.length;t++)t!=r&&(e[e.length]=o.checkBoxes[t]);o.checkBoxes=[...e]}}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let u="";return r.forEach((e=>{u+=i+n(e,l),i=" OR "})),""!=u&&(u="("+u+")",""!=s&&(u=" AND "+u)),u=s+u,u}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[]}}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t)}isFilterCompliantForCellObj(e,t){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t)}isRowCompliant(e,t={},n="",l=!1,o=[],r){return this.areCellsCompliant(e.cells,t,n,l,o,r)}areCellsCompliant(e,t={},n="",o=!1,r=[],i){if(o){let t=!0;if(r&&null!=r&&r.length>0){t=!1;let o=this.filterIsNegative(n);for(let i=0;i<r.length;i++){if(0==r[i].visible)continue;const s=e[r[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,n);let u=l(r[i],s);if(u!=s.value&&(t=t||this.isFilterCompliantForValue(u,n)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}if(null==i&&(i=new w),!this.hasFilters(t,r,i))return!0;let s=Object.keys(t);for(let n=0;n<s.length;n++){let l=s[n];const o=e[l];if(!o)return!1;let r=i.getTextFilterValue(t,l);const u=this.filterIsNegative(r);let a=this.isFilterCompliantForCell(o,r),c=u;if(k.isNumber(o.obj)||k.isDate(o.obj)||k.isTime(o.obj)||k.isTimestamp(o.obj)||(c=this.isFilterCompliantForCellObj(o,r)),u){if(!a||!c)return!1}else if(!a&&!c)return!1;let f=i.getCheckBoxFilterValues(t,l);if(0==f.length)continue;let d=!1;for(let e=0;e<f.length;e++){let t=f[e];if(null!=t&&null!=t.value){if(null!=o.value&&o.value.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}if(null!=o.obj&&o.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}}}if(!d)return!1}return!0}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o){if(!e||null==e)return[];let r=[];const i=!(!n||!l);if(this.hasFilters(t,l,o)||i)for(let s=0;s<e.length;s++){let u=e[s];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,i,l,o))&&(r[r.length]=u)}else r=[...e];return r}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),u=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(u,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let a=Object.assign({},n.filters);a[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),a,o,n.getVisibleColumns(),r);for(let e=0;e<u.length;e++)i.push(u[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=N(e,l,t[n]);if(0!==o)return o}return 0}return N(e,l,t[0])}))}function N(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r){return null==r&&(r=new y),r.filterRows(e,t,n,l,o)}function V(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const d=o(e,n),h=l(d,f),b=f.value;let m=null;for(let e of a)if(e.group.label===h){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:h,children:[],obj:f.obj,totals:{}},cells:{}},a.push(m));for(let n=1;n<s.length;n++){const r=s[n],u=t.cells[r.column];if(u){const t=o(e,r.column),n=l(t,u),s=u.value;let a=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){a=t;break}}a||(a={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:u.obj}},L(a),m.group.children.push(a)),m=a}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case u.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case u.DISTINCT:let a;if(a=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(a):(l[e.group.id][o]=[],l[e.group.id][o].push(a))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(a);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(a):(l[c.group.id][o]=[],l[c.group.id][o].push(a))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case u.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;case u.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(u.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>u.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,o,n)))}(a,r,c),B(a,u.AVERAGE,r),B(a,u.MATH,r),a}function B(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==u.AVERAGE&&(o=l.filter((e=>u.AVERAGE===n[e]))),t==u.MATH&&(o=l.filter((e=>0==n[e].indexOf(u.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,t,o,n)))}function W(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{W(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function D(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=D(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==u.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==u.MATH){let t=l[n].substring(u.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function E(e,t,n){if(T.ketchup.objects.isEmptyJsObject(t)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=Object.entries(e).reduce(((e,[n,r])=>r===u.COUNT?(l[n]=t.length.toString(),e):0===r.indexOf(u.MATH)?(o.push([n,r]),e):(e.push([n,r]),e)),[]);if(!r&&!o)return l;const i=null==r?void 0:r.map((([e,l])=>{var o,r,i;let s="generic";const u=null!==(r=null===(o=null==n?void 0:n.find((t=>t.name===e)))||void 0===o?void 0:o.obj)&&void 0!==r?r:null===(i=t[0].cells[e])||void 0===i?void 0:i.obj;return T.ketchup.objects.isNumber(u)&&(s="number"),T.ketchup.objects.isDate(u)&&(s="date"),{columnName:e,objType:s,totalOperation:l,values:t.map((t=>t.cells[e].value))}}));return null==i||i.forEach((({columnName:e,objType:n,totalOperation:o,values:r})=>{if("number"===n){if(o===u.SUM)return void(l[e]=r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(o===u.AVERAGE)return void(l[e]=(r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/t.length).toString());if(o===u.MIN)return void(l[e]=Math.min(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(o===u.MAX)return void(l[e]=Math.max(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if("date"===n){const t=r.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!t)return;if(o===u.MIN)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE));if(o===u.MAX)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE))}o===u.DISTINCT&&(l[e]=new Set(r).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(a(u.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],u=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){u.group.children=[];let e=_(s.group.children,u.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=u)}else o>=n&&(t[t.length]=u,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function I(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function $(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:I(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function q(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function z(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const i={[c.AUTOCOMPLETE]:()=>f(o,"",r),[c.COMBOBOX]:()=>f(o,"",r),[c.RADIO]:()=>d(o,r),[c.CHECKBOX]:()=>h(o,""),[c.CHIP]:()=>b(o),[c.SWITCH]:()=>m(o,"")}[l.shape];i&&(l.data=Object.assign(Object.assign({},i()),l.data))}))}))}export{w as F,g as K,y as a,V as b,E as c,z as d,F as e,M as f,q as g,A as n,S as p,C as s,x as t}
|
|
1
|
+
import{C as e,D as t,B as n,ac as l,v as o,x as r,ad as i,ae as s,M as u,N as a,F as c,af as f,ag as d,ah as h,ai as b,aj as m,a3 as p}from"./p-1c6d91d8.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(t={},n,l){if(null==t||null==l)return;let o=t[n];if(null==o)return;null==o.checkBoxes&&(o.checkBoxes=[]);let r=e.indexOfValueInValuesArray(o.checkBoxes,l);if(r>=0){let e=[];for(let t=0;t<o.checkBoxes.length;t++)t!=r&&(e[e.length]=o.checkBoxes[t]);o.checkBoxes=[...e]}}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let u="";return r.forEach((e=>{u+=i+n(e,l),i=" OR "})),""!=u&&(u="("+u+")",""!=s&&(u=" AND "+u)),u=s+u,u}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[]}}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t)}isFilterCompliantForCellObj(e,t){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t)}isRowCompliant(e,t={},n="",l=!1,o=[],r){return this.areCellsCompliant(e.cells,t,n,l,o,r)}areCellsCompliant(e,t={},n="",o=!1,r=[],i){if(o){let t=!0;if(r&&null!=r&&r.length>0){t=!1;let o=this.filterIsNegative(n);for(let i=0;i<r.length;i++){if(0==r[i].visible)continue;const s=e[r[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,n);let u=l(r[i],s);if(u!=s.value&&(t=t||this.isFilterCompliantForValue(u,n)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}if(null==i&&(i=new w),!this.hasFilters(t,r,i))return!0;let s=Object.keys(t);for(let n=0;n<s.length;n++){let l=s[n];const o=e[l];if(!o)return!1;let r=i.getTextFilterValue(t,l);const u=this.filterIsNegative(r);let a=this.isFilterCompliantForCell(o,r),c=u;if(k.isNumber(o.obj)||k.isDate(o.obj)||k.isTime(o.obj)||k.isTimestamp(o.obj)||(c=this.isFilterCompliantForCellObj(o,r)),u){if(!a||!c)return!1}else if(!a&&!c)return!1;let f=i.getCheckBoxFilterValues(t,l);if(0==f.length)continue;let d=!1;for(let e=0;e<f.length;e++){let t=f[e];if(null!=t&&null!=t.value){if(null!=o.value&&o.value.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}if(null!=o.obj&&o.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}}}if(!d)return!1}return!0}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o){if(!e||null==e)return[];let r=[];const i=!(!n||!l);if(this.hasFilters(t,l,o)||i)for(let s=0;s<e.length;s++){let u=e[s];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,i,l,o))&&(r[r.length]=u)}else r=[...e];return r}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),u=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(u,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let a=Object.assign({},n.filters);a[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),a,o,n.getVisibleColumns(),r);for(let e=0;e<u.length;e++)i.push(u[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=N(e,l,t[n]);if(0!==o)return o}return 0}return N(e,l,t[0])}))}function N(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r){return null==r&&(r=new y),r.filterRows(e,t,n,l,o)}function V(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const d=o(e,n),h=l(d,f),b=f.value;let m=null;for(let e of a)if(e.group.label===h){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:h,children:[],obj:f.obj,totals:{}},cells:{}},a.push(m));for(let n=1;n<s.length;n++){const r=s[n],u=t.cells[r.column];if(u){const t=o(e,r.column),n=l(t,u),s=u.value;let a=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){a=t;break}}a||(a={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:u.obj}},L(a),m.group.children.push(a)),m=a}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case u.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case u.DISTINCT:let a;if(a=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(a):(l[e.group.id][o]=[],l[e.group.id][o].push(a))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(a);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(a):(l[c.group.id][o]=[],l[c.group.id][o].push(a))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case u.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;case u.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(u.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>u.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,o,n)))}(a,r,c),B(a,u.AVERAGE,r),B(a,u.MATH,r),a}function B(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==u.AVERAGE&&(o=l.filter((e=>u.AVERAGE===n[e]))),t==u.MATH&&(o=l.filter((e=>0==n[e].indexOf(u.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,t,o,n)))}function W(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{W(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function D(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=D(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==u.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==u.MATH){let t=l[n].substring(u.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function E(e,t,n){if(T.ketchup.objects.isEmptyJsObject(t)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=Object.entries(e).reduce(((e,[n,r])=>r===u.COUNT?(l[n]=t.length.toString(),e):0===r.indexOf(u.MATH)?(o.push([n,r]),e):(e.push([n,r]),e)),[]);if(!r&&!o)return l;const i=null==r?void 0:r.map((([e,l])=>{var o,r,i;let s="generic";const u=null!==(r=null===(o=null==n?void 0:n.find((t=>t.name===e)))||void 0===o?void 0:o.obj)&&void 0!==r?r:null===(i=t[0].cells[e])||void 0===i?void 0:i.obj;return T.ketchup.objects.isNumber(u)&&(s="number"),T.ketchup.objects.isDate(u)&&(s="date"),{columnName:e,objType:s,totalOperation:l,values:t.map((t=>t.cells[e].value))}}));return null==i||i.forEach((({columnName:e,objType:n,totalOperation:o,values:r})=>{if("number"===n){if(o===u.SUM)return void(l[e]=r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(o===u.AVERAGE)return void(l[e]=(r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/t.length).toString());if(o===u.MIN)return void(l[e]=Math.min(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(o===u.MAX)return void(l[e]=Math.max(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if("date"===n){const t=r.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!t)return;if(o===u.MIN)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE));if(o===u.MAX)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE))}o===u.DISTINCT&&(l[e]=new Set(r).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(a(u.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],u=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){u.group.children=[];let e=_(s.group.children,u.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=u)}else o>=n&&(t[t.length]=u,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function I(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function $(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:I(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function q(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function z(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const i={[c.AUTOCOMPLETE]:()=>f(o,"",r),[c.COMBOBOX]:()=>f(o,"",r),[c.RADIO]:()=>d(o,r),[c.CHECKBOX]:()=>h(o,""),[c.CHIP]:()=>b(o),[c.SWITCH]:()=>m(o,"")}[l.shape];i&&(l.data=Object.assign(Object.assign({},i()),l.data))}))}))}export{w as F,g as K,y as a,V as b,E as c,z as d,F as e,M as f,q as g,A as n,S as p,C as s,x as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as e,h as n,H as o,d as a}from"./p-b0368f88.js";import{k as p,g as s,s as h,e as f}from"./p-
|
|
1
|
+
import{r as t,c as i,f as e,h as n,H as o,d as a}from"./p-b0368f88.js";import{k as p,g as s,s as h,e as f}from"./p-1c6d91d8.js";import"./p-1ee561ba.js";var r;!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."}(r||(r={}));const l=class{constructor(e){t(this,e),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=p(),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 s(this,r,t)}async refresh(){e(this)}async setProps(t){h(this,r,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?n(o,{"is-button":!0},n("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):n(o,{"is-iframe":!0},n("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",f.WARNING)}get rootElement(){return a(this)}};l.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{l as kup_iframe}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,g as l}from"./p-b0368f88.js";import{b as t}from"./p-
|
|
1
|
+
import{h as e,g as l}from"./p-b0368f88.js";import{b as t}from"./p-1c6d91d8.js";import{F as i}from"./p-b120abd7.js";const n=document.documentElement,d=(l,t)=>e("div",Object.assign({class:{"f-text-field":!0,"kup-danger":l.danger,"kup-full-height":l.fullHeight,"kup-full-width":l.fullWidth,"kup-info":l.info,"kup-light-mode":l.lightMode,"kup-secondary":l.secondary,"kup-shaped":l.shaped,"kup-success":l.success,"kup-warning":l.warning,[l.wrapperClass]:!!l.wrapperClass}},l.dataSet,{id:l.id,title:l.title}),l.leadingLabel||l.trailingLabel?e("div",{class:"mdc-form-field "+(l.leadingLabel?"mdc-form-field--align-end":"")},[o(l),a(l),e("label",null,l.label)]):[o(l),a(l)],t);function o(d){var o,a,s,r,u,m,f;const p=d.textArea||d.outlined;let v,x,g,k;if(d.maxLength>=256&&(d.textArea=!0),!d.label||d.leadingLabel||d.trailingLabel||(v=e("div",{class:"mdc-text-field__label-container"},e("label",{class:"mdc-label",htmlFor:"kup-input"},d.label),d.maxLength&&d.showCounter?e("div",{class:"mdc-text-field__label-character-counter"},d.value.length," / ",d.maxLength):void 0)),d.icon){let i,n="";if(Object.values(t).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${l(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}x=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}if(d.quantityButtons){const t=`url('${l("./assets/svg/minus.svg")}') no-repeat center`,i=`url('${l("./assets/svg/plus.svg")}') no-repeat center`,n={mask:i,webkitMask:i};g=e("span",{style:{mask:t,webkitMask:t},class:"mdc-text-field__icon kup-icon action"}),k=e("span",{style:n,class:"mdc-text-field__icon kup-icon action"})}const b={color:d.error?"var(--kup-danger-color-60)":"var(--kup-warning-color-50)",resource:d.error?"error":"warning",sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"kup-icon"},h={"mdc-text-field-container":!0,"mdc-text-field-container--disabled":d.disabled},w={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--read-only":d.readOnly,"mdc-text-field--read-only-is-select":d.isSelect,"mdc-text-field--filled":!d.fullWidth&&!p,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--lightmode":d.lightMode,"mdc-text-field--outlined":p,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon,"mdc-text-field--with-quantity-buttons":d.quantityButtons,"mdc-text-field--error":Boolean(d.error),"mdc-text-field--alert":Boolean(d.alert),"mdc-text-field--legacy-look mdc-text-field--extra-small":d.legacyLook,[`mdc-text-field--${d.sizing||"small"}`]:!d.textArea&&!d.legacyLook,[`mdc-text-field--textarea--${d.sizing||"small"}`]:d.textArea,"top-right-indicator":d.showMarker};let _=d.value,y=d.quantityButtons?"number":null!==(o=d.inputType)&&void 0!==o?o:"text",C=!1;if("number"===d.inputType&&(y="text",d.inputMode="numeric",C=!0),"number"===d.inputType){const e={allowNegative:null===(a=d.allowNegative)||void 0===a||a,decimal:d.decimals,group:null===(s=d.group)||void 0===s||s,integer:(null!==(r=d.integers)&&void 0!==r?r:0)-(null!==(u=d.decimals)&&void 0!==u?u:0)};_=c(_,e,!1)}if(d.textArea)try{_=JSON.parse(`"${_}"`)}catch(e){_=JSON.parse(JSON.stringify(_))}return e("div",{class:h},d.fullWidth?void 0:v,e("div",{class:w},d.trailingIcon?void 0:x,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,maxlength:d.maxLength,value:_,autoComplete:null!==(m=d.autocomplete)&&void 0!==m?m:"off",onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{type:y,inputmode:d.inputMode?d.inputMode:void 0,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,placeholder:d.placeholder,maxlength:d.maxLength,size:d.size,value:_,readOnly:d.isSelect,autoComplete:null!==(f=d.autocomplete)&&void 0!==f?f:"off",onBlur:e=>{var l,t,i,n;if(C){const o={allowNegative:null===(l=d.allowNegative)||void 0===l||l,decimal:d.decimals,group:null===(t=d.group)||void 0===t||t,integer:(null!==(i=d.integers)&&void 0!==i?i:0)-(null!==(n=d.decimals)&&void 0!==n?n:0)};e.target.value=c(e.target.value,o,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var l,t,i,n;if(C){const o={allowNegative:null===(l=d.allowNegative)||void 0===l||l,decimal:d.decimals,group:null===(t=d.group)||void 0===t||t,integer:(null!==(i=d.integers)&&void 0!==i?i:0)-(null!==(n=d.decimals)&&void 0!==n?n:0)};e.target.value=null!=d.min&&d.min>parseFloat(e.target.value)?c(d.min.toString(),o,!0):null!=d.max&&d.max<parseFloat(e.target.value)?c(d.max.toString(),o,!0):c(e.target.value,o,!0)}else null!=d.min&&d.min>parseFloat(e.target.value)?e.target.value=d.min.toString():null!=d.max&&d.max<parseFloat(e.target.value)&&(e.target.value=d.max.toString());d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var l,t,i,o,a;if(!C)return;if(e.ctrlKey)return;if(e.key.length>1)return;if(("."===e.key||","===e.key)&&"NumpadDecimal"===e.code){const t=e.target,i=null!==(l=t.selectionStart)&&void 0!==l?l:0,d=n.ketchup.math.decimalSeparator();return t.value.includes(d)||(t.value=t.value.slice(0,i)+d+t.value.slice(i),t.setSelectionRange(i+1,i+1)),void e.preventDefault()}const c={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:null===(i=d.group)||void 0===i||i,integer:(null!==(o=d.integers)&&void 0!==o?o:0)-(null!==(a=d.decimals)&&void 0!==a?a:0)};let s=e.target,r=s.value,u=r.substring(0,s.selectionStart),m=r.substring(s.selectionEnd,s.selectionEnd+r.length-1);n.ketchup.math.matchNumericValueWithOptions(u+e.key+m,c)||e.preventDefault()}}),d.trailingIcon?x:void 0,d.helperIcon&&d.error?e("div",{class:"mdc-error-icon"},e(i,Object.assign({},b))):d.helperIcon&&d.alert?e("div",{class:"mdc-alert-icon"},e(i,Object.assign({},b))):void 0,d.quantityButtons&&e("div",{class:"mdc-quantity-buttons"},e("button",{onClick:d.onMinusClick},g),e("button",{onClick:d.onPlusClick},k)),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${t.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0))}function a(l){if(!1!==l.helperEnabled&&(l.error||l.alert)&&!l.legacyLook)return e("div",{class:"mdc-text-field-helper-line"},l.helper?e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!l.helperWhenFocused}},l.helper):l.error?e("span",{class:"mdc-error-message"},l.error):l.alert?e("span",{class:"mdc-alert-message"},l.alert):void 0)}const c=function(e,l,t){let i=e;return i?"-"==i?"":n.ketchup.math.format(i,n.ketchup.math.createFormatPattern(l.group,l.decimal),t):i};export{d as F}
|
|
@@ -21,8 +21,9 @@ export interface Filter {
|
|
|
21
21
|
* @property {string} 2 - Either % or null: indicates the string must start with the given string.
|
|
22
22
|
* @property {string} 3 - Either "" or a string with a length.
|
|
23
23
|
* @property {string} 4 - Either % or null: indicates the string must finish with the given string.
|
|
24
|
+
* This regex ignores spaces at the beginning, at the end, and between the operator and the quoted value.
|
|
24
25
|
*/
|
|
25
|
-
export declare const
|
|
26
|
+
export declare const FILTER_ANALYZER: RegExp;
|
|
26
27
|
export declare enum KupGlobalFilterMode {
|
|
27
28
|
SIMPLE = "simple",
|
|
28
29
|
HIGHLIGHT = "highlight"
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as i}from"./p-b0368f88.js";import{F as c}from"./p-b120abd7.js";import{b as e,h as s}from"./p-b8ba1576.js";var n,p,l;!function(i){i.CHOICE="choice",i.FILTER="filter",i.INPUT="input",i.STANDARD="standard"}(n||(n={})),function(i){i.OUTLINED="outlined",i.RAISED="raised"}(p||(p={})),function(i){i.SMALL="small",i.MEDIUM="medium"}(l||(l={}));const r=document.documentElement,a=l=>{l.styling||(l.styling=p.RAISED),l.type||(l.type=n.STANDARD);const a=l.type.toLowerCase()===n.CHOICE,o=l.type.toLowerCase()===n.FILTER,t=l.type.toLowerCase()===n.INPUT,d=l.styling.toLowerCase()===p.OUTLINED,u={"chip-set":!0,"chip-set--choice":!!a,"chip-set--filter":!!o,"chip-set--input":!!t,"chip--outlined":!!d,"chip--raised":!d,[`chip--${l.sizing}`]:!!l.sizing};return i("div",Object.assign({class:`f-chip ${l.danger?"kup-danger":""} ${l.info?"kup-info":""} ${l.secondary?"kup-secondary":""} ${l.success?"kup-success":""} ${l.warning?"kup-warning":""} ${l.wrapperClass?l.wrapperClass:""} ${l.primary?"kup-primary":""}`},l.dataSet,{id:l.id,title:l.title}),i("div",{class:u,role:"grid"},function(n,p,l,a){const o=[];for(let t=0;n.data&&t<n.data.length;t++){const d=[];function u(p,l){const a=!!(p.children&&p.children.length>0),o=!(!a||!p.isExpanded),_={"--kup_chip_indent_offset":l.toString()};if(d.push(i("div",{class:"chip-set__wrapper "+(a&&!o?"chip-set__wrapper--hidden-children":"")},i("div",{class:"chip-set__indent",style:_}),a?i(c,{onClick:n.onExpansionClick&&n.onExpansionClick[t]?n.onExpansionClick[t].bind(n.onExpansionClick[t],p):null,resource:`${e.DROPDOWN}`,sizeX:"16px",sizeY:"16px",title:r.ketchup.language.translate(s.EXPAND)+"/"+r.ketchup.language.translate(s.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):l?i(c,{resource:"blank",sizeX:"16px",sizeY:"16px",wrapperClass:"dropdown-icon"}):null,h(p))),o)for(let i=0;i<p.children.length;i++)p.children[i]&&u(p.children[i],l+1)}function h(s){let r="chip "+(s.icon&&!s.value?"chip--only-icon":""),o=[],d="chip__icon chip__icon--leading";return(l||p)&&s.checked&&(r+=" chip--selected",l&&(d+=" chip__icon--leading-hidden")),s.icon&&o.push(i(c,Object.assign({},{color:p&&s.checked?"var(--kup_chip_primary_color)":"var(--kup_chip_text_color)",resource:s.icon,placeholderResource:s.placeholderIcon,sizeX:"16px",sizeY:"16px",wrapperClass:d}))),l&&o.push(i("span",{class:"chip__checkmark"},i("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},i("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})))),i("div",{class:r,"data-value":s.id,onClick:n.onClick&&n.onClick[t]?n.onClick[t].bind(n.onClick[t],s):null,role:"row",title:s.title?s.title:""},i("span",{class:"chip-set__indent"}),o,i("span",{role:"gridcell"},i("span",{role:"button",tabindex:t,class:"chip__primary-action",value:s.id,checked:s.checked,onBlur:n.onBlur&&n.onBlur[t]?n.onBlur[t].bind(n.onBlur[t],s):null,onFocus:n.onFocus&&n.onFocus[t]?n.onFocus[t].bind(n.onFocus[t],s):null},i("span",{class:"chip__text"},n.displayId?s.id+" - "+s.value:s.value))),a?i("span",{role:"gridcell"},i("span",{tabindex:"-1",class:`kup-icon chip__icon ${e.CLEAR.replace("--","")}`,onClick:n.onIconClick&&n.onIconClick[t]?n.onIconClick[t].bind(n.onIconClick[t],s):null})):null)}u(n.data[t],0),o.push(i("div",{class:"chip-set__item"},...d))}return o}(l,a,o,t)))};export{n as F,l as a,p as b,a as c}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as o}from"./p-b0368f88.js";import{a as t,k as n,c as e}from"./p-b8ba1576.js";import{F as c}from"./p-d39c3267.js";import{a as i}from"./p-e3062c19.js";import{F as l}from"./p-ef906d70.js";const s=new WeakMap,r=n=>{var e;return o("div",{class:`f-object-field ${n.wrapperClass?n.wrapperClass:""}`,ref:async o=>{o&&(n.root=o,b(n))}},o(l,Object.assign({icon:"search",trailingIcon:!0,disabled:!1},null===(e=n.cell)||void 0===e?void 0:e.data,{value:n.inputValue,onChange:n.onChange,onIconClick:d.icon.bind(n),onInput:d.input.bind(n),onKeyDown:d.keydown.bind(n)})),o(c,{icon:"menu",onClick:d.button.bind(n),sizing:t.SMALL,styling:i.FLAT,wrapperClass:"obj-field-extra-btn"}),o("kup-toolbar",{"onKup-toolbar-click":d.toolbar.bind(n)}))};function a(o){const{cell:t}=o,e=s.get(t),{clickCb:c}=e,{toolbar:i}=u(e),l=n();l.dynamicPosition.stop(i),l.removeClickCallback(c),i.style.display="none",e.isListOpened=!1}const u=o=>{const{children:t,clickCb:n,root:e}=o;return Object.keys(o.children).length||(t.button=e.querySelector(".f-button"),t.textfield=e.querySelector(".f-text-field"),t.toolbar=e.querySelector("kup-toolbar"),n.el=t.toolbar),t},b=o=>{const{cell:t,root:n}=o,e=s.get(t);s.set(t,e?Object.assign(Object.assign({},e),{root:n,children:u(e)}):{children:{},clickCb:{cb:a.bind(a,o)},inputValue:o.inputValue,isListOpened:!1,root:n})},p=(o,t,n)=>{const{cell:e,column:c,row:i,root:l}=o,{children:r,inputValue:a}=s.get(e),u=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:!0,detail:{cell:e,children:r,column:c,inputValue:a,originalEvent:n,row:i}});l.dispatchEvent(u)},d={button:function(o){(function(o){const{cell:t}=o,c=s.get(t),{isListOpened:i}=c;i?a(o):function(o){const{cell:t}=o,c=s.get(t),{isListOpened:i,clickCb:l}=c,{button:r,toolbar:a}=u(c);if(i)return;const b=n();b.dynamicPosition.isRegistered(a)?b.dynamicPosition.changeAnchor(a,r):b.dynamicPosition.register(a,r,0,e.AUTO,!1),b.dynamicPosition.start(a),b.addClickCallback(l,!0),a.style.display="block",c.isListOpened=!0}(o)})(this),p(this,"kup-objectfield-opensearchmenu",o)},icon:function(o){p(this,"kup-objectfield-searchpayload",o)},input:function(o){const{cell:t}=this;s.get(t).inputValue=o.target.value},keydown:function(o){"F4"===o.code&&(o.preventDefault(),o.stopPropagation(),p(this,"kup-objectfield-searchpayload",o))},toolbar:function(o){a(this),p(this,"kup-objectfield-selectedmenuitem",o)}};export{r as F}
|