# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0] - 29/05/2025

### Added

- **[Generic]** In the CSS, put as many as possible colors in variables. Unified a few colors that looked very similar too.

## [2.1.2] - 24/03/2025

### Fixed

- **[ComboBox]** The static `fromSelectElement` method, now instantiates the correct (sub)class (useful when extending
  ComboBox)
-

## [2.1.1] - 24/03/2025

### Fixed

- **[ComboBox]** When constructing a ComboBox based on pre-existing HTML elements, the value and visible text are now
  properly synchronized

## [2.1.0] - 22/03/2025

### Added

- **[CollectionView]** Added method `setHiddenFieldPatterns` to set patterns which are used to hide fields from the
  overview (useful when auto-detecting header names, but need to hide specific ones)

## [2.0.1] - 24/02/2025

### Fixed

- **[CollectionView]** Several null checks that got lost or are needed since the refactoring

## [2.0.0] - 23/02/2025

### Changed

- **[Table]** Refactored Table into CollectionView base class to support multiple view types in the future
- **[Table]** Changed name of `setData` to `setItems`
- **[Table]** Replaced `addMainAction()`, `addBulkAction()`, `addRowAction()`, and `addQuickRowAction()` with a single
  method: `addAction()`.
    - Supports different action scopes: "main", "bulk", "item", and "pinned".

## [1.16.0] - 18/02/2025

### Changed

- **[Table]** The `setHeaderFields` method will now map string arrays to the correct structure (
  `{$name: 'john', $title: 'John'}`). This simplifies code further down the line. Also, the headerFields array is now
  populated when determining header fields automatically (before the array stayed empty)

## [1.15.0] - 11/02/2025

### Fixed

- **[Loader]** Loading icon is now set using inline base64 instead of referring to an SVG file that is not included in
  the package

## [1.14.0] - 29/12/2024

### Fixed

- **[Generic]** Exposed the classes as global variables for the bundles (previously there was a js object due to
  basename error)

## [1.13.0] - 28/12/2024

### Added

- **[Generic]** Bundled all controls so they are standalone usable in the browser using `script` tag

## [1.11.2] - 4/10/2024

### Fixed

- **[Table]** Another typo within new table action button icon function logic

## [1.11.1] - 4/10/2024

### Fixed

- **[Table]** Typo within new table action button icon function logic

## [1.11.0] - 4/10/2024

### Added

- **[TabControl]** Added option `unifyTabSizes` to make all tab children the same sizes. Especially useful to prevent
  popping of content (e.g. in modals)
- **[Table]** The icon parameter of all action types can now also be a function with data parameter that should return a
  FontAwesome classname. This is useful to show a different icon based on data context.

## [1.10.1] - 4/7/2024

### Fixed

- **[Table]** Removed leftover console log for debug purposes

## [1.10.0] - 4/7/2024

### Added

- **[Table]** A new action type called "quick action" has been added, which are action buttons that are placed right
  next to the context menu button for quick use.

## [1.9.0] - 4/6/2024

### Changed

- **[Table]** The custom render function for columns now accepts both an HTML string and also a node (e.g. HTMLElement)

## [1.8.6] - 8/22/2023

### Changed

- **[ComboBox]** When datasource changes (or initial load), the currently selected value will be reset to make sure it's
  reflecting the potential new label

## [1.8.5] - 8/22/2023

### Changed

- **[ContextMenu]** Filtering is now case-insensitive

## [1.8.3] - 8/22/2023

### Added

- **[ContextMenu]** Now has dataSource option which can load items from a URL. This is different from searching, which
  makes requests while typing. Datasource only loads one time.

## [1.8.0] - 8/21/2023

### Fixed

- **[Expandable]** Had the expanded and non-expanded states mixed up.

## [1.8.0] - 8/21/2023

### Added

- **[Expandable]** A simple control to create expandable sections with a button. Nothing fancy, just on/off show a body.

## [1.6.0] - 8/10/2023

### Added

