import{d as i,a}from"./dataSchema-VwIQYPJL.js";import{l as e}from"./locale-wDcg0qDg.js";import{d as o}from"./utils-TB-VQl6t.js";const n=`The Table displays a dataset in rows and columns according to a given data-schema. An actions column can be configured to add extra functionalities.

The Table listens to the \`display-data\` event to initialize its form.

By clickinging on a row, the Table issues a request to prompt the user with a way of editing/visualizing the corresponding item - ie, emits a \`selected-data\` event. A component like the Dynamic Form Modal could act upon such request.

By default, rows can be selected through a checkbox. When this happens, the Table notifies it by emitting a \`selected-data-bulk\` event.
`,r=`La Table visualizza un set di dati in righe e colonne secondo un determinato schema di dati. Una colonna azioni può essere configurata per aggiungere ulteriori funzionalità.

La tabella ascolta l'evento \`display-data\` per inizializzare il suo modulo.

Facendo clic su una riga, la tabella emette una richiesta per chiedere all'utente di modificare/visualizzare l'elemento corrispondente, ossia emette un evento \`selected-data\`. Un componente come il Dynamic Form Modal potrebbe agire su tale richiesta.

Per impostazione predefinita, le righe possono essere selezionate tramite una checkbox. Quando ciò accade, la tabella lo notifica emettendo un evento \`selected-data-bulk\`.
`,t={type:"object",properties:{color:{type:"string",__mia_configuration:{label:"Color",description:"Background color applied to rows that match corresponding query","schema-hint":"color"}},query:{type:"object",__mia_configuration:{label:"Query",description:"Mongo-like query for filtering rows to highlight"}}}},s={docLink:"https://docs.mia-platform.eu/docs/microfrontend-composer/back-kit/components/table",type:"layout",label:"Table",description:"Displays a dataset in rows and columns according to a given data schema",descriptionLong:{en:n,it:r},example:JSON.stringify({tag:"bk-table",properties:{dataSchema:{type:"object",properties:{_id:{type:"string"}}},rowActions:{kind:"icons",actions:[{kind:"event",content:"duplicate-data",label:"Duplicate Data",icon:"far fa copy"}]}}}),definitions:{customAction:{type:"object",properties:{tag:{__mia_configuration:{attribute:!1,label:"Tag",description:'Html tag of the component to mount (e.g. "bk-button")'},type:"string"},properties:{__mia_configuration:{attribute:!1,label:"Properties",description:"Properties to inject to the mounted component"},type:"object"}}},...i,dataSchema:a},properties:{dataSchema:{$ref:"#/definitions/dataSchema",__mia_configuration:{priority:"high",attribute:!1,"shared-key":"back-kit/data-schema",label:"Data schema",description:"Data schema describing the fields of the collection to display",group:"content"}},disableRowClick:{type:"boolean",default:!1,__mia_configuration:{priority:"high",attribute:"disable-row-click",label:"Disable row click",description:"When `true`, a click on a row does not trigger an event",group:"interaction"}},disableRowSelectionChange:{type:"boolean",default:!1,__mia_configuration:{attribute:"disable-row-selection-change",label:"Disable row selection change",description:"When `true`, selecting a row through the checkbox in the first column does not trigger an event",group:"interaction"}},initialSortDirection:{type:"string",enum:["ascend","descend"],__mia_configuration:{label:"Sort direction",attribute:!0}},initialSortProperty:{type:"string",__mia_configuration:{label:"Sort property",attribute:!0}},rowActions:{__mia_configuration:{priority:"high",attribute:!1,label:"Row Actions",description:"List of actions to render per row",group:"interaction"},type:"object",properties:{actions:{type:"array",items:{type:"object",properties:{...o}},__mia_configuration:{label:"Actions",arrayVisualization:{type:"table",configuration:{columns:["label","kind"]}}}},kind:{type:"string",enum:["icons","cta"],__mia_configuration:{label:"Kind",enumLabels:{icons:"Icons",cta:"Call to action"}}}}},customActions:{__mia_configuration:{attribute:!1,label:"Custom Actions",description:"List of custom components, rendered in the action column",group:"interaction"},oneOf:[{type:"array",items:{type:"object",properties:{keys:{__mia_configuration:{label:"Nesting Keys",description:"List of nesting keys that need to be sequentially traversed to visualize the actions.  Leave empty for non-nested tables."},type:"array",items:{type:"string"}},customActions:{__mia_configuration:{label:"Actions",description:"List of components to mount in action column."},type:"array",items:{$ref:"#/definitions/customAction"}}}}},{type:"array",items:{$ref:"#/definitions/customAction"}}]},navigationRowActions:{__mia_configuration:{attribute:!1,label:"Navigation row actions",description:"Actions in nested objects",group:"interaction"},type:"object",default:{kind:"icons",actions:[{requireConfirm:!0,type:"delete",disableInReadOnly:!0}]},examples:[{kind:"icons",actions:[{requireConfirm:!0,type:"delete",disableInReadOnly:!0}]}],properties:{kind:{title:"Kind",type:"string",enum:["cta","icons"],__mia_configuration:{enumLabels:{cta:"Call to action",icons:"Icons"}}},actions:{title:"Actions",type:"array",items:{type:"object",properties:{danger:{title:"Danger",type:"boolean"},requireConfirm:{title:"Require confirm",type:"boolean"},type:{title:"Type",type:"string",enum:["delete","detail"],__mia_configuration:{enumLabels:{delete:"Delete",detail:"Detail"}}},disableInReadOnly:{title:"Disable in read only",type:"boolean"},icon:{title:"Icon",type:"string"}},required:["requireConfirm","disableInReadOnly"]},__mia_configuration:{arrayVisualization:{type:"table",configuration:{columns:["type"]}}}}}},browseOnRowSelect:{__mia_configuration:{attribute:!1,label:"Browse on row select",description:"If set, a click on a row will navigate you to another location",group:"interaction"},type:"object",properties:{navigationType:{type:"string",enum:["replace","push","href"]},href:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"],default:"_self"},query:{type:"object"}}},maxLines:{type:"number",__mia_configuration:{priority:"high",label:"Max lines",description:"Force lines that will be displayed together. Cannot be used with fit parent container property",attribute:"max-lines",group:"appearance"}},fitParentContainer:{type:"boolean",__mia_configuration:{priority:"high",label:"Fit parent container",description:"Make the table fit the parent container height. Cannot be used with max lines property",attribute:"fit-parent-container",group:"appearance"}},customMessageOnAbsentLookup:{__mia_configuration:{attribute:!1,"schema-hint":"localized-text",label:"Message on absent lookup",description:"Message that overrides a lookup value in case the lookup is not resolved due to lack of data",group:"content"}},allowNavigation:{default:!0,type:"boolean",__mia_configuration:{attribute:"allow-navigation",label:"Allow navigation",description:"When `true`, it is possible to navigate to nested objects and arrays if a dataSchema is specified",group:"interaction"}},disableRowSelection:{default:!1,type:"boolean",__mia_configuration:{priority:"high",attribute:"disable-row-selection",label:"Disable row selection",description:"When `true`, checkbox in the first column will not be displayed",group:"interaction"}},openFileInViewerRegex:{__mia_configuration:{attribute:!0,label:"Open file in viewer",description:"Regex expressions that are matched against file cells. If one matches, the cell is clickable and the file opens inside a viewer (default) or is downloaded.",group:"interaction"},oneOf:[{type:"string"},{type:"array",items:{type:"string"}},{type:"object",additionalProperties:{type:"string",enum:["view","download"]}}]},resizableColumns:{type:"boolean",default:!1,__mia_configuration:{priority:"high",label:"Resizable columns",description:"Whether the table columns can be resized. When `true`, columns can be resized from the table header",attribute:"resizable-columns",group:"interaction"}},loadingOnStart:{type:"boolean",default:!0,__mia_configuration:{label:"Loading on start",description:"Whether the table should be in loading state on connection",attribute:"loading-on-start",group:"appearance"}},showArrayPopover:{type:"boolean",default:!1,__mia_configuration:{attribute:"show-array-popover",label:"Show array popover",description:"Whether to display a popup on mouse-over on array cells, showing their value. Not available for arrays of objects or arrays of arrays.",group:"appearance"}},primaryKey:{type:"string",default:"_id",__mia_configuration:{attribute:"primary-key",label:"Primary Key",priority:"medium",description:"Primary key to identify different rows",group:"content"}},fixedColumns:{__mia_configuration:{attribute:!1,label:"Fixed columns",description:"either the number of columns to fix from left or an object containing how many columns to fix from left and/or right",group:"appearance"},oneOf:[{type:"number"},{type:"object",properties:{left:{type:"number"},right:{type:"number"}}}]},displayedDataPath:{type:"string",__mia_configuration:{attribute:!1,label:"Displayed data path",description:"Specify an object path as datasource for displayed data",group:"content"}},highlightedRows:{__mia_configuration:{attribute:!1,label:"Highlited rows",description:"Specifies one or multiple color-query pairs to dynamically highlight rows",group:"appearance"},oneOf:[t,{type:"array",items:t}]},customLocale:{__mia_configuration:{attribute:!1,label:"Custom Locale",description:"Custom localized texts shown as component labels",priority:"low",group:"content"},type:"object",properties:{actionsTitle:e("Actions Title"),element:e("Element"),elements:e("Elements"),moreActions:e("More Actions"),dateFormat:{__mia_configuration:{label:"Date Format"},type:"object",properties:{date:e("Date"),"date-time":e("Date-Time"),time:e("Time")}}}}}};var u=s;export{u as default};
