@likable-hair/svelte 4.0.40 → 4.0.42

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 (27) hide show
  1. package/dist/components/composed/common/MenuOrDrawer.svelte +19 -17
  2. package/dist/components/composed/common/MenuOrDrawer.svelte.d.ts +3 -16
  3. package/dist/components/composed/common/MenuOrDrawerOptions.svelte +21 -13
  4. package/dist/components/composed/common/QuickActions.svelte +9 -5
  5. package/dist/components/composed/forms/AsyncAutocomplete.svelte.d.ts +1 -1
  6. package/dist/components/composed/list/DynamicTable.svelte +357 -330
  7. package/dist/components/composed/list/DynamicTable.svelte.d.ts +9 -0
  8. package/dist/components/composed/list/PaginatedTable.svelte +5 -1
  9. package/dist/components/composed/list/PaginatedTable.svelte.d.ts +2 -0
  10. package/dist/components/composed/progress/HorizontalStackedProgress.css +4 -0
  11. package/dist/components/composed/progress/HorizontalStackedProgress.svelte +18 -6
  12. package/dist/components/composed/progress/HorizontalStackedProgress.svelte.d.ts +1 -0
  13. package/dist/components/composed/search/DynamicFilters.svelte +2 -3
  14. package/dist/components/composed/search/FilterEditor.svelte +4 -0
  15. package/dist/components/composed/search/Filters.svelte +3 -1
  16. package/dist/components/simple/common/Menu.svelte +119 -0
  17. package/dist/components/simple/common/Menu.svelte.d.ts +1 -1
  18. package/dist/components/simple/common/VerticalDraggableList.svelte +1 -1
  19. package/dist/components/simple/common/VerticalDraggableList.svelte.d.ts +37 -20
  20. package/dist/components/simple/forms/Autocomplete.svelte +12 -7
  21. package/dist/components/simple/forms/Autocomplete.svelte.d.ts +2 -2
  22. package/dist/components/simple/forms/Checkbox.svelte +2 -1
  23. package/dist/components/simple/forms/Checkbox.svelte.d.ts +2 -1
  24. package/dist/components/simple/notifiers/AlertBanner.css +1 -0
  25. package/dist/components/simple/notifiers/AlertBanner.svelte +7 -7
  26. package/package.json +1 -1
  27. package/dist/components/composed/common/MenuOrDrawerOptions.svelte.d.ts +0 -26
@@ -21,6 +21,7 @@ import Switch from "../../simple/forms/Switch.svelte";
21
21
  import CircularLoader from "../../simple/loaders/CircularLoader.svelte";
22
22
  import NoData from "../../simple/common/NoData.svelte";
23
23
  import SearchBar from "../search/SearchBar.svelte";