- **[Draggable]** A draggable helper class to convert any element into a draggable one. Supports limiting movement
  directions, move within parent and dragging from an anchor point
- **[Table]** Table now has a dragging indicator at the beginning of the row
- **[Checkbox]** Added an indeterminate state. Table will use it to indicate some checkboxes are checked.

### Fixed

- **[Pagination]** Corrected classnames
- **[ComboBox]** The `emitEvent` flag for the `setValue` method now actually does something
- **[ContextMenu]** ContextMenu now stays open if clicked on an input or textarea field

## [1.5.5] - 8/9/2023

### Fixed

- **[Pagination]** Listening to wrong page dropdown change event
- **[ComboBox]** Now corrects position if contextmenu would go off-screen due to size and location

### Added

- **[ContextMenu]** New option `positionToTriggerCenter` to indicate whether the menu should position itself towards the
  trigger element's center or directly under/above to it

### Changed

- **[ComboBox]** Now relies directly on the events of ContextMenu in regard to showing and hiding.

## [1.5.4] - 8/9/2023

### Fixed

- **[Pagination]** Getting and setting rows-per-page was not working

## [1.5.3] - 8/9/2023

### Fixed

- **[Pagination]** End range of page was incorrectly calculated.

## [1.5.2] - 8/9/2023

### Added

- **[Pagination]** Pagination is now responsible for initializing the "Rows per page" combobox instead of user.

## [1.5.1] - 8/9/2023

### Fixed

- **[Pagination]** Too hasty previous release. Corrected class names and selector to find the pagination control dom
  elements.

## [1.5.0] - 8/9/2023

### Removed

- **[Table]** Pagination control handling is no longer a responsibility of the Table control. This is done to prepare
  for future controls that use the same pagination.

### Added

- **[Pagination]** Pagination is now a standalone class that will handle pagination based on information at hand and
  hashbang navigation.

## [1.4.1] - 8/5/2023

### Changed

- **[ContextMenu]** The ContextMenu search length requirement has been fully removed. This is now the responsibility of
  the endpoint.

## [1.4.0] - 7/30/2023

### Added

- **[Modal]** Modal show now returns a promise that will resolve once modal is closed
- **[Modal]** Modals now close with a result that can be set using `data-modalresult` or programmatically with the
  `close(result)` method.

### Changed

- **[Modal]** Modal's standard cancel button is now recognized through `data-modalresult` instead of `data-modalcancel`

## [1.3.3] - 7/17/2023

### Fixed

- [Modal] Modals don't go offscreen anymore due to too large height by sizing the modal content dynamically

### Changed

- **[Tabcontrol]** no longer overflows with a scrollbar but will take maximum height instead. If used inside a modal,
  this gives the scrollbar back to the modal content

## [1.3.2] - 7/10/2023

### Added

- **[Modal]** A `modal-content-parent` style has been added for use cases where modal-content is not a direct child of
  modal. Every element in between modal and modal-content should have that style to allow proper sizing.

## [1.3.1] - 6/19/2023

### Added

- **[Generic]** Linting on javascript and stylesheets
- **[ContextMenu]** If searching in ContextMenu is enabled but no search URL is provided, behavior will change to filter
  within already present items instead.

### Changed

- The class to show Table's bulk actions is renamed from `tableBulkVisible` to `table-bulk-visible`
- The class indicate a modal has no title is renamed from `modal-titleless` to `modal-wo-title`
- Context Menu items are now required to be wrapped in a `menu-item-wrapper`

## [1.3.0] - 6/4/2023

Sorry, we lost this version's changelog

## [1.2.0] - 5/26/2023

### Added

- **[ContextMenu]** if an item is present in ContextMenu that only has an ID but no value/title, the value/title will be
  resolved using the searchUrl.

## [1.1.1] - 5/26/2023

### Added

- **[ComboBox]** ComboBox now shows a default placeholder "Please choose..."

More version history will be reverse engineered later, this already took some time...
