@sme.up/ketchup 11.0.0-SNAPSHOT-20241017090851 → 11.0.0-SNAPSHOT-20241017151034

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.
Files changed (63) hide show
  1. package/dist/cjs/ketchup.cjs.js +1 -1
  2. package/dist/cjs/kup-activity-timeline.cjs.entry.js +1 -1
  3. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +6 -6
  4. package/dist/cjs/kup-autocomplete_27.cjs.entry.js.map +1 -1
  5. package/dist/cjs/kup-box.cjs.entry.js +1 -1
  6. package/dist/cjs/kup-calendar.cjs.entry.js +26 -25
  7. package/dist/cjs/kup-calendar.cjs.entry.js.map +1 -1
  8. package/dist/cjs/kup-cell.cjs.entry.js +43 -3
  9. package/dist/cjs/kup-cell.cjs.entry.js.map +1 -1
  10. package/dist/cjs/{kup-data-table-helper-cf31cb4e.js → kup-data-table-helper-52444d44.js} +2 -2
  11. package/dist/cjs/{kup-data-table-helper-cf31cb4e.js.map → kup-data-table-helper-52444d44.js.map} +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/assets/calendar.js +30 -29
  14. package/dist/collection/components/kup-calendar/kup-calendar-declarations.js.map +1 -1
  15. package/dist/collection/components/kup-calendar/kup-calendar.js +51 -25
  16. package/dist/collection/components/kup-calendar/kup-calendar.js.map +1 -1
  17. package/dist/collection/components/kup-tree/kup-tree-declarations.js +1 -1
  18. package/dist/collection/components/kup-tree/kup-tree-declarations.js.map +1 -1
  19. package/dist/collection/components/kup-tree/kup-tree.js +5 -5
  20. package/dist/collection/components/kup-tree/kup-tree.js.map +1 -1
  21. package/dist/collection/f-components/f-cell-options.tsx/f-cell-options.js +42 -4
  22. package/dist/collection/f-components/f-cell-options.tsx/f-cell-options.js.map +1 -1
  23. package/dist/components/kup-autocomplete2.js +6 -6
  24. package/dist/components/kup-autocomplete2.js.map +1 -1
  25. package/dist/components/kup-calendar.js +27 -25
  26. package/dist/components/kup-calendar.js.map +1 -1
  27. package/dist/components/kup-cell.js +44 -4
  28. package/dist/components/kup-cell.js.map +1 -1
  29. package/dist/esm/ketchup.js +1 -1
  30. package/dist/esm/kup-activity-timeline.entry.js +1 -1
  31. package/dist/esm/kup-autocomplete_27.entry.js +6 -6
  32. package/dist/esm/kup-autocomplete_27.entry.js.map +1 -1
  33. package/dist/esm/kup-box.entry.js +1 -1
  34. package/dist/esm/kup-calendar.entry.js +26 -25
  35. package/dist/esm/kup-calendar.entry.js.map +1 -1
  36. package/dist/esm/kup-cell.entry.js +44 -4
  37. package/dist/esm/kup-cell.entry.js.map +1 -1
  38. package/dist/esm/{kup-data-table-helper-6b828446.js → kup-data-table-helper-74b29c0e.js} +2 -2
  39. package/dist/esm/{kup-data-table-helper-6b828446.js.map → kup-data-table-helper-74b29c0e.js.map} +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/ketchup/ketchup.esm.js +1 -1
  42. package/dist/ketchup/ketchup.esm.js.map +1 -1
  43. package/dist/ketchup/{p-556618b0.entry.js → p-1b4dda8d.entry.js} +2 -2
  44. package/dist/ketchup/{p-f57c4edf.entry.js → p-40b3c165.entry.js} +3 -3
  45. package/dist/ketchup/{p-f57c4edf.entry.js.map → p-40b3c165.entry.js.map} +1 -1
  46. package/dist/ketchup/{p-35802f68.entry.js → p-6f138b8c.entry.js} +2 -2
  47. package/dist/ketchup/{p-c8ec502a.entry.js → p-aadfd358.entry.js} +2 -2
  48. package/dist/ketchup/p-aadfd358.entry.js.map +1 -0
  49. package/dist/ketchup/{p-454b6065.js → p-e9aaa7d5.js} +2 -2
  50. package/dist/ketchup/p-e9aaa7d5.js.map +1 -0
  51. package/dist/ketchup/p-f0f42ad4.entry.js +2 -0
  52. package/dist/ketchup/p-f0f42ad4.entry.js.map +1 -0
  53. package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +5 -5
  54. package/dist/types/components/kup-calendar/kup-calendar.d.ts +6 -1
  55. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +3 -3
  56. package/dist/types/components.d.ts +12 -2
  57. package/package.json +1 -1
  58. package/dist/ketchup/p-454b6065.js.map +0 -1
  59. package/dist/ketchup/p-c8ec502a.entry.js.map +0 -1
  60. package/dist/ketchup/p-deea2b0f.entry.js +0 -2
  61. package/dist/ketchup/p-deea2b0f.entry.js.map +0 -1
  62. /package/dist/ketchup/{p-556618b0.entry.js.map → p-1b4dda8d.entry.js.map} +0 -0
  63. /package/dist/ketchup/{p-35802f68.entry.js.map → p-6f138b8c.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { h, r as registerInstance, f as forceUpdate, H as Host, d as getElement } from './index-191ee7cb.js';
2
- import { a5 as FCellTypes, ai as CMBandACPAdapter, aj as RADAdapter, k as kupManagerInstance, f as FCellPadding, g as getProps, s as setProps$1, R as KupDragEffect, h as KupLanguageGeneric } from './kup-manager-84ac466d.js';
2
+ import { a5 as FCellTypes, F as FCellShapes, ai as CMBandACPAdapter, aj as RADAdapter, k as kupManagerInstance, f as FCellPadding, g as getProps, s as setProps$1, R as KupDragEffect, h as KupLanguageGeneric } from './kup-manager-84ac466d.js';
3
3
  import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
4
4
  import { F as FCell } from './f-cell-355ccc61.js';
5
5
  import './kup-dates-b90227c6.js';
@@ -94,9 +94,47 @@ const optionsAdapterMap = new Map([
94
94
  const FCellOptions = (props) => {
95
95
  const mappedCell = props.cell
96
96
  ? Object.assign(Object.assign({}, props.cell), { data: setProps(props.cell, props.column), slotData: slotData(props.cell, props.column), isEditable: true }) : null;
97
- const mappedProps = Object.assign(Object.assign({}, props), { editable: true, cell: mappedCell });
97
+ const mappedProps = Object.assign(Object.assign({}, props), { editable: true, cell: mappedCell, column: generateColumn(mappedCell.data), row: generateRow(mappedCell.data) });
98
+ if (props.cell.shape === FCellShapes.TEXT_FIELD) {
99
+ mappedProps.cell.value = mappedProps.cell.data.value;
100
+ }
101
+ const label = getLabelComponent(mappedProps.cell, mappedProps.column.title);
102
+ if (label) {
103
+ return (h("div", { class: { 'input-panel__label_container': true } },
104
+ label,
105
+ h(FCell, Object.assign({}, mappedProps))));
106
+ }
107
+ console.log('props', mappedProps);
98
108
  return h(FCell, Object.assign({}, mappedProps));
99
109
  };
110
+ const getLabelComponent = (cell, label) => {
111
+ if (!label) {
112
+ return null;
113
+ }
114
+ const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);
115
+ if (cellType === FCellTypes.RADIO) {
116
+ return h("span", null, label);
117
+ }
118
+ return null;
119
+ };
120
+ const generateColumn = (data) => {
121
+ const colname = data && data.obj && data.obj.t
122
+ ? data.obj.t + ';' + data.obj.p
123
+ : 'KUPCELL';
124
+ const coltitle = data && data.obj && data.obj.t
125
+ ? data.obj.t + ';' + data.obj.p
126
+ : 'genericEmptyObject';
127
+ return {
128
+ name: colname,
129
+ title: coltitle,
130
+ };
131
+ };
132
+ const generateRow = (data) => {
133
+ const col = generateColumn(data);
134
+ const row = { cells: {} };
135
+ row.cells[col.name] = data.cell;
136
+ return row;
137
+ };
100
138
  const slotData = (cell, col) => {
101
139
  const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);
102
140
  if (!cell.isEditable) {
@@ -157,9 +195,11 @@ const mapData = (cell, col) => {
157
195
  const MainRADAdapter = (options, _fieldLabel, currentValue) => {
158
196
  return RADAdapter(currentValue, options);
159
197
  };
160
- const MainITXAdapter = (options, _fieldLabel, _currentValue) => {
198
+ const MainITXAdapter = (options, _fieldLabel, _currentValue, _cell) => {
161
199
  if (options === null || options === void 0 ? void 0 : options[0]) {
162
- return { label: options[0].label };
200
+ return {
201
+ value: options[0].label,
202
+ };
163
203
  }
164
204
  };
165
205
  const MainBTNAdapter = (_options, _fieldLabel, _currentValue, cell) => {
@@ -1 +1 @@
1
- {"file":"kup-cell.entry.js","mappings":";;;;;;;;;;;;AAAA;;;;AAIA,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,8DAA8C,CAAA;IAC9C,8CA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CAAC;QACvC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAC1C;;;;;;;","names":["this","setProps"],"sources":["src/components/kup-cell/kup-cell-declarations.ts","src/f-components/f-cell-options.tsx/f-cell-options.tsx","src/components/kup-cell/kup-cell.scss?tag=kup-cell&encapsulation=shadow","src/components/kup-cell/kup-cell.tsx"],"sourcesContent":["/**\n * Props of the kup-cell component.\n * Used to export every prop in an object.\n */\nexport enum KupCellProps {\n customStyle = 'Custom style of the component.',\n data = 'The data of the cell.',\n density = \"The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.\",\n dragEnabled = 'When set to true, the component is draggable.',\n}\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport { KupDom } from '../../managers/kup-manager/kup-manager-declarations';\nimport { GenericObject, KupDataColumn } from '../../components';\nimport { CMBandACPAdapter, RADAdapter } from '../../utils/cell-utils';\nimport {\n FCellOptionsProps,\n FCellProps,\n FCellTypes,\n} from '../f-cell/f-cell-declarations';\nimport {\n DataAdapterFn,\n KupInputPanelCell,\n} from '../../components/kup-input-panel/kup-input-panel-declarations';\nimport {\n KupDataCell,\n KupDataCellOptions,\n} from '../../managers/kup-data/kup-data-declarations';\nimport { FCell } from '../f-cell/f-cell';\n\nconst dom: KupDom = document.documentElement as KupDom;\n\nconst treeOptionsNodeAdapter = (\n options: any,\n currentValue: string\n): GenericObject[] => {\n return options.children.map((child) => ({\n id: child.content.codice,\n value: child.content.testo,\n selected: currentValue === child.content.codice,\n children: child.children?.length\n ? treeOptionsNodeAdapter(child, currentValue)\n : [],\n }));\n};\n\nconst dataTreeOptionsChildrenAdapter = (\n options: any,\n currentValue: string\n): GenericObject[] => {\n return options.children.map((child) => ({\n id: child.obj.k,\n value: child.value,\n selected: currentValue === child.obj.k,\n children: child.children?.length\n ? dataTreeOptionsChildrenAdapter(child, currentValue)\n : [],\n }));\n};\n\nconst tableOptionsAdapter = (\n options: any,\n currentValue: string\n): GenericObject[] => {\n return options.rows.map((row) => {\n const cells = row.fields || row.cells;\n const [id, value] = Object.keys(cells);\n\n return {\n id: cells[id].value,\n value: cells[value]?.value || cells[id].value,\n selected: currentValue === cells[id].value,\n };\n });\n};\n\nconst optionsTreeComboAdapter = (options: any, currentValue: string) => {\n const adapter = optionsAdapterMap.get(options.type);\n\n if (adapter) {\n return adapter(options, currentValue);\n } else {\n return options.map((option) => ({\n value: option.label,\n id: option.id,\n selected: currentValue === option.id,\n }));\n }\n};\n\nconst optionsAdapterMap = new Map<\n string,\n (options: any, currentValue: string) => GenericObject[]\n>([\n ['SmeupTreeNode', treeOptionsNodeAdapter.bind(this)],\n ['SmeupDataTree', dataTreeOptionsChildrenAdapter.bind(this)],\n ['SmeupTable', tableOptionsAdapter.bind(this)],\n ['SmeupDataTable', tableOptionsAdapter.bind(this)],\n]);\n\nexport const FCellOptions: FunctionalComponent<FCellOptionsProps> = (\n props: FCellOptionsProps\n) => {\n const mappedCell = props.cell\n ? {\n ...props.cell,\n data: setProps(props.cell, props.column),\n slotData: slotData(props.cell, props.column),\n isEditable: true,\n }\n : null;\n\n const mappedProps: FCellProps = {\n ...props,\n editable: true,\n cell: mappedCell as KupDataCell,\n };\n\n return <FCell {...mappedProps}></FCell>;\n};\n\nconst slotData = (cell: KupDataCellOptions, col: KupDataColumn) => {\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n\n if (!cell.isEditable) {\n return null;\n }\n\n if (\n cellType === FCellTypes.MULTI_AUTOCOMPLETE ||\n cellType === FCellTypes.MULTI_COMBOBOX\n ) {\n return {\n ...CMBandACPAdapter(\n null,\n col.title,\n cell.options\n // cell,\n // col.name\n ),\n showDropDownIcon: true,\n class: '',\n style: { width: '100%' },\n disabled: !cell.isEditable,\n id: col.name,\n };\n }\n\n return null;\n};\n\nconst setProps = (cell: KupDataCellOptions, column: KupDataColumn) => {\n const defaultProps = {\n ...mapData(cell, column),\n disabled: !cell.isEditable,\n id: column.name,\n };\n\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n const { data, ...noDataProps } = cell.data || {};\n return cellType !== FCellTypes.MULTI_AUTOCOMPLETE &&\n cellType !== FCellTypes.MULTI_COMBOBOX\n ? deepObjectsMerge(defaultProps, {\n ...cell.data,\n })\n : // Add and ovverride defaultProps of Chip host component except data\n {\n ...defaultProps,\n ...noDataProps,\n };\n};\n\nconst deepObjectsMerge = (target: GenericObject, source: GenericObject) => {\n for (const key in source) {\n if (\n source[key] instanceof Object &&\n !Array.isArray(source[key]) &&\n key in target\n ) {\n target[key] = deepObjectsMerge(target[key], source[key]);\n } else {\n target[key] = source[key];\n }\n }\n return target;\n};\n\nconst mapData = (cell: KupDataCellOptions, col: KupDataColumn) => {\n if (!cell) {\n return null;\n }\n\n const options = cell.options;\n const fieldLabel = col.title;\n const currentValue = cell.value;\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n const dataAdapterMap = new Map<FCellTypes, DataAdapterFn>([\n [FCellTypes.BUTTON_LIST, MainBTNAdapter.bind(this)],\n [FCellTypes.STRING, MainITXAdapter.bind(this)],\n [FCellTypes.RADIO, MainRADAdapter.bind(this)],\n [FCellTypes.AUTOCOMPLETE, MainCMBandACPAdapter.bind(this)],\n [FCellTypes.COMBOBOX, MainCMBandACPAdapter.bind(this)],\n ]);\n\n const adapter = dataAdapterMap.get(cellType);\n\n return adapter\n ? adapter(options, fieldLabel, currentValue, cell, col.name)\n : null;\n};\n\nconst MainRADAdapter = (\n options: GenericObject,\n _fieldLabel: string,\n currentValue: string\n) => {\n return RADAdapter(currentValue, options);\n};\n\nconst MainITXAdapter = (\n options: GenericObject,\n _fieldLabel: string,\n _currentValue: string\n) => {\n if (options?.[0]) {\n return { label: options[0].label };\n }\n};\n\nconst MainBTNAdapter = (\n _options: GenericObject,\n _fieldLabel: string,\n _currentValue: string,\n cell: KupDataCellOptions\n) => {\n return {\n data: cell.options?.length\n ? cell.options?.map((option) => ({\n icon: option.icon,\n value: option.value,\n }))\n : [],\n };\n};\n\nconst MainCMBandACPAdapter = (\n rawOptions: GenericObject,\n fieldLabel: string,\n currentValue: string\n) => {\n const configCMandACP = CMBandACPAdapter(currentValue, fieldLabel, []);\n\n configCMandACP.data['kup-list'].data = optionsTreeComboAdapter(\n rawOptions,\n currentValue\n );\n return configCMandACP;\n};\n","/**\n* @prop --kup-cell-background: Sets the background of the cell.\n* @prop --kup-cell-font-family: Sets the font family of the cell.\n* @prop --kup-cell-font-family-monospace: Sets the monospace font family of the cell (for numbers).\n* @prop --kup-cell-font-size: Sets the font size of the cell.\n* @prop --kup-cell-text-color: Sets the text color of the cell.\n*\n* NOTE: These variables are defined in the \"kup-theme.css\" file, because they must work even without the kup component (it's a functional component)\n*\n*/\n\n:host {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n#kup-component {\n height: 100%;\n width: 100%;\n}\n","import {\n Component,\n Element,\n forceUpdate,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport {\n KupManager,\n kupManagerInstance,\n} from '../../managers/kup-manager/kup-manager';\nimport { GenericObject, KupComponent } from '../../types/GenericTypes';\nimport { getProps, setProps } from '../../utils/utils';\nimport { componentWrapperId } from '../../variables/GenericVariables';\nimport { KupCellProps } from './kup-cell-declarations';\nimport { FCell } from '../../f-components/f-cell/f-cell';\nimport {\n FCellOptionsProps,\n FCellPadding,\n FCellProps,\n} from '../../f-components/f-cell/f-cell-declarations';\nimport {\n KupDragDataTransferCallback,\n KupDragEffect,\n} from '../../managers/kup-interact/kup-interact-declarations';\nimport { KupLanguageGeneric } from '../../managers/kup-language/kup-language-declarations';\nimport {\n KupDataCell,\n KupDataCellOptions,\n KupDataColumn,\n KupDataRow,\n} from '../../managers/kup-data/kup-data-declarations';\nimport { FCellOptions } from '../../f-components/f-cell-options.tsx/f-cell-options';\n\n@Component({\n tag: 'kup-cell',\n styleUrl: 'kup-cell.scss',\n shadow: true,\n})\nexport class KupCell {\n /**\n * References the root HTML element of the component (<kup-text-field>).\n */\n @Element() rootElement: HTMLElement;\n\n /*-------------------------------------------------*/\n /* P r o p s */\n /*-------------------------------------------------*/\n\n /**\n * Custom style of the component.\n * @default \"\"\n * @see https://smeup.github.io/ketchup/#/customization\n */\n @Prop() customStyle: string = '';\n /**\n * The data of the cell.\n * @default false\n */\n @Prop() data: KupDataCell = null;\n /**\n * The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.\n */\n @Prop() density: FCellPadding = FCellPadding.NONE;\n /**\n * When set to true, the component is draggable.\n * @default false\n */\n @Prop() dragEnabled: boolean = false;\n\n /*-------------------------------------------------*/\n /* I n t e r n a l V a r i a b l e s */\n /*-------------------------------------------------*/\n\n /**\n * Instance of the KupManager class.\n */\n private kupManager: KupManager = kupManagerInstance();\n\n /*-------------------------------------------------*/\n /* P u b l i c M e t h o d s */\n /*-------------------------------------------------*/\n\n /**\n * Adds the given CSS classes to the cell's data.\n * @param {string[]} classes - Array of CSS classes.\n */\n @Method()\n async addCssClasses(classes?: string[]): Promise<void> {\n if (!this.data.cssClass) {\n this.data.cssClass = '';\n }\n if (classes) {\n for (let index = 0; index < classes.length; index++) {\n const cssClass = classes[index];\n if (this.data.cssClass.indexOf(cssClass) < 0) {\n this.data.cssClass += ` ${cssClass}`;\n }\n }\n }\n this.refresh();\n }\n /**\n * Used to retrieve component's props values.\n * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.\n * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.\n */\n @Method()\n async getProps(descriptions?: boolean): Promise<GenericObject> {\n return getProps(this, KupCellProps, descriptions);\n }\n /**\n * This method is used to trigger a new render of the component.\n */\n @Method()\n async refresh(): Promise<void> {\n forceUpdate(this);\n }\n /**\n * Removes the given CSS classes from the cell's data.\n * @param {string[]} classes - Array of CSS classes.\n */\n @Method()\n async removeCssClasses(classes?: string[]): Promise<void> {\n if (!this.data.cssClass) {\n return;\n }\n if (classes) {\n for (let index = 0; index < classes.length; index++) {\n const cssClass = classes[index];\n if (this.data.cssClass.indexOf(cssClass) > 0) {\n this.data.cssClass = this.data.cssClass.replace(\n new RegExp(cssClass, 'g'),\n ''\n );\n }\n }\n }\n this.refresh();\n }\n /**\n * Sets the props to the component.\n * @param {GenericObject} props - Object containing props that will be set to the component.\n */\n @Method()\n async setProps(props: GenericObject): Promise<void> {\n setProps(this, KupCellProps, props);\n }\n\n /*-------------------------------------------------*/\n /* P r i v a t e M e t h o d s */\n /*-------------------------------------------------*/\n\n private didRenderInteractables() {\n if (this.dragEnabled) {\n const dataCb: KupDragDataTransferCallback = () => {\n return {\n cell: this.data,\n column: this.generateColumn(),\n id: this.rootElement.id,\n multiple: false,\n row: this.generateRow(),\n };\n };\n\n this.kupManager.interact.draggable(\n this.rootElement.shadowRoot.querySelector(\n '#' + componentWrapperId\n ),\n {\n cursorChecker() {\n return null;\n },\n },\n {\n callback: dataCb,\n },\n KupDragEffect.BADGE\n );\n }\n }\n\n private generateColumn(): KupDataColumn {\n const colname: string =\n this.data && this.data.obj && this.data.obj.t\n ? this.data.obj.t + ';' + this.data.obj.p\n : 'KUPCELL';\n const coltitle: string =\n this.data && this.data.obj && this.data.obj.t\n ? this.data.obj.t + ';' + this.data.obj.p\n : this.kupManager.language.translate(\n KupLanguageGeneric.EMPTY_OBJECT\n );\n return {\n name: colname,\n title: coltitle,\n };\n }\n\n private generateRow(): KupDataRow {\n const col: KupDataColumn = this.generateColumn();\n const row: KupDataRow = { cells: {} };\n row.cells[col.name] = this.data;\n return row;\n }\n\n /*-------------------------------------------------*/\n /* L i f e c y c l e H o o k s */\n /*-------------------------------------------------*/\n\n componentWillLoad() {\n this.kupManager.dates.register(this);\n this.kupManager.debug.logLoad(this, false);\n this.kupManager.language.register(this);\n this.kupManager.theme.register(this);\n }\n\n componentDidLoad() {\n this.kupManager.debug.logLoad(this, true);\n }\n\n componentWillRender() {\n this.kupManager.debug.logRender(this, false);\n }\n\n componentDidRender() {\n this.didRenderInteractables();\n this.kupManager.debug.logRender(this, true);\n }\n\n render() {\n const props: FCellOptionsProps = {\n cell: this.data as KupDataCellOptions,\n column: this.generateColumn(),\n component: this,\n density: this.density,\n editable: this.data.isEditable,\n renderKup: true,\n row: this.generateRow(),\n };\n return (\n <Host>\n <style>\n {this.kupManager.theme.setKupStyle(\n this.rootElement as KupComponent\n )}\n </style>\n <div id={componentWrapperId}>\n <FCellOptions {...props}></FCellOptions>\n </div>\n </Host>\n );\n }\n\n disconnectedCallback() {\n this.kupManager.dates.unregister(this);\n this.kupManager.language.unregister(this);\n this.kupManager.theme.unregister(this);\n }\n}\n"],"version":3}
1
+ {"file":"kup-cell.entry.js","mappings":";;;;;;;;;;;;AAAA;;;;AAIA,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,8DAA8C,CAAA;IAC9C,8CAA8B,CAAA;IAC9B,mHAAmG,CAAA;IACnG,6EAA6D,CAAA;AACjE,CAAC,EALW,YAAY,KAAZ,YAAY;;;;;;;;;;;;;ACiBxB,MAAM,GAAG,GAAW,QAAQ,CAAC,eAAyB,CAAC;AAEvD,MAAM,sBAAsB,GAAG,CAC3B,OAAY,EACZ,YAAoB;IAEpB,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK;;QAAK,QAAC;YACpC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;YACxB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,QAAQ,EAAE,YAAY,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM;YAC/C,QAAQ,EAAE,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM;kBAC1B,sBAAsB,CAAC,KAAK,EAAE,YAAY,CAAC;kBAC3C,EAAE;SACX,EAAC;KAAA,CAAC,CAAC;AACR,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CACnC,OAAY,EACZ,YAAoB;IAEpB,OAAO,OAAO,CAAC,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KAC1C;;;;;;;","names":["this","setProps"],"sources":["src/components/kup-cell/kup-cell-declarations.ts","src/f-components/f-cell-options.tsx/f-cell-options.tsx","src/components/kup-cell/kup-cell.scss?tag=kup-cell&encapsulation=shadow","src/components/kup-cell/kup-cell.tsx"],"sourcesContent":["/**\n * Props of the kup-cell component.\n * Used to export every prop in an object.\n */\nexport enum KupCellProps {\n customStyle = 'Custom style of the component.',\n data = 'The data of the cell.',\n density = \"The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.\",\n dragEnabled = 'When set to true, the component is draggable.',\n}\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport { KupDom } from '../../managers/kup-manager/kup-manager-declarations';\nimport { GenericObject, KupDataColumn } from '../../components';\nimport { CMBandACPAdapter, RADAdapter } from '../../utils/cell-utils';\nimport {\n FCellOptionsProps,\n FCellProps,\n FCellShapes,\n FCellTypes,\n} from '../f-cell/f-cell-declarations';\nimport {\n DataAdapterFn,\n KupInputPanelCell,\n} from '../../components/kup-input-panel/kup-input-panel-declarations';\nimport {\n KupDataCell,\n KupDataCellOptions,\n KupDataRow,\n} from '../../managers/kup-data/kup-data-declarations';\nimport { FCell } from '../f-cell/f-cell';\n\nconst dom: KupDom = document.documentElement as KupDom;\n\nconst treeOptionsNodeAdapter = (\n options: any,\n currentValue: string\n): GenericObject[] => {\n return options.children.map((child) => ({\n id: child.content.codice,\n value: child.content.testo,\n selected: currentValue === child.content.codice,\n children: child.children?.length\n ? treeOptionsNodeAdapter(child, currentValue)\n : [],\n }));\n};\n\nconst dataTreeOptionsChildrenAdapter = (\n options: any,\n currentValue: string\n): GenericObject[] => {\n return options.children.map((child) => ({\n id: child.obj.k,\n value: child.value,\n selected: currentValue === child.obj.k,\n children: child.children?.length\n ? dataTreeOptionsChildrenAdapter(child, currentValue)\n : [],\n }));\n};\n\nconst tableOptionsAdapter = (\n options: any,\n currentValue: string\n): GenericObject[] => {\n return options.rows.map((row) => {\n const cells = row.fields || row.cells;\n const [id, value] = Object.keys(cells);\n\n return {\n id: cells[id].value,\n value: cells[value]?.value || cells[id].value,\n selected: currentValue === cells[id].value,\n };\n });\n};\n\nconst optionsTreeComboAdapter = (options: any, currentValue: string) => {\n const adapter = optionsAdapterMap.get(options.type);\n\n if (adapter) {\n return adapter(options, currentValue);\n } else {\n return options.map((option) => ({\n value: option.label,\n id: option.id,\n selected: currentValue === option.id,\n }));\n }\n};\n\nconst optionsAdapterMap = new Map<\n string,\n (options: any, currentValue: string) => GenericObject[]\n>([\n ['SmeupTreeNode', treeOptionsNodeAdapter.bind(this)],\n ['SmeupDataTree', dataTreeOptionsChildrenAdapter.bind(this)],\n ['SmeupTable', tableOptionsAdapter.bind(this)],\n ['SmeupDataTable', tableOptionsAdapter.bind(this)],\n]);\n\nexport const FCellOptions: FunctionalComponent<FCellOptionsProps> = (\n props: FCellOptionsProps\n) => {\n const mappedCell = props.cell\n ? {\n ...props.cell,\n data: setProps(props.cell, props.column),\n slotData: slotData(props.cell, props.column),\n isEditable: true,\n }\n : null;\n\n const mappedProps: FCellProps = {\n ...props,\n editable: true,\n cell: mappedCell as KupDataCell,\n column: generateColumn(mappedCell.data),\n row: generateRow(mappedCell.data),\n };\n\n if (props.cell.shape === FCellShapes.TEXT_FIELD) {\n mappedProps.cell.value = mappedProps.cell.data.value;\n }\n\n const label = getLabelComponent(mappedProps.cell, mappedProps.column.title);\n\n if (label) {\n return (\n <div class={{ 'input-panel__label_container': true }}>\n {label}\n <FCell {...mappedProps} />\n </div>\n );\n }\n console.log('props', mappedProps);\n return <FCell {...mappedProps}></FCell>;\n};\n\nconst getLabelComponent = (cell: KupDataCell, label: string) => {\n if (!label) {\n return null;\n }\n\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n\n if (cellType === FCellTypes.RADIO) {\n return <span>{label}</span>;\n }\n\n return null;\n};\n\nconst generateColumn = (data: GenericObject): KupDataColumn => {\n const colname: string =\n data && data.obj && data.obj.t\n ? data.obj.t + ';' + data.obj.p\n : 'KUPCELL';\n const coltitle: string =\n data && data.obj && data.obj.t\n ? data.obj.t + ';' + data.obj.p\n : 'genericEmptyObject';\n return {\n name: colname,\n title: coltitle,\n };\n};\n\nconst generateRow = (data: GenericObject): KupDataRow => {\n const col: KupDataColumn = generateColumn(data);\n const row: KupDataRow = { cells: {} };\n row.cells[col.name] = data.cell;\n return row;\n};\n\nconst slotData = (cell: KupDataCellOptions, col: KupDataColumn) => {\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n\n if (!cell.isEditable) {\n return null;\n }\n\n if (\n cellType === FCellTypes.MULTI_AUTOCOMPLETE ||\n cellType === FCellTypes.MULTI_COMBOBOX\n ) {\n return {\n ...CMBandACPAdapter(\n null,\n col.title,\n cell.options\n // cell,\n // col.name\n ),\n showDropDownIcon: true,\n class: '',\n style: { width: '100%' },\n disabled: !cell.isEditable,\n id: col.name,\n };\n }\n\n return null;\n};\n\nconst setProps = (cell: KupDataCellOptions, column: KupDataColumn) => {\n const defaultProps = {\n ...mapData(cell, column),\n disabled: !cell.isEditable,\n id: column.name,\n };\n\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n const { data, ...noDataProps } = cell.data || {};\n return cellType !== FCellTypes.MULTI_AUTOCOMPLETE &&\n cellType !== FCellTypes.MULTI_COMBOBOX\n ? deepObjectsMerge(defaultProps, {\n ...cell.data,\n })\n : // Add and ovverride defaultProps of Chip host component except data\n {\n ...defaultProps,\n ...noDataProps,\n };\n};\n\nconst deepObjectsMerge = (target: GenericObject, source: GenericObject) => {\n for (const key in source) {\n if (\n source[key] instanceof Object &&\n !Array.isArray(source[key]) &&\n key in target\n ) {\n target[key] = deepObjectsMerge(target[key], source[key]);\n } else {\n target[key] = source[key];\n }\n }\n return target;\n};\n\nconst mapData = (cell: KupDataCellOptions, col: KupDataColumn) => {\n if (!cell) {\n return null;\n }\n\n const options = cell.options;\n const fieldLabel = col.title;\n const currentValue = cell.value;\n const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);\n const dataAdapterMap = new Map<FCellTypes, DataAdapterFn>([\n [FCellTypes.BUTTON_LIST, MainBTNAdapter.bind(this)],\n [FCellTypes.STRING, MainITXAdapter.bind(this)],\n [FCellTypes.RADIO, MainRADAdapter.bind(this)],\n [FCellTypes.AUTOCOMPLETE, MainCMBandACPAdapter.bind(this)],\n [FCellTypes.COMBOBOX, MainCMBandACPAdapter.bind(this)],\n ]);\n\n const adapter = dataAdapterMap.get(cellType);\n\n return adapter\n ? adapter(options, fieldLabel, currentValue, cell, col.name)\n : null;\n};\n\nconst MainRADAdapter = (\n options: GenericObject,\n _fieldLabel: string,\n currentValue: string\n) => {\n return RADAdapter(currentValue, options);\n};\n\nconst MainITXAdapter = (\n options: GenericObject,\n _fieldLabel: string,\n _currentValue: string,\n _cell: KupDataCellOptions\n) => {\n if (options?.[0]) {\n return {\n value: options[0].label,\n };\n }\n};\n\nconst MainBTNAdapter = (\n _options: GenericObject,\n _fieldLabel: string,\n _currentValue: string,\n cell: KupDataCellOptions\n) => {\n return {\n data: cell.options?.length\n ? cell.options?.map((option) => ({\n icon: option.icon,\n value: option.value,\n }))\n : [],\n };\n};\n\nconst MainCMBandACPAdapter = (\n rawOptions: GenericObject,\n fieldLabel: string,\n currentValue: string\n) => {\n const configCMandACP = CMBandACPAdapter(currentValue, fieldLabel, []);\n\n configCMandACP.data['kup-list'].data = optionsTreeComboAdapter(\n rawOptions,\n currentValue\n );\n return configCMandACP;\n};\n","/**\n* @prop --kup-cell-background: Sets the background of the cell.\n* @prop --kup-cell-font-family: Sets the font family of the cell.\n* @prop --kup-cell-font-family-monospace: Sets the monospace font family of the cell (for numbers).\n* @prop --kup-cell-font-size: Sets the font size of the cell.\n* @prop --kup-cell-text-color: Sets the text color of the cell.\n*\n* NOTE: These variables are defined in the \"kup-theme.css\" file, because they must work even without the kup component (it's a functional component)\n*\n*/\n\n:host {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n#kup-component {\n height: 100%;\n width: 100%;\n}\n","import {\n Component,\n Element,\n forceUpdate,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport {\n KupManager,\n kupManagerInstance,\n} from '../../managers/kup-manager/kup-manager';\nimport { GenericObject, KupComponent } from '../../types/GenericTypes';\nimport { getProps, setProps } from '../../utils/utils';\nimport { componentWrapperId } from '../../variables/GenericVariables';\nimport { KupCellProps } from './kup-cell-declarations';\nimport { FCell } from '../../f-components/f-cell/f-cell';\nimport {\n FCellOptionsProps,\n FCellPadding,\n FCellProps,\n} from '../../f-components/f-cell/f-cell-declarations';\nimport {\n KupDragDataTransferCallback,\n KupDragEffect,\n} from '../../managers/kup-interact/kup-interact-declarations';\nimport { KupLanguageGeneric } from '../../managers/kup-language/kup-language-declarations';\nimport {\n KupDataCell,\n KupDataCellOptions,\n KupDataColumn,\n KupDataRow,\n} from '../../managers/kup-data/kup-data-declarations';\nimport { FCellOptions } from '../../f-components/f-cell-options.tsx/f-cell-options';\n\n@Component({\n tag: 'kup-cell',\n styleUrl: 'kup-cell.scss',\n shadow: true,\n})\nexport class KupCell {\n /**\n * References the root HTML element of the component (<kup-text-field>).\n */\n @Element() rootElement: HTMLElement;\n\n /*-------------------------------------------------*/\n /* P r o p s */\n /*-------------------------------------------------*/\n\n /**\n * Custom style of the component.\n * @default \"\"\n * @see https://smeup.github.io/ketchup/#/customization\n */\n @Prop() customStyle: string = '';\n /**\n * The data of the cell.\n * @default false\n */\n @Prop() data: KupDataCell = null;\n /**\n * The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.\n */\n @Prop() density: FCellPadding = FCellPadding.NONE;\n /**\n * When set to true, the component is draggable.\n * @default false\n */\n @Prop() dragEnabled: boolean = false;\n\n /*-------------------------------------------------*/\n /* I n t e r n a l V a r i a b l e s */\n /*-------------------------------------------------*/\n\n /**\n * Instance of the KupManager class.\n */\n private kupManager: KupManager = kupManagerInstance();\n\n /*-------------------------------------------------*/\n /* P u b l i c M e t h o d s */\n /*-------------------------------------------------*/\n\n /**\n * Adds the given CSS classes to the cell's data.\n * @param {string[]} classes - Array of CSS classes.\n */\n @Method()\n async addCssClasses(classes?: string[]): Promise<void> {\n if (!this.data.cssClass) {\n this.data.cssClass = '';\n }\n if (classes) {\n for (let index = 0; index < classes.length; index++) {\n const cssClass = classes[index];\n if (this.data.cssClass.indexOf(cssClass) < 0) {\n this.data.cssClass += ` ${cssClass}`;\n }\n }\n }\n this.refresh();\n }\n /**\n * Used to retrieve component's props values.\n * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.\n * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.\n */\n @Method()\n async getProps(descriptions?: boolean): Promise<GenericObject> {\n return getProps(this, KupCellProps, descriptions);\n }\n /**\n * This method is used to trigger a new render of the component.\n */\n @Method()\n async refresh(): Promise<void> {\n forceUpdate(this);\n }\n /**\n * Removes the given CSS classes from the cell's data.\n * @param {string[]} classes - Array of CSS classes.\n */\n @Method()\n async removeCssClasses(classes?: string[]): Promise<void> {\n if (!this.data.cssClass) {\n return;\n }\n if (classes) {\n for (let index = 0; index < classes.length; index++) {\n const cssClass = classes[index];\n if (this.data.cssClass.indexOf(cssClass) > 0) {\n this.data.cssClass = this.data.cssClass.replace(\n new RegExp(cssClass, 'g'),\n ''\n );\n }\n }\n }\n this.refresh();\n }\n /**\n * Sets the props to the component.\n * @param {GenericObject} props - Object containing props that will be set to the component.\n */\n @Method()\n async setProps(props: GenericObject): Promise<void> {\n setProps(this, KupCellProps, props);\n }\n\n /*-------------------------------------------------*/\n /* P r i v a t e M e t h o d s */\n /*-------------------------------------------------*/\n\n private didRenderInteractables() {\n if (this.dragEnabled) {\n const dataCb: KupDragDataTransferCallback = () => {\n return {\n cell: this.data,\n column: this.generateColumn(),\n id: this.rootElement.id,\n multiple: false,\n row: this.generateRow(),\n };\n };\n\n this.kupManager.interact.draggable(\n this.rootElement.shadowRoot.querySelector(\n '#' + componentWrapperId\n ),\n {\n cursorChecker() {\n return null;\n },\n },\n {\n callback: dataCb,\n },\n KupDragEffect.BADGE\n );\n }\n }\n\n private generateColumn(): KupDataColumn {\n const colname: string =\n this.data && this.data.obj && this.data.obj.t\n ? this.data.obj.t + ';' + this.data.obj.p\n : 'KUPCELL';\n const coltitle: string =\n this.data && this.data.obj && this.data.obj.t\n ? this.data.obj.t + ';' + this.data.obj.p\n : this.kupManager.language.translate(\n KupLanguageGeneric.EMPTY_OBJECT\n );\n return {\n name: colname,\n title: coltitle,\n };\n }\n\n private generateRow(): KupDataRow {\n const col: KupDataColumn = this.generateColumn();\n const row: KupDataRow = { cells: {} };\n row.cells[col.name] = this.data;\n return row;\n }\n\n /*-------------------------------------------------*/\n /* L i f e c y c l e H o o k s */\n /*-------------------------------------------------*/\n\n componentWillLoad() {\n this.kupManager.dates.register(this);\n this.kupManager.debug.logLoad(this, false);\n this.kupManager.language.register(this);\n this.kupManager.theme.register(this);\n }\n\n componentDidLoad() {\n this.kupManager.debug.logLoad(this, true);\n }\n\n componentWillRender() {\n this.kupManager.debug.logRender(this, false);\n }\n\n componentDidRender() {\n this.didRenderInteractables();\n this.kupManager.debug.logRender(this, true);\n }\n\n render() {\n const props: FCellOptionsProps = {\n cell: this.data as KupDataCellOptions,\n column: this.generateColumn(),\n component: this,\n density: this.density,\n editable: this.data.isEditable,\n renderKup: true,\n row: this.generateRow(),\n };\n return (\n <Host>\n <style>\n {this.kupManager.theme.setKupStyle(\n this.rootElement as KupComponent\n )}\n </style>\n <div id={componentWrapperId}>\n <FCellOptions {...props}></FCellOptions>\n </div>\n </Host>\n );\n }\n\n disconnectedCallback() {\n this.kupManager.dates.unregister(this);\n this.kupManager.language.unregister(this);\n this.kupManager.theme.unregister(this);\n }\n}\n"],"version":3}
@@ -378,8 +378,8 @@ var KupTreeProps;
378
378
  KupTreeProps["globalFilter"] = "When set to true it activates the global filter.";
379
379
  KupTreeProps["globalFilterValue"] = "The value of the global filter.";
380
380
  KupTreeProps["globalFilterMode"] = "The mode of the global filter.";
381
- KupTreeProps["removableColumns"] = "Sets the possibility to remove the selected column.";
382
381
  KupTreeProps["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.";
382
+ KupTreeProps["removableColumns"] = "Sets the possibility to remove the selected column.";
383
383
  KupTreeProps["ripple"] = "When enabled displays Material's ripple effect on nodes (only when no columns are displayed).";
384
384
  KupTreeProps["scrollOnHover"] = "Activates the scroll on hover function.";
385
385
  KupTreeProps["showColumns"] = "Shows the tree data as a table.";
@@ -1498,4 +1498,4 @@ function decorateDataTable(data) {
1498
1498
 
1499
1499
  export { FiltersColumnMenu as F, KupTreeExpansionMode as K, FiltersRows as a, groupRows as b, calcTotals as c, decorateDataTable as d, KupTreeProps as e, filterRows as f, getDiffData as g, normalizeRows as n, paginateRows as p, sortRows as s, treeMainColumnName as t };
1500
1500
 
1501
- //# sourceMappingURL=kup-data-table-helper-6b828446.js.map
1501
+ //# sourceMappingURL=kup-data-table-helper-74b29c0e.js.map