24
+ import MenuOrDrawer from "../common/MenuOrDrawer.svelte";
24
25
  onMount(() => {
25
26
  updateHeaderHeight();
26
27
  window.addEventListener('resize', updateHeaderHeight);
@@ -95,7 +96,7 @@ const [send, receive] = crossfade({
95
96
  },
96
97
  });
97
98
  let { headers = [], headersToShowInTable = headers, subHeaders = [], customizeHeaders = false, rows = [], sortedBy = $bindable(), sortDirection = $bindable("asc"), cellEdit = false, lang = "en", dateLocale, noItemsText = lang == 'en' ? "No items to show" : 'Nessun elemento da visualizzare', showSelect = false, showActions = true, selectMode = "single", selectedItems = $bindable([]), unselectedItems = $bindable([]), selectedAll = $bindable(false), showExpand = false, loading = false, disabled = false, filters = $bindable([]), searchBarColumns, searchBarVisible = false, searchBarPlaceholder = lang == 'en' ? "Type to search..." : "Scrivi per cercare...", filtersVisible = false, quickFiltersVisible = false, editFilterMode = "one-edit", showActiveFilters = true, quickFilters = [], actionsForSelectedItems = [], quickActionsDisabled = false, totalRows = rows.length, searchText = $bindable(), renderedRowsNumber = 100, sectionRowsNumber = 20, sectionThreshold = 2, backwardThresholdPixel = 100, forwardThresholdPixel = 100, uniqueKey = 'id', numberOfResultsVisible = false, endLineVisible = false, resizableColumns = false, resizedColumnSizeWithPadding = $bindable({}), dynamicFilters = true, useSelectedItemsOnly = false, selectedAllDisabled = false, class: clazz = {}, onapplyCustomQuickFilter, oncellClick, onfetchData, onfiltersChange, onsort, onremoveAllFilters, onremoveCustomQuickFilter, onremoveFilter, onrowClick, onsaveCellEdit, onsaveHeadersToShow, oncolumnResize, searchBarSnippet, customFilterChipSnippet, customFilterSnippet, filterAppendSnippet, onscroll, selectionSnippet: selectionInternalSnippet, itemLabelSnippet: itemLabelInternalSnippet, chipLabelSnippet, headerSnippet, headerLabelSnippet, rowAppendSnippet, customRowSnippet, subRowAppendSnippet, subHeaderLabelSnippet, subHeaderSnippet, subRowActionsSnippet, customSubRowSnippet, customQuickFilterSnippet, appendSnippet, } = $props();
98
- let openCellEditor = $state(false), cellEditorActivator = $state(), cellEditorContainer = $state(), menuElementCellEditor = $state(), menuElementQuickFilters = $state(), cellEditorInfoActive = $state(), saveEditDisabled = $state(false), searchBarInput = $state(undefined), openQuickFilter = $state(false), quickFilterActivator = $state(), quickFilterActive = $state(), globalBuilder = new FilterBuilder(), calendarOpened = $state(false), calendarOpened2 = $state(false), selectedIndexes = [], cellEditorIndexRow = $state(), cellEditorIndexHeader = $state(), cellEditorSubItem = $state(), currentSectionNumber = $state(0), tableBody = $state(), tableContainer = $state(), tableHTML = $state(), headersHTML = $state({}), userScrolling = $state(true), reachedBottom = $state(false), reachedTop = false, resizing = false, remainingWidth = $state(0), hideScrollbar = $state(false), sortModify, mainHeader = $state(), resizeObserver, ignoreSelectAll = rows.length == totalRows && useSelectedItemsOnly;
99
+ let openCellEditor = $state(false), cellEditorActivator = $state(), cellEditorContainer = $state(), cellEditorInfoActive = $state(), saveEditDisabled = $state(false), searchBarInput = $state(undefined), openQuickFilter = $state(false), quickFilterActivator = $state(), quickFilterActive = $state(), globalBuilder = new FilterBuilder(), calendarOpened = $state(false), calendarOpened2 = $state(false), selectedIndexes = [], cellEditorIndexRow = $state(), cellEditorIndexHeader = $state(), cellEditorSubItem = $state(), currentSectionNumber = $state(0), tableBody = $state(), tableContainer = $state(), tableHTML = $state(), headersHTML = $state({}), userScrolling = $state(true), reachedBottom = $state(false), reachedTop = false, resizing = false, remainingWidth = $state(0), hideScrollbar = $state(false), sortModify, mainHeader = $state(), resizeObserver, ignoreSelectAll = rows.length == totalRows && useSelectedItemsOnly;
99
100
  const DEFAULT_MIN_WIDTH_PX = 100, DEFAULT_MAX_WIDTH_PX = 400;
100
101
  let totalSections = $derived((totalRows - renderedRowsNumber) / sectionRowsNumber);
101
102
  let hasMoreToRender = $derived(totalSections > currentSectionNumber);
@@ -110,12 +111,14 @@ let openHeaderDrawer = $state(false), headersToSelect = $state(!!headers
110
111
  return {
111
112
  id: h.value,
112
113
  name: h.label,
114
+ icon: h.icon
113
115
  };
114
116
  })
115
117
  : []), headersToShow = $state(headersToShowInTable.map((h) => {
116
118
  return {
117
119
  id: h.value,
118
120
  name: h.label,
121
+ icon: h.icon
119
122
  };
120
123
  })), infoActivators = $state(Array(headersToShowInTable.length));
121
124
  let totalBatchLength = $state(0), expandedRows = $state([]);
@@ -170,6 +173,7 @@ function handleCellClick(mouseEvent, item, cellEditorInfo, value, indexRow, inde
170
173
  if (disabled || loading)
171
174
  return;
172
175
  if (cellEdit && cellEditorInfo && !item.disableEdit) {
176
+ mouseEvent.stopPropagation();
173
177
  if (!cellEditorActivator) {
174
178
  let target = mouseEvent.target;
175
179
  cellEditorActivator = target;
@@ -1247,6 +1251,7 @@ function resizeHeader(th, header) {
1247
1251
  ) != -1
1248
1252
  }
1249
1253
  disabled={disabled || loading}
1254
+ onclick={e => e.stopPropagation()}
1250
1255
  onchange={(e) => handleSelect(row.item, e.detail.shiftKeyPressed)}
1251
1256
  />
1252
1257
  </td>
@@ -1260,7 +1265,10 @@ function resizeHeader(th, header) {
1260
1265
  ? "mdi-chevron-down"
1261
1266
  : "mdi-chevron-up"}
1262
1267
  --icon-size="24px"
1263
- onclick={() => expandRow(row)}
1268
+ onclick={e => {
1269
+ e?.stopPropagation()
1270
+ expandRow(row)
1271
+ }}
1264
1272
  />
1265
1273
  </td>
1266
1274
  {/if}
@@ -1441,345 +1449,361 @@ function resizeHeader(th, header) {
1441
1449
  {/if}
1442
1450
  </div>
1443
1451
  {/if}
1444
- {#if cellEditorInfoActive}
1445
- <Menu
1446
- bind:open={openCellEditor}
1447
- activator={cellEditorActivator}
1448
- bind:menuElement={menuElementCellEditor}
1449
- _top={undefined}
1450
- openingId="cell-editor"
1451
- >
1452
- <div
1453
- class="cell-editor-container"
1454
- bind:this={cellEditorContainer}
1455
- >
1456
- <div style:grid-column="1 / 3">
1457
- {#if cellEditorInfoActive.type.key === "string"}
1458
- <LabelAndTextField
1459
- label={cellEditorInfoActive.title}
1460
- description={cellEditorInfoActive.description}
1461
- name={cellEditorInfoActive.title}
1462
- info={cellEditorInfoActive.info}
1463
- type="text"
1464
- orientation="horizontal"
1465
- bind:value={cellEditorInfoActive.value}
1466
- --simple-textfield-border-radius= 0.5rem
1467
- --simple-textfield-background-color= transparent
1468
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1469
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1470
- />
1471
- {:else if cellEditorInfoActive.type.key === "number"}
1472
- <LabelAndTextField
1473
- label={cellEditorInfoActive.title}
1474
- description={cellEditorInfoActive.description}
1475
- name={cellEditorInfoActive.title}
1476
- info={cellEditorInfoActive.info}
1477
- type="number"
1478
- orientation="horizontal"
1479
- error={saveEditDisabled}
1480
- bind:value={cellEditorInfoActive.value}
1481
- --simple-textfield-border-radius= 0.5rem
1482
- --simple-textfield-background-color= transparent
1483
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1484
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1485
- />
1486
- {:else if cellEditorInfoActive.type.key === "select"}
1487
- <LabelAndSelect
1488
- label={cellEditorInfoActive.title}
1489
- description={cellEditorInfoActive.description}
1490
- name={cellEditorInfoActive.title}
1491
- info={cellEditorInfoActive.info}
1492
- options={cellEditorInfoActive.type.params.options}
1493
- orientation="horizontal"
1494
- bind:value={cellEditorInfoActive.value}
1495
- />
1496
- {:else if cellEditorInfoActive.type.key === "boolean"}
1497
- <div class="container">
1498
- <Checkbox
1499
- id={cellEditorInfoActive.title}
1452
+ <MenuOrDrawer
1453
+ bind:open={openCellEditor}
1454
+ menuProps={{
1455
+ activator: cellEditorActivator,
1456
+ openingId: "cell-editor",
1457
+ }}
1458
+ drawerProps={{
1459
+ _space: '60vh',
1460
+ _borderRadius: '10px',
1461
+ }}
1462
+ >
1463
+ {#snippet children({ isDrawer, isMenu, })}
1464
+ {#if cellEditorInfoActive}
1465
+ <div
1466
+ class:cell-editor-container={isMenu}
1467
+ style:padding='10px'
1468
+ bind:this={cellEditorContainer}
1469
+ >
1470
+ <div style:grid-column="1 / 3">
1471
+ {#if cellEditorInfoActive.type.key === "string"}
1472
+ <LabelAndTextField
1473
+ label={cellEditorInfoActive.title}
1474
+ description={cellEditorInfoActive.description}
1475
+ name={cellEditorInfoActive.title}
1476
+ info={cellEditorInfoActive.info}
1477
+ type="text"
1478
+ orientation="horizontal"
1500
1479
  bind:value={cellEditorInfoActive.value}
1480
+ --simple-textfield-border-radius= 0.5rem
1481
+ --simple-textfield-background-color= transparent
1482
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1483
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1501
1484
  />
1502
- <label style:margin-left="0.7rem" for={cellEditorInfoActive.title}
1503
- >{cellEditorInfoActive.title}
1504
- </label>
1505
- </div>
1506
- {/if}
1507
- </div>
1485
+ {:else if cellEditorInfoActive.type.key === "number"}
1486
+ <LabelAndTextField
1487
+ label={cellEditorInfoActive.title}
1488
+ description={cellEditorInfoActive.description}
1489
+ name={cellEditorInfoActive.title}
1490
+ info={cellEditorInfoActive.info}
1491
+ type="number"
1492
+ orientation="horizontal"
1493
+ error={saveEditDisabled}
1494
+ bind:value={cellEditorInfoActive.value}
1495
+ --simple-textfield-border-radius= 0.5rem
1496
+ --simple-textfield-background-color= transparent
1497
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1498
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1499
+ />
1500
+ {:else if cellEditorInfoActive.type.key === "select"}
1501
+ <LabelAndSelect
1502
+ label={cellEditorInfoActive.title}
1503
+ description={cellEditorInfoActive.description}
1504
+ name={cellEditorInfoActive.title}
1505
+ info={cellEditorInfoActive.info}
1506
+ options={cellEditorInfoActive.type.params.options}
1507
+ orientation="horizontal"
1508
+ bind:value={cellEditorInfoActive.value}
1509
+ />
1510
+ {:else if cellEditorInfoActive.type.key === "boolean"}
1511
+ <div class="container">
1512
+ <Checkbox
1513
+ id={cellEditorInfoActive.title}
1514
+ bind:value={cellEditorInfoActive.value}
1515
+ />
1516
+ <label style:margin-left="0.7rem" for={cellEditorInfoActive.title}
1517
+ >{cellEditorInfoActive.title}
1518
+ </label>
1519
+ </div>
1520
+ {/if}
1521
+ </div>
1508
1522
 
1509
- <div style:margin-top="10px" style:grid-row="2" style:grid-column="1 / 3">
1510
- <Divider --divider-color=rgb(var(--global-color-contrast-100) />
1511
- </div>
1512
- <div style:grid-row="3" style:grid-column="2" style:margin-top="-15px">
1513
- <ConfirmOrCancelButtons
1514
- confirmDisable={saveEditDisabled}
1515
- confirmText="Save"
1516
- cancelText="Cancel"
1517
- oncancelClick={handleCancelClick}
1518
- onconfirmClick={handleSaveClick}
1519
- />
1523
+ <div style:grid-column=2 style:margin-top="-15px">
1524
+ <ConfirmOrCancelButtons
1525
+ confirmDisable={saveEditDisabled}
1526
+ confirmText="Save"
1527
+ cancelText="Cancel"
1528
+ oncancelClick={handleCancelClick}
1529
+ onconfirmClick={handleSaveClick}
1530
+ />
1531
+ </div>
1520
1532
  </div>
1521
- </div>
1522
- </Menu>
1523
- {/if}
1533
+ {/if}
1534
+ {/snippet}
1535
+ </MenuOrDrawer>
1524
1536
 
1525
- {#if quickFilterActive}
1526
- <Menu
1527
- bind:open={openQuickFilter}
1528
- activator={quickFilterActivator}
1529
- bind:menuElement={menuElementQuickFilters}
1530
- anchor="bottom"
1531
- openingId="quick-filter"
1532
- closeOnClickOutside
1533
- >
1534
- <div
1535
- class="quick-filter-container"
1536
- >
1537
- <div style:grid-column="1 / 3">
1538
- {#if quickFilterActive.type.key == 'custom'}
1539
- {@render customQuickFilterSnippet?.({ quickFilter: quickFilterActive, setQuickFilterMissingValue })}
1540
- {:else if quickFilterActive.type.key === "string"}
1541
- <div class="space-between" style="font-weight: 500;">
1542
- {quickFilterActive.title}
1543
- {#if !!quickFilterActive.type.missingLabel}
1544
- <button
1545
- onclick={() =>
1546
- setQuickFilterMissingValue(quickFilterActive!)}
1547
- >{quickFilterActive.type.missingLabel}</button
1548
- >
1549
- {/if}
1550
- </div>
1551
- <LabelAndTextField
1552
- description={quickFilterActive.description}
1553
- name={quickFilterActive.title}
1554
- info={quickFilterActive.info}
1555
- type="text"
1556
- bind:value={quickFilterActive.type.value}
1557
- --simple-textfield-border-radius= 0.5rem
1558
- --simple-textfield-background-color= transparent
1559
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1560
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1561
- />
1562
- {:else if quickFilterActive.type.key === "number"}
1563
- <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1564
- {quickFilterActive.title}
1565
- {#if !!quickFilterActive.type.missingLabel}
1566
- <button
1567
- onclick={() =>
1568
- setQuickFilterMissingValue(quickFilterActive!)}
1569
- >{quickFilterActive.type.missingLabel}</button
1570
- >
1571
- {/if}
1572
- </div>
1573
- <LabelAndTextField
1574
- description={quickFilterActive.description}
1575
- name={quickFilterActive.title}
1576
- info={quickFilterActive.info}
1577
- type="number"
1578
- error={saveEditDisabled}
1579
- bind:value={quickFilterActive.type.value}
1580
- --simple-textfield-border-radius= 0.5rem
1581
- --simple-textfield-background-color= transparent
1582
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1583
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1584
- />
1585
- {:else if quickFilterActive.type.key === "multi-select"}
1586
- <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1587
- {quickFilterActive.title}
1588
- {#if !!quickFilterActive.type.missingLabel}
1589
- <button
1590
- onclick={() =>
1591
- setQuickFilterMissingValue(quickFilterActive!)}
1592
- >{quickFilterActive.type.missingLabel}</button
1537
+ <MenuOrDrawer
1538
+ bind:open={openQuickFilter}
1539
+ menuProps={{
1540
+ activator: quickFilterActivator,
1541
+ anchor: 'bottom',
1542
+ openingId: 'quick-filter',
1543
+ closeOnClickOutside: true
1544
+ }}
1545
+ drawerProps={{
1546
+ _space: '60vh',
1547
+ _borderRadius: '10px',
1548
+ }}
1549
+ >
1550
+ {#snippet children({ isDrawer, isMenu })}
1551
+ {#if quickFilterActive}
1552
+ <div
1553
+ class:quick-filter-container={isMenu}
1554
+ style:padding='10px'
1555
+ >
1556
+ <div style:grid-column="1 / 3">
1557
+ {#if quickFilterActive.type.key == 'custom'}
1558
+ {@render customQuickFilterSnippet?.({ quickFilter: quickFilterActive, setQuickFilterMissingValue })}
1559
+ {:else if quickFilterActive.type.key === "string"}
1560
+ <div class="space-between" style="font-weight: 500;">
1561
+ {quickFilterActive.title}
1562
+ {#if !!quickFilterActive.type.missingLabel}
1563
+ <button
1564
+ onclick={() =>
1565
+ setQuickFilterMissingValue(quickFilterActive!)}
1566
+ >{quickFilterActive.type.missingLabel}</button
1567
+ >
1568
+ {/if}
1569
+ </div>
1570
+ <LabelAndTextField
1571
+ description={quickFilterActive.description}
1572
+ name={quickFilterActive.title}
1573
+ info={quickFilterActive.info}
1574
+ type="text"
1575
+ bind:value={quickFilterActive.type.value}
1576
+ --simple-textfield-border-radius= 0.5rem
1577
+ --simple-textfield-background-color= transparent
1578
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1579
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1580
+ />
1581
+ {:else if quickFilterActive.type.key === "number"}
1582
+ <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1583
+ {quickFilterActive.title}
1584
+ {#if !!quickFilterActive.type.missingLabel}
1585
+ <button
1586
+ onclick={() =>
1587
+ setQuickFilterMissingValue(quickFilterActive!)}
1588
+ >{quickFilterActive.type.missingLabel}</button
1589
+ >
1590
+ {/if}
1591
+ </div>
1592
+ <LabelAndTextField
1593
+ description={quickFilterActive.description}
1594
+ name={quickFilterActive.title}
1595
+ info={quickFilterActive.info}
1596
+ type="number"
1597
+ error={saveEditDisabled}
1598
+ bind:value={quickFilterActive.type.value}
1599
+ --simple-textfield-border-radius= 0.5rem
1600
+ --simple-textfield-background-color= transparent
1601
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1602
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1603
+ />
1604
+ {:else if quickFilterActive.type.key === "multi-select"}
1605
+ <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1606
+ {quickFilterActive.title}
1607
+ {#if !!quickFilterActive.type.missingLabel}
1608
+ <button
1609
+ onclick={() =>
1610
+ setQuickFilterMissingValue(quickFilterActive!)}
1611
+ >{quickFilterActive.type.missingLabel}</button
1612
+ >
1613
+ {/if}
1614
+ </div>
1615
+ <div onclick={e => e.stopPropagation()} role="presentation" tabindex="-1">
1616
+ <Autocomplete
1617
+ multiple
1618
+ items={quickFilterActive.type.items}
1619
+ bind:values={quickFilterActive.type.values}
1620
+ mobileDrawer={isDrawer}
1621
+ --autocomplete-border-radius= 0.5rem
1622
+ --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
1623
+ --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
1593
1624
  >
1594
- {/if}
1595
- </div>
1596
- <div onclick={e => e.stopPropagation()} role="presentation" tabindex="-1">
1597
- <Autocomplete
1598
- multiple
1599
- items={quickFilterActive.type.items}
1600
- bind:values={quickFilterActive.type.values}
1601
- --autocomplete-border-radius= 0.5rem
1602
- --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
1603
- --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
1604
- >
1605
- {#snippet selectionSnippet({ selection, unselect })}
1606
- {#if selectionInternalSnippet}
1607
- {@render selectionInternalSnippet({ selection, unselect })}
1608
- {:else}
1609
- <div tabindex="-1">
1610
- <Chip
1611
- close={true}
1612
- onclose={() => unselect(selection)}
1613
- --chip-default-border-radius="var(--autocomplete-border-radius, var(--autocomplete-default-border-radius))"
1614
- buttonTabIndex={-1}
1615
- truncateText
1616
- >
1617
- {#if chipLabelSnippet}
1618
- {@render chipLabelSnippet({ selection })}
1619
- {:else}
1620
- {#if quickFilterActive!.type.key == 'multi-select' && !!quickFilterActive!.type.countriesAlpha2 && quickFilterActive!.type.countriesAlpha2.find((c) => c.value == selection.value)}
1621
- <div>
1622
- <FlagIcon
1623
- alpha2={quickFilterActive!.type.countriesAlpha2
1624
- .find((c) => c.value == selection.value)
1625
- ?.label?.toString()
1626
- .toLowerCase() ?? ""}
1627
- --flag-icon-size="16px"
1628
- />
1629
- </div>
1625
+ {#snippet selectionSnippet({ selection, unselect })}
1626
+ {#if selectionInternalSnippet}
1627
+ {@render selectionInternalSnippet({ selection, unselect })}
1628
+ {:else}
1629
+ <div tabindex="-1">
1630
+ <Chip
1631
+ close={true}
1632
+ onclose={() => unselect(selection)}
1633
+ --chip-default-border-radius="var(--autocomplete-border-radius, var(--autocomplete-default-border-radius))"
1634
+ buttonTabIndex={-1}
1635
+ truncateText
1636
+ >
1637
+ {#if chipLabelSnippet}
1638
+ {@render chipLabelSnippet({ selection })}
1639
+ {:else}
1640
+ {#if quickFilterActive!.type.key == 'multi-select' && !!quickFilterActive!.type.countriesAlpha2 && quickFilterActive!.type.countriesAlpha2.find((c) => c.value == selection.value)}
1641
+ <div>
1642
+ <FlagIcon
1643
+ alpha2={quickFilterActive!.type.countriesAlpha2
1644
+ .find((c) => c.value == selection.value)
1645
+ ?.label?.toString()
1646
+ .toLowerCase() ?? ""}
1647
+ --flag-icon-size="16px"
1648
+ />
1649
+ </div>
1650
+ {/if}
1651
+ {selection.label}
1630
1652
  {/if}
1631
- {selection.label}
1632
- {/if}
1633
- </Chip>
1634
- </div>
1635
- {/if}
1636
- {/snippet}
1637
- {#snippet itemLabelSnippet({ item })}
1638
- {#if itemLabelInternalSnippet}
1639
- {@render itemLabelInternalSnippet({ item })}
1640
- {:else}
1641
- {#if quickFilterActive!.type.key == 'multi-select' && !!quickFilterActive!.type.countriesAlpha2 && quickFilterActive!.type.countriesAlpha2.find((c) => c.value == item.value)}
1642
- <FlagIcon
1643
- alpha2={quickFilterActive!.type.countriesAlpha2
1644
- .find((c) => c.value == item.value)
1645
- ?.label?.toString()
1646
- .toLowerCase() ?? ""}
1647
- />
1653
+ </Chip>
1654
+ </div>
1648
1655
  {/if}
1649
- {item.label}
1650
- {/if}
1651
- {/snippet}
1652
- </Autocomplete>
1653
- </div>
1654
- {:else if quickFilterActive.type.key === "boolean"}
1655
- {#if quickFilterActive.type.params}
1656
- <div class="vertical-quick-filters">
1657
- <button
1658
- onclick={() => setQuickFilterValue(quickFilterActive!, true)}
1659
- >
1660
- {quickFilterActive.type.params.labelTrue}
1661
- </button>
1662
- <button
1663
- onclick={() => setQuickFilterValue(quickFilterActive!, false)}
1664
- >
1665
- {quickFilterActive.type.params.labelFalse}
1666
- </button>
1667
- <button
1668
- onclick={() => setQuickFilterValue(quickFilterActive!, undefined)}
1669
- >
1670
- {lang == 'en' ? 'All' : 'Tutti'}
1671
- </button>
1656
+ {/snippet}
1657
+ {#snippet itemLabelSnippet({ item })}
1658
+ {#if itemLabelInternalSnippet}
1659
+ {@render itemLabelInternalSnippet({ item })}
1660
+ {:else}
1661
+ {#if quickFilterActive!.type.key == 'multi-select' && !!quickFilterActive!.type.countriesAlpha2 && quickFilterActive!.type.countriesAlpha2.find((c) => c.value == item.value)}
1662
+ <FlagIcon
1663
+ alpha2={quickFilterActive!.type.countriesAlpha2
1664
+ .find((c) => c.value == item.value)
1665
+ ?.label?.toString()
1666
+ .toLowerCase() ?? ""}
1667
+ />
1668
+ {/if}
1669
+ {item.label}
1670
+ {/if}
1671
+ {/snippet}
1672
+ </Autocomplete>
1672
1673
  </div>
1673
- {/if}
1674
- {:else if quickFilterActive.type.key === "country"}
1675
- <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1676
- {quickFilterActive.title}
1677
- {#if !!quickFilterActive.type.missingLabel}
1678
- <button
1679
- onclick={() =>
1680
- setQuickFilterMissingValue(quickFilterActive!)}
1681
- >{quickFilterActive.type.missingLabel}</button
1682
- >
1674
+ {:else if quickFilterActive.type.key === "boolean"}
1675
+ {#if quickFilterActive.type.params}
1676
+ <div class="vertical-quick-filters">
1677
+ <button
1678
+ onclick={() => setQuickFilterValue(quickFilterActive!, true)}
1679
+ >
1680
+ {quickFilterActive.type.params.labelTrue}
1681
+ </button>
1682
+ <button
1683
+ onclick={() => setQuickFilterValue(quickFilterActive!, false)}
1684
+ >
1685
+ {quickFilterActive.type.params.labelFalse}
1686
+ </button>
1687
+ <button
1688
+ onclick={() => setQuickFilterValue(quickFilterActive!, undefined)}
1689
+ >
1690
+ {lang == 'en' ? 'All' : 'Tutti'}
1691
+ </button>
1692
+ </div>
1683
1693
  {/if}
1684
- </div>
1685
- <div onclick={e => e.stopPropagation()} role="presentation" tabindex="-1">
1686
- <CountriesAutocomplete
1687
- bind:selected={quickFilterActive.type.selected}
1688
- {...((!!quickFilterActive.type.countriesOptions && quickFilterActive.type.countriesOptions.length > 0) && {
1689
- items: quickFilterActive.type.countriesOptions,
1690
- })}
1691
- autocompleteProps={{
1692
- placeholder: !!quickFilterActive.type.selected
1693
- ? quickFilterActive.type.selected.length > 0
1694
- ? ""
1695
- : quickFilterActive.description
1696
- : quickFilterActive.description,
1697
- multiple: true,
1698
- }}
1699
- --autocomplete-border-radius= 0.5rem
1700
- --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
1701
- --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
1702
- />
1703
- </div>
1704
- {:else if quickFilterActive.type.key === "date"}
1705
- <div style="font-weight: 500; margin-bottom: 8px;">
1706
- {quickFilterActive.title}
1707
- </div>
1708
- <div onclick={e => e.stopPropagation()} role="presentation" tabindex="-1">
1709
- <div>
1710
- <DatePickerTextField
1711
- bind:selectedDate={quickFilterActive.type.from}
1712
- placeholder={lang == 'en' ? "From" : 'Da'}
1713
- --simple-textfield-width="100%"
1714
- --simple-textfield-border-radius= 0.5rem
1715
- --simple-textfield-background-color= transparent
1716
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1717
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1718
- flipOnOverflow
1719
- bind:menuOpened={calendarOpened}
1720
- ondayClick={() => (calendarOpened = false)}
1721
- >
1722
- {#snippet appendInnerSnippet({ appendInnerIcon, iconSize })}
1723
- <Icon
1724
- name="mdi-close-circle"
1725
- onclick={() => {
1726
- if (
1727
- !!quickFilterActive &&
1728
- quickFilterActive.type.key === "date"
1729
- ) {
1730
- quickFilterActive.type.from = undefined;
1731
- }
1732
- }}
1733
- />
1734
- {/snippet}
1735
- </DatePickerTextField>
1694
+ {:else if quickFilterActive.type.key === "country"}
1695
+ <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1696
+ {quickFilterActive.title}
1697
+ {#if !!quickFilterActive.type.missingLabel}
1698
+ <button
1699
+ onclick={() =>
1700
+ setQuickFilterMissingValue(quickFilterActive!)}
1701
+ >{quickFilterActive.type.missingLabel}</button
1702
+ >
1703
+ {/if}
1736
1704
  </div>
1737
- <div>
1738
- <DatePickerTextField
1739
- bind:selectedDate={quickFilterActive.type.to}
1740
- placeholder={lang == 'en' ? "To" : 'A'}
1741
- --simple-textfield-width="100%"
1742
- --simple-textfield-border-radius= 0.5rem
1743
- --simple-textfield-background-color= transparent
1744
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1745
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1746
- flipOnOverflow
1747
- bind:menuOpened={calendarOpened2}
1748
- ondayClick={() => (calendarOpened2 = false)}
1749
- >
1750
- {#snippet appendInnerSnippet({ appendInnerIcon, iconSize })}
1751
- <Icon
1752
- name="mdi-close-circle"
1753
- onclick={() => {
1754
- if (
1755
- !!quickFilterActive &&
1756
- quickFilterActive.type.key === "date"
1757
- ) {
1758
- quickFilterActive.type.to = undefined;
1759
- }
1760
- }}
1761
- />
1762
- {/snippet}
1763
- </DatePickerTextField>
1705
+ <div onclick={e => e.stopPropagation()} role="presentation" tabindex="-1">
1706
+ <CountriesAutocomplete
1707
+ bind:selected={quickFilterActive.type.selected}
1708
+ {...((!!quickFilterActive.type.countriesOptions && quickFilterActive.type.countriesOptions.length > 0) && {
1709
+ items: quickFilterActive.type.countriesOptions,
1710
+ })}
1711
+ autocompleteProps={{
1712
+ placeholder: !!quickFilterActive.type.selected
1713
+ ? quickFilterActive.type.selected.length > 0
1714
+ ? ""
1715
+ : quickFilterActive.description
1716
+ : quickFilterActive.description,
1717
+ multiple: true,
1718
+ mobileDrawer: isDrawer,
1719
+ }}
1720
+ --autocomplete-border-radius= 0.5rem
1721
+ --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
1722
+ --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
1723
+ />
1724
+ </div>
1725
+ {:else if quickFilterActive.type.key === "date"}
1726
+ <div style="font-weight: 500; margin-bottom: 8px;">
1727
+ {quickFilterActive.title}
1728
+ </div>
1729
+ <div onclick={e => e.stopPropagation()} role="presentation" tabindex="-1">
1730
+ <div>
1731
+ <DatePickerTextField
1732
+ bind:selectedDate={quickFilterActive.type.from}
1733
+ placeholder={lang == 'en' ? "From" : 'Da'}
1734
+ --simple-textfield-width="100%"
1735
+ --simple-textfield-border-radius= 0.5rem
1736
+ --simple-textfield-background-color= transparent
1737
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1738
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1739
+ flipOnOverflow
1740
+ mobileDialog={isDrawer}
1741
+ bind:menuOpened={calendarOpened}
1742
+ ondayClick={() => (calendarOpened = false)}
1743
+ >
1744
+ {#snippet appendInnerSnippet({ appendInnerIcon, iconSize })}
1745
+ <Icon
1746
+ name="mdi-close-circle"
1747
+ onclick={() => {
1748
+ if (
1749
+ !!quickFilterActive &&
1750
+ quickFilterActive.type.key === "date"
1751
+ ) {
1752
+ quickFilterActive.type.from = undefined;
1753
+ }
1754
+ }}
1755
+ />
1756
+ {/snippet}
1757
+ </DatePickerTextField>
1758
+ </div>
1759
+ <div>
1760
+ <DatePickerTextField
1761
+ bind:selectedDate={quickFilterActive.type.to}
1762
+ placeholder={lang == 'en' ? "To" : 'A'}
1763
+ --simple-textfield-width="100%"
1764
+ --simple-textfield-border-radius= 0.5rem
1765
+ --simple-textfield-background-color= transparent
1766
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1767
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1768
+ flipOnOverflow
1769
+ mobileDialog={isDrawer}
1770
+ bind:menuOpened={calendarOpened2}
1771
+ ondayClick={() => (calendarOpened2 = false)}
1772
+ >
1773
+ {#snippet appendInnerSnippet({ appendInnerIcon, iconSize })}
1774
+ <Icon
1775
+ name="mdi-close-circle"
1776
+ onclick={() => {
1777
+ if (
1778
+ !!quickFilterActive &&
1779
+ quickFilterActive.type.key === "date"
1780
+ ) {
1781
+ quickFilterActive.type.to = undefined;
1782
+ }
1783
+ }}
1784
+ />
1785
+ {/snippet}
1786
+ </DatePickerTextField>
1787
+ </div>
1764
1788
  </div>
1789
+ {/if}
1790
+ </div>
1791
+
1792
+ {#if quickFilterActive.type.key != "boolean"}
1793
+ <div style:grid-column=2 style:margin-top="-10px">
1794
+ <ConfirmOrCancelButtons
1795
+ confirmDisable={saveEditDisabled}
1796
+ confirmText={lang == 'en' ? "Apply" : 'Applica'}
1797
+ cancelText={lang == 'en' ? "Cancel" : 'Annulla'}
1798
+ oncancelClick={handleCancelClick}
1799
+ onconfirmClick={() => handleApplyClick(quickFilterActive!, quickFilterActive!.type.key == 'custom')}
1800
+ />
1765
1801
  </div>
1766
1802
  {/if}
1767
1803
  </div>
1768
-
1769
- {#if quickFilterActive.type.key != "boolean"}
1770
- <div style:grid-row="3" style:grid-column="2" style:margin-top="-10px">
1771
- <ConfirmOrCancelButtons
1772
- confirmDisable={saveEditDisabled}
1773
- confirmText={lang == 'en' ? "Apply" : 'Applica'}
1774
- cancelText={lang == 'en' ? "Cancel" : 'Annulla'}
1775
- oncancelClick={handleCancelClick}
1776
- onconfirmClick={() => handleApplyClick(quickFilterActive!, quickFilterActive!.type.key == 'custom')}
1777
- />
1778
- </div>
1779
- {/if}
1780
- </div>
1781
- </Menu>
1782
- {/if}
1804
+ {/if}
1805
+ {/snippet}
1806
+ </MenuOrDrawer>
1783
1807
 
1784
1808
  <MediaQuery>
1785
1809
  {#snippet defaultSnippet({ sAndDown })}
@@ -1807,6 +1831,9 @@ function resizeHeader(th, header) {
1807
1831
  <div
1808
1832
  style:flex-grow=1
1809
1833
  >
1834
+ {#if !!item.icon}
1835
+ <Icon name={item.icon} />
1836
+ {/if}
1810
1837
  {item.name}
1811
1838
  </div>
1812
1839
  <Switch
@@ -1839,6 +1866,9 @@ function resizeHeader(th, header) {
1839
1866
  <div
1840
1867
  style:flex-grow=1
1841
1868
  >
1869
+ {#if !!header.icon}
1870
+ <Icon name={header.icon} />
1871
+ {/if}
1842
1872
  {header.name}
1843
1873
  </div>
1844
1874
  <Switch
@@ -2053,14 +2083,12 @@ function resizeHeader(th, header) {
2053
2083
  align-items: center;
2054
2084
  box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
2055
2085
  position: fixed;
2056
- padding: 10px;
2057
2086
  border-radius: 10px;
2058
2087
  background-color: var(
2059
2088
  --dynamic-table-cell-editor-background-color,
2060
2089
  var(--dynamic-table-default-cell-editor-background-color)
2061
2090
  );
2062
- height: 200px;
2063
- width: 500px;
2091
+ width: 400px;
2064
2092
  }
2065
2093
 
2066
2094
  .row-activator {
@@ -2077,7 +2105,6 @@ function resizeHeader(th, header) {
2077
2105
  align-items: center;
2078
2106
  box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
2079
2107
  position: fixed;
2080
- padding: 10px;
2081
2108
  border-radius: 10px;
2082
2109
  background-color: var(
2083
2110
  --dynamic-table-quick-filter-background-color,