@likable-hair/svelte 3.3.29 → 3.3.31

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 (23) hide show
  1. package/dist/components/composed/common/MenuOrDrawer.svelte +24 -27
  2. package/dist/components/composed/common/MenuOrDrawer.svelte.d.ts +2 -13
  3. package/dist/components/composed/common/MenuOrDrawerOptions.svelte +25 -22
  4. package/dist/components/composed/common/MenuOrDrawerOptions.svelte.d.ts +2 -12
  5. package/dist/components/composed/common/QuickActions.svelte +41 -33
  6. package/dist/components/composed/list/DynamicTable.css +10 -8
  7. package/dist/components/composed/list/DynamicTable.svelte +373 -342
  8. package/dist/components/composed/list/PaginatedTable.svelte +19 -10
  9. package/dist/components/composed/list/PaginatedTable.svelte.d.ts +3 -0
  10. package/dist/components/composed/progress/HorizontalStackedProgress.css +4 -0
  11. package/dist/components/composed/progress/HorizontalStackedProgress.svelte +19 -6
  12. package/dist/components/composed/progress/HorizontalStackedProgress.svelte.d.ts +1 -0
  13. package/dist/components/composed/search/DynamicFilters.svelte +3 -4
  14. package/dist/components/composed/search/FilterEditor.svelte +3 -0
  15. package/dist/components/composed/search/Filters.svelte +3 -1
  16. package/dist/components/simple/common/Menu.svelte +137 -1
  17. package/dist/components/simple/common/Menu.svelte.d.ts +1 -1
  18. package/dist/components/simple/forms/Autocomplete.svelte +8 -6
  19. package/dist/components/simple/forms/Checkbox.svelte +1 -0
  20. package/dist/components/simple/forms/Checkbox.svelte.d.ts +1 -0
  21. package/dist/components/simple/notifiers/AlertBanner.css +1 -0
  22. package/dist/components/simple/notifiers/AlertBanner.svelte +5 -5
  23. package/package.json +1 -1
@@ -36,6 +36,7 @@
36
36
  import type { QuickFilter } from "../../../utils/filters/quickFilters";
37
37
  import Switch from "../../simple/forms/Switch.svelte";
38
38
  import CircularLoader from "../../simple/loaders/CircularLoader.svelte";
39
+ import MenuOrDrawer from "../common/MenuOrDrawer.svelte";
39
40
 
40
41
  onMount(() => {
41
42
  updateHeaderHeight();
@@ -275,8 +276,6 @@
275
276
  let openCellEditor: boolean = false,
276
277
  cellEditorActivator: HTMLElement | undefined,
277
278
  cellEditorContainer: HTMLElement | undefined,
278
- menuElementCellEditor: HTMLElement,
279
- menuElementQuickFilters: HTMLElement,
280
279
  cellEditorInfoActive: CellEditorInfo & {
281
280
  value?: any;
282
281
  item?: Item;
@@ -397,6 +396,7 @@
397
396
  ) {
398
397
  if (disabled || loading) return;
399
398
  if (cellEdit && cellEditorInfo && !item.disableEdit) {
399
+ mouseEvent.stopPropagation()
400
400
  if (!cellEditorActivator) {
401
401
  let target = mouseEvent.target as unknown as HTMLElement;
402
402
  cellEditorActivator = target;
@@ -1359,10 +1359,15 @@
1359
1359
  {#if !loading}
1360
1360
  {totalRows || rows.length}
1361
1361
  {:else}
1362
- <CircularLoader
1363
- {loading}
1364
- --circular-loader-height='10px'
1365
- ></CircularLoader>
1362
+ <div
1363
+ style:display=flex
1364
+ style:align-items=center
1365
+ >
1366
+ <CircularLoader
1367
+ {loading}
1368
+ --circular-loader-height='10px'
1369
+ ></CircularLoader>
1370
+ </div>
1366
1371
  {/if}
1367
1372
  </div>
1368
1373
  {/if}
@@ -1426,24 +1431,10 @@
1426
1431
  {#if !!head.info}
1427
1432
  <Icon
1428
1433
  name="mdi-help-circle-outline"
1429
- --icon-size="16px"
1434
+ --icon-size="14px"
1430
1435
  />
1431
1436
  {/if}
1432
1437
  </span>
1433
- {#if !!head.info}
1434
- <ToolTip
1435
- appearTimeout={1000}
1436
- activator={infoActivators[index]}
1437
- >
1438
- <div
1439
- style:background-color='rgb(var(--global-color-background-300), .95)'
1440
- style:border-radius="5px"
1441
- style:padding="10px"
1442
- >
1443
- {head.info}
1444
- </div>
1445
- </ToolTip>
1446
- {/if}
1447
1438
  {#if head.sortable}
1448
1439
  <span
1449
1440
  class="header-sort-icon"
@@ -1460,6 +1451,20 @@
1460
1451
  {/if}
1461
1452
  </slot>
1462
1453
  </th>
1454
+ {#if !!head.info}
1455
+ <ToolTip
1456
+ appearTimeout={1000}
1457
+ activator={infoActivators[index]}
1458
+ >
1459
+ <div
1460
+ style:background-color='rgb(var(--global-color-background-300), .95)'
1461
+ style:border-radius="5px"
1462
+ style:padding="10px"
1463
+ >
1464
+ {head.info}
1465
+ </div>
1466
+ </ToolTip>
1467
+ {/if}
1463
1468
  {/each}
1464
1469
  {#if remainingWidth}
1465
1470
  <th
@@ -1556,6 +1561,7 @@
1556
1561
  ) != -1
1557
1562
  }
1558
1563
  disabled={disabled || loading}
1564
+ on:click={e => e.stopPropagation()}
1559
1565
  on:change={(e) => handleSelect(row.item, e.detail.shiftKeyPressed)}
1560
1566
  />
1561
1567
  </td>
@@ -1570,7 +1576,10 @@
1570
1576
  : "mdi-chevron-up"}
1571
1577
  click
1572
1578
  --icon-size="24px"
1573
- on:click={() => expandRow(row)}
1579
+ on:click={e => {
1580
+ e?.stopPropagation()
1581
+ expandRow(row)
1582
+ }}
1574
1583
  />
1575
1584
  </td>
1576
1585
  {/if}
@@ -1771,338 +1780,357 @@
1771
1780
  </div>
1772
1781
  {/if}
1773
1782
 
1774
- <Menu
1783
+ <MenuOrDrawer
1775
1784
  bind:open={openCellEditor}
1776
- activator={cellEditorActivator}
1777
- bind:menuElement={menuElementCellEditor}
1778
- _top={undefined}
1779
- openingId="cell-editor"
1785
+ menuProps={{
1786
+ activator: cellEditorActivator,
1787
+ openingId: "cell-editor",
1788
+ }}
1789
+ drawerProps={{
1790
+ _space: '60vh',
1791
+ _borderRadius: '10px',
1792
+ }}
1793
+ let:isMenu
1780
1794
  >
1781
- <div
1782
- class="cell-editor-container"
1783
- bind:this={cellEditorContainer}
1784
- >
1785
- <div style:grid-column="1 / 3">
1786
- {#if cellEditorInfoActive.type.key === "string"}
1787
- <LabelAndTextField
1788
- label={cellEditorInfoActive.title}
1789
- description={cellEditorInfoActive.description}
1790
- name={cellEditorInfoActive.title}
1791
- info={cellEditorInfoActive.info}
1792
- type="text"
1793
- orientation="horizontal"
1794
- bind:value={cellEditorInfoActive.value}
1795
- --simple-textfield-border-radius= 0.5rem
1796
- --simple-textfield-background-color= transparent
1797
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1798
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1799
- />
1800
- {:else if cellEditorInfoActive.type.key === "number"}
1801
- <LabelAndTextField
1802
- label={cellEditorInfoActive.title}
1803
- description={cellEditorInfoActive.description}
1804
- name={cellEditorInfoActive.title}
1805
- info={cellEditorInfoActive.info}
1806
- type="number"
1807
- orientation="horizontal"
1808
- error={saveEditDisabled}
1809
- bind:value={cellEditorInfoActive.value}
1810
- --simple-textfield-border-radius= 0.5rem
1811
- --simple-textfield-background-color= transparent
1812
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1813
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1814
- />
1815
- {:else if cellEditorInfoActive.type.key === "select"}
1816
- <LabelAndSelect
1817
- label={cellEditorInfoActive.title}
1818
- description={cellEditorInfoActive.description}
1819
- name={cellEditorInfoActive.title}
1820
- info={cellEditorInfoActive.info}
1821
- options={cellEditorInfoActive.type.params.options}
1822
- orientation="horizontal"
1823
- bind:value={cellEditorInfoActive.value}
1824
- />
1825
- {:else if cellEditorInfoActive.type.key === "boolean"}
1826
- <div class="container">
1827
- <Checkbox
1828
- id={cellEditorInfoActive.title}
1795
+ {#if cellEditorInfoActive}
1796
+ <div
1797
+ class:cell-editor-container={isMenu}
1798
+ style:padding='10px'
1799
+ bind:this={cellEditorContainer}
1800
+ >
1801
+ <div style:grid-column="1 / 3">
1802
+ {#if cellEditorInfoActive.type.key === "string"}
1803
+ <LabelAndTextField
1804
+ label={cellEditorInfoActive.title}
1805
+ description={cellEditorInfoActive.description}
1806
+ name={cellEditorInfoActive.title}
1807
+ info={cellEditorInfoActive.info}
1808
+ type="text"
1809
+ orientation="horizontal"
1829
1810
  bind:value={cellEditorInfoActive.value}
1811
+ --simple-textfield-border-radius= 0.5rem
1812
+ --simple-textfield-background-color= transparent
1813
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1814
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1830
1815
  />
1831
- <label style:margin-left="0.7rem" for={cellEditorInfoActive.title}
1832
- >{cellEditorInfoActive.title}
1833
- </label>
1834
- </div>
1835
- {/if}
1836
- </div>
1816
+ {:else if cellEditorInfoActive.type.key === "number"}
1817
+ <LabelAndTextField
1818
+ label={cellEditorInfoActive.title}
1819
+ description={cellEditorInfoActive.description}
1820
+ name={cellEditorInfoActive.title}
1821
+ info={cellEditorInfoActive.info}
1822
+ type="number"
1823
+ orientation="horizontal"
1824
+ error={saveEditDisabled}
1825
+ bind:value={cellEditorInfoActive.value}
1826
+ --simple-textfield-border-radius= 0.5rem
1827
+ --simple-textfield-background-color= transparent
1828
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1829
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1830
+ />
1831
+ {:else if cellEditorInfoActive.type.key === "select"}
1832
+ <LabelAndSelect
1833
+ label={cellEditorInfoActive.title}
1834
+ description={cellEditorInfoActive.description}
1835
+ name={cellEditorInfoActive.title}
1836
+ info={cellEditorInfoActive.info}
1837
+ options={cellEditorInfoActive.type.params.options}
1838
+ orientation="horizontal"
1839
+ bind:value={cellEditorInfoActive.value}
1840
+ />
1841
+ {:else if cellEditorInfoActive.type.key === "boolean"}
1842
+ <div class="container">
1843
+ <Checkbox
1844
+ id={cellEditorInfoActive.title}
1845
+ bind:value={cellEditorInfoActive.value}
1846
+ />
1847
+ <label style:margin-left="0.7rem" for={cellEditorInfoActive.title}
1848
+ >{cellEditorInfoActive.title}
1849
+ </label>
1850
+ </div>
1851
+ {/if}
1852
+ </div>
1837
1853
 
1838
- <div style:margin-top="10px" style:grid-row="2" style:grid-column="1 / 3">
1839
- <Divider --divider-color=rgb(var(--global-color-contrast-100) />
1840
- </div>
1841
- <div style:grid-row="3" style:grid-column="2" style:margin-top="-15px">
1842
- <ConfirmOrCancelButtons
1843
- confirmDisable={saveEditDisabled}
1844
- confirmText="Save"
1845
- cancelText="Cancel"
1846
- on:cancel-click={handleCancelClick}
1847
- on:confirm-click={handleSaveClick}
1848
- />
1854
+ <div style:grid-column="2" style:margin-top="-15px">
1855
+ <ConfirmOrCancelButtons
1856
+ confirmDisable={saveEditDisabled}
1857
+ confirmText="Save"
1858
+ cancelText="Cancel"
1859
+ on:cancel-click={handleCancelClick}
1860
+ on:confirm-click={handleSaveClick}
1861
+ />
1862
+ </div>
1849
1863
  </div>
1850
- </div>
1851
- </Menu>
1864
+ {/if}
1865
+ </MenuOrDrawer>
1852
1866
 
1853
- <Menu
1867
+ <MenuOrDrawer
1854
1868
  bind:open={openQuickFilter}
1855
- activator={quickFilterActivator}
1856
- bind:menuElement={menuElementQuickFilters}
1857
- anchor="bottom"
1858
- openingId="quick-filter"
1859
- closeOnClickOutside
1869
+ menuProps={{
1870
+ activator: quickFilterActivator,
1871
+ anchor: 'bottom',
1872
+ openingId: 'quick-filter',
1873
+ closeOnClickOutside: true
1874
+ }}
1875
+ drawerProps={{
1876
+ _space: '60vh',
1877
+ _borderRadius: '10px',
1878
+ }}
1879
+ let:isMenu
1880
+ let:isDrawer
1860
1881
  >
1861
- <div
1862
- class="quick-filter-container"
1863
- >
1864
- <div style:grid-column="1 / 3">
1865
- {#if quickFilterActive.type.key == 'custom'}
1866
- <slot name="custom-quick-filter" quickFilter={quickFilterActive} {setQuickFilterMissingValue}>
1867
- </slot>
1868
- {:else if quickFilterActive.type.key === "string"}
1869
- <div class="space-between" style="font-weight: 500;">
1870
- {quickFilterActive.title}
1871
- {#if !!quickFilterActive.type.missingLabel}
1872
- <button
1873
- on:click={() =>
1874
- setQuickFilterMissingValue(quickFilterActive)}
1875
- >{quickFilterActive.type.missingLabel}</button
1876
- >
1877
- {/if}
1878
- </div>
1879
- <LabelAndTextField
1880
- description={quickFilterActive.description}
1881
- name={quickFilterActive.title}
1882
- info={quickFilterActive.info}
1883
- type="text"
1884
- bind:value={quickFilterActive.type.value}
1885
- --simple-textfield-border-radius= 0.5rem
1886
- --simple-textfield-background-color= transparent
1887
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1888
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1889
- />
1890
- {:else if quickFilterActive.type.key === "number"}
1891
- <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1892
- {quickFilterActive.title}
1893
- {#if !!quickFilterActive.type.missingLabel}
1894
- <button
1895
- on:click={() =>
1896
- setQuickFilterMissingValue(quickFilterActive)}
1897
- >{quickFilterActive.type.missingLabel}</button
1898
- >
1899
- {/if}
1900
- </div>
1901
- <LabelAndTextField
1902
- description={quickFilterActive.description}
1903
- name={quickFilterActive.title}
1904
- info={quickFilterActive.info}
1905
- type="number"
1906
- error={saveEditDisabled}
1907
- bind:value={quickFilterActive.type.value}
1908
- --simple-textfield-border-radius= 0.5rem
1909
- --simple-textfield-background-color= transparent
1910
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1911
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1912
- />
1913
- {:else if quickFilterActive.type.key === "multi-select"}
1914
- <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1915
- {quickFilterActive.title}
1916
- {#if !!quickFilterActive.type.missingLabel}
1917
- <button
1918
- on:click={() =>
1919
- setQuickFilterMissingValue(quickFilterActive)}
1920
- >{quickFilterActive.type.missingLabel}</button
1921
- >
1922
- {/if}
1923
- </div>
1924
- <div on:click|stopPropagation role="presentation" tabindex="-1">
1925
- <Autocomplete
1926
- multiple
1927
- items={quickFilterActive.type.items}
1928
- bind:values={quickFilterActive.type.values}
1929
- --autocomplete-border-radius= 0.5rem
1930
- --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
1931
- --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
1932
- >
1933
- <svelte:fragment slot="selection" let:selection let:unselect>
1934
- <slot name="selection" {selection} {unselect}>
1935
- <div tabindex="-1">
1936
- <Chip
1937
- close={true}
1938
- on:close={() => unselect(selection)}
1939
- --chip-default-border-radius="var(--autocomplete-border-radius, var(--autocomplete-default-border-radius))"
1940
- buttonTabIndex={-1}
1941
- truncateText
1942
- >
1943
- <slot name="chip-label" {selection}>
1944
- {#if !!quickFilterActive.type.countriesAlpha2 && quickFilterActive.type.countriesAlpha2.find((c) => c.value == selection.value)}
1945
- <div>
1946
- <FlagIcon
1947
- alpha2={quickFilterActive.type.countriesAlpha2
1948
- .find((c) => c.value == selection.value)
1949
- ?.label?.toString()
1950
- .toLowerCase() ?? ""}
1951
- --flag-icon-size="16px"
1952
- />
1953
- </div>
1954
- {/if}
1955
- {selection.label}
1956
- </slot>
1957
- </Chip>
1958
- </div>
1959
- </slot>
1960
- </svelte:fragment>
1961
- <svelte:fragment slot="item-label" let:item>
1962
- <slot name="item-label" {item}>
1963
- {#if !!quickFilterActive.type.countriesAlpha2 && quickFilterActive.type.countriesAlpha2.find((c) => c.value == item.value)}
1964
- <FlagIcon
1965
- alpha2={quickFilterActive.type.countriesAlpha2
1966
- .find((c) => c.value == item.value)
1967
- ?.label?.toString()
1968
- .toLowerCase() ?? ""}
1969
- />
1970
- {/if}
1971
- {item.label}
1972
- </slot>
1973
- </svelte:fragment>
1974
- </Autocomplete>
1975
- </div>
1976
- {:else if quickFilterActive.type.key === "boolean"}
1977
- {#if quickFilterActive.type.params}
1978
- <div class="vertical-quick-filters">
1979
- <button
1980
- on:click={() => setQuickFilterValue(quickFilterActive, true)}
1981
- >
1982
- {quickFilterActive.type.params.labelTrue}
1983
- </button>
1984
- <button
1985
- on:click={() => setQuickFilterValue(quickFilterActive, false)}
1986
- >
1987
- {quickFilterActive.type.params.labelFalse}
1988
- </button>
1989
- <button
1990
- on:click={() => setQuickFilterValue(quickFilterActive, undefined)}
1991
- >
1992
- {lang == 'en' ? 'All' : 'Tutti'}
1993
- </button>
1882
+ {#if quickFilterActive}
1883
+ <div
1884
+ class:quick-filter-container={isMenu}
1885
+ style:padding='10px'
1886
+ >
1887
+ <div style:grid-column="1 / 3">
1888
+ {#if quickFilterActive.type.key == 'custom'}
1889
+ <slot name="custom-quick-filter" quickFilter={quickFilterActive} {setQuickFilterMissingValue}>
1890
+ </slot>
1891
+ {:else if quickFilterActive.type.key === "string"}
1892
+ <div class="space-between" style="font-weight: 500;">
1893
+ {quickFilterActive.title}
1894
+ {#if !!quickFilterActive.type.missingLabel}
1895
+ <button
1896
+ on:click={() =>
1897
+ setQuickFilterMissingValue(quickFilterActive)}
1898
+ >{quickFilterActive.type.missingLabel}</button
1899
+ >
1900
+ {/if}
1994
1901
  </div>
1995
- {/if}
1996
- {:else if quickFilterActive.type.key === "country"}
1997
- <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1998
- {quickFilterActive.title}
1999
- {#if !!quickFilterActive.type.missingLabel}
2000
- <button
2001
- on:click={() =>
2002
- setQuickFilterMissingValue(quickFilterActive)}
2003
- >{quickFilterActive.type.missingLabel}</button
2004
- >
2005
- {/if}
2006
- </div>
2007
- <div on:click|stopPropagation role="presentation" tabindex="-1">
2008
- <CountriesAutocomplete
2009
- bind:selected={quickFilterActive.type.selected}
2010
- {...((!!quickFilterActive.type.countriesOptions && quickFilterActive.type.countriesOptions.length > 0) && {
2011
- items: quickFilterActive.type.countriesOptions,
2012
- })}
2013
- autocompleteProps={{
2014
- placeholder: !!quickFilterActive.type.selected
2015
- ? quickFilterActive.type.selected.length > 0
2016
- ? ""
2017
- : quickFilterActive.description
2018
- : quickFilterActive.description,
2019
- multiple: true,
2020
- }}
2021
- --autocomplete-border-radius= 0.5rem
2022
- --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
2023
- --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
1902
+ <LabelAndTextField
1903
+ description={quickFilterActive.description}
1904
+ name={quickFilterActive.title}
1905
+ info={quickFilterActive.info}
1906
+ type="text"
1907
+ bind:value={quickFilterActive.type.value}
1908
+ --simple-textfield-border-radius= 0.5rem
1909
+ --simple-textfield-background-color= transparent
1910
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1911
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
2024
1912
  />
2025
- </div>
2026
- {:else if quickFilterActive.type.key === "date"}
2027
- <div style="font-weight: 500; margin-bottom: 8px;">
2028
- {quickFilterActive.title}
2029
- </div>
2030
- <div on:click|stopPropagation role="presentation" tabindex="-1">
2031
- <div>
2032
- <DatePickerTextField
2033
- bind:selectedDate={quickFilterActive.type.from}
2034
- placeholder={lang == 'en' ? "From" : 'Da'}
2035
- --simple-textfield-width="100%"
2036
- --simple-textfield-border-radius= 0.5rem
2037
- --simple-textfield-background-color= transparent
2038
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
2039
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
2040
- flipOnOverflow
2041
- bind:menuOpened={calendarOpened}
2042
- on:day-click={() => (calendarOpened = false)}
2043
- >
2044
- <svelte:fragment slot="append-inner">
2045
- <Icon
2046
- name="mdi-close-circle"
2047
- click
2048
- on:click={() => {
2049
- if (
2050
- !!quickFilterActive &&
2051
- quickFilterActive.type.key === "date"
2052
- ) {
2053
- quickFilterActive.type.from = undefined;
2054
- }
2055
- }}
2056
- />
2057
- </svelte:fragment>
2058
- </DatePickerTextField>
1913
+ {:else if quickFilterActive.type.key === "number"}
1914
+ <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1915
+ {quickFilterActive.title}
1916
+ {#if !!quickFilterActive.type.missingLabel}
1917
+ <button
1918
+ on:click={() =>
1919
+ setQuickFilterMissingValue(quickFilterActive)}
1920
+ >{quickFilterActive.type.missingLabel}</button
1921
+ >
1922
+ {/if}
2059
1923
  </div>
2060
- <div>
2061
- <DatePickerTextField
2062
- bind:selectedDate={quickFilterActive.type.to}
2063
- placeholder={lang == 'en' ? "To" : 'A'}
2064
- --simple-textfield-width="100%"
2065
- --simple-textfield-border-radius= 0.5rem
2066
- --simple-textfield-background-color= transparent
2067
- --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
2068
- --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
2069
- flipOnOverflow
2070
- bind:menuOpened={calendarOpened2}
2071
- on:day-click={() => (calendarOpened2 = false)}
1924
+ <LabelAndTextField
1925
+ description={quickFilterActive.description}
1926
+ name={quickFilterActive.title}
1927
+ info={quickFilterActive.info}
1928
+ type="number"
1929
+ error={saveEditDisabled}
1930
+ bind:value={quickFilterActive.type.value}
1931
+ --simple-textfield-border-radius= 0.5rem
1932
+ --simple-textfield-background-color= transparent
1933
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
1934
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
1935
+ />
1936
+ {:else if quickFilterActive.type.key === "multi-select"}
1937
+ <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
1938
+ {quickFilterActive.title}
1939
+ {#if !!quickFilterActive.type.missingLabel}
1940
+ <button
1941
+ on:click={() =>
1942
+ setQuickFilterMissingValue(quickFilterActive)}
1943
+ >{quickFilterActive.type.missingLabel}</button
1944
+ >
1945
+ {/if}
1946
+ </div>
1947
+ <div on:click|stopPropagation role="presentation" tabindex="-1">
1948
+ <Autocomplete
1949
+ multiple
1950
+ items={quickFilterActive.type.items}
1951
+ bind:values={quickFilterActive.type.values}
1952
+ mobileDrawer={isDrawer}
1953
+ --autocomplete-border-radius= 0.5rem
1954
+ --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
1955
+ --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
2072
1956
  >
2073
- <svelte:fragment slot="append-inner">
2074
- <Icon
2075
- name="mdi-close-circle"
2076
- click
2077
- on:click={() => {
2078
- if (
2079
- !!quickFilterActive &&
2080
- quickFilterActive.type.key === "date"
2081
- ) {
2082
- quickFilterActive.type.to = undefined;
2083
- }
2084
- }}
2085
- />
1957
+ <svelte:fragment slot="selection" let:selection let:unselect>
1958
+ <slot name="selection" {selection} {unselect}>
1959
+ <div tabindex="-1">
1960
+ <Chip
1961
+ close={true}
1962
+ on:close={() => unselect(selection)}
1963
+ --chip-default-border-radius="var(--autocomplete-border-radius, var(--autocomplete-default-border-radius))"
1964
+ buttonTabIndex={-1}
1965
+ truncateText
1966
+ >
1967
+ <slot name="chip-label" {selection}>
1968
+ {#if !!quickFilterActive.type.countriesAlpha2 && quickFilterActive.type.countriesAlpha2.find((c) => c.value == selection.value)}
1969
+ <div>
1970
+ <FlagIcon
1971
+ alpha2={quickFilterActive.type.countriesAlpha2
1972
+ .find((c) => c.value == selection.value)
1973
+ ?.label?.toString()
1974
+ .toLowerCase() ?? ""}
1975
+ --flag-icon-size="16px"
1976
+ />
1977
+ </div>
1978
+ {/if}
1979
+ {selection.label}
1980
+ </slot>
1981
+ </Chip>
1982
+ </div>
1983
+ </slot>
1984
+ </svelte:fragment>
1985
+ <svelte:fragment slot="item-label" let:item>
1986
+ <slot name="item-label" {item}>
1987
+ {#if !!quickFilterActive.type.countriesAlpha2 && quickFilterActive.type.countriesAlpha2.find((c) => c.value == item.value)}
1988
+ <FlagIcon
1989
+ alpha2={quickFilterActive.type.countriesAlpha2
1990
+ .find((c) => c.value == item.value)
1991
+ ?.label?.toString()
1992
+ .toLowerCase() ?? ""}
1993
+ />
1994
+ {/if}
1995
+ {item.label}
1996
+ </slot>
2086
1997
  </svelte:fragment>
2087
- </DatePickerTextField>
1998
+ </Autocomplete>
1999
+ </div>
2000
+ {:else if quickFilterActive.type.key === "boolean"}
2001
+ {#if quickFilterActive.type.params}
2002
+ <div class="vertical-quick-filters">
2003
+ <button
2004
+ on:click={() => setQuickFilterValue(quickFilterActive, true)}
2005
+ >
2006
+ {quickFilterActive.type.params.labelTrue}
2007
+ </button>
2008
+ <button
2009
+ on:click={() => setQuickFilterValue(quickFilterActive, false)}
2010
+ >
2011
+ {quickFilterActive.type.params.labelFalse}
2012
+ </button>
2013
+ <button
2014
+ on:click={() => setQuickFilterValue(quickFilterActive, undefined)}
2015
+ >
2016
+ {lang == 'en' ? 'All' : 'Tutti'}
2017
+ </button>
2018
+ </div>
2019
+ {/if}
2020
+ {:else if quickFilterActive.type.key === "country"}
2021
+ <div class="space-between" style="font-weight: 500; margin-bottom: 8px;">
2022
+ {quickFilterActive.title}
2023
+ {#if !!quickFilterActive.type.missingLabel}
2024
+ <button
2025
+ on:click={() =>
2026
+ setQuickFilterMissingValue(quickFilterActive)}
2027
+ >{quickFilterActive.type.missingLabel}</button
2028
+ >
2029
+ {/if}
2030
+ </div>
2031
+ <div on:click|stopPropagation role="presentation" tabindex="-1">
2032
+ <CountriesAutocomplete
2033
+ bind:selected={quickFilterActive.type.selected}
2034
+ {...((!!quickFilterActive.type.countriesOptions && quickFilterActive.type.countriesOptions.length > 0) && {
2035
+ items: quickFilterActive.type.countriesOptions,
2036
+ })}
2037
+ autocompleteProps={{
2038
+ placeholder: !!quickFilterActive.type.selected
2039
+ ? quickFilterActive.type.selected.length > 0
2040
+ ? ""
2041
+ : quickFilterActive.description
2042
+ : quickFilterActive.description,
2043
+ multiple: true,
2044
+ mobileDrawer: isDrawer,
2045
+ }}
2046
+ --autocomplete-border-radius= 0.5rem
2047
+ --autocomplete-border="1px solid rgb(var(--global-color-background-500))"
2048
+ --autocomplete-focus-box-shadow="0 0 0 2px rgb(var(--global-color-primary-500))"
2049
+ />
2050
+ </div>
2051
+ {:else if quickFilterActive.type.key === "date"}
2052
+ <div style="font-weight: 500; margin-bottom: 8px;">
2053
+ {quickFilterActive.title}
2054
+ </div>
2055
+ <div on:click|stopPropagation role="presentation" tabindex="-1">
2056
+ <div>
2057
+ <DatePickerTextField
2058
+ bind:selectedDate={quickFilterActive.type.from}
2059
+ placeholder={lang == 'en' ? "From" : 'Da'}
2060
+ --simple-textfield-width="100%"
2061
+ --simple-textfield-border-radius= 0.5rem
2062
+ --simple-textfield-background-color= transparent
2063
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
2064
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
2065
+ flipOnOverflow
2066
+ mobileDialog={isDrawer}
2067
+ bind:menuOpened={calendarOpened}
2068
+ on:day-click={() => (calendarOpened = false)}
2069
+ >
2070
+ <svelte:fragment slot="append-inner">
2071
+ <Icon
2072
+ name="mdi-close-circle"
2073
+ click
2074
+ on:click={() => {
2075
+ if (
2076
+ !!quickFilterActive &&
2077
+ quickFilterActive.type.key === "date"
2078
+ ) {
2079
+ quickFilterActive.type.from = undefined;
2080
+ }
2081
+ }}
2082
+ />
2083
+ </svelte:fragment>
2084
+ </DatePickerTextField>
2085
+ </div>
2086
+ <div>
2087
+ <DatePickerTextField
2088
+ bind:selectedDate={quickFilterActive.type.to}
2089
+ placeholder={lang == 'en' ? "To" : 'A'}
2090
+ --simple-textfield-width="100%"
2091
+ --simple-textfield-border-radius= 0.5rem
2092
+ --simple-textfield-background-color= transparent
2093
+ --simple-textfield-box-shadow= 'inset 0 0 0 1px rgb(var(--global-color-background-500))'
2094
+ --simple-textfield-focus-box-shadow='inset 0 0 0 2px rgb(var(--global-color-primary-500))'
2095
+ flipOnOverflow
2096
+ mobileDialog={isDrawer}
2097
+ bind:menuOpened={calendarOpened2}
2098
+ on:day-click={() => (calendarOpened2 = false)}
2099
+ >
2100
+ <svelte:fragment slot="append-inner">
2101
+ <Icon
2102
+ name="mdi-close-circle"
2103
+ click
2104
+ on:click={() => {
2105
+ if (
2106
+ !!quickFilterActive &&
2107
+ quickFilterActive.type.key === "date"
2108
+ ) {
2109
+ quickFilterActive.type.to = undefined;
2110
+ }
2111
+ }}
2112
+ />
2113
+ </svelte:fragment>
2114
+ </DatePickerTextField>
2115
+ </div>
2088
2116
  </div>
2117
+ {/if}
2118
+ </div>
2119
+
2120
+ {#if quickFilterActive.type.key != "boolean"}
2121
+ <div style:grid-column="2" style:margin-top="-10px">
2122
+ <ConfirmOrCancelButtons
2123
+ confirmDisable={saveEditDisabled}
2124
+ confirmText={lang == 'en' ? "Apply" : 'Applica'}
2125
+ cancelText={lang == 'en' ? "Cancel" : 'Annulla'}
2126
+ on:cancel-click={handleCancelClick}
2127
+ on:confirm-click={() => handleApplyClick(quickFilterActive, quickFilterActive.type.key == 'custom')}
2128
+ />
2089
2129
  </div>
2090
2130
  {/if}
2091
2131
  </div>
2092
-
2093
- {#if quickFilterActive.type.key != "boolean"}
2094
- <div style:grid-row="3" style:grid-column="2" style:margin-top="-10px">
2095
- <ConfirmOrCancelButtons
2096
- confirmDisable={saveEditDisabled}
2097
- confirmText={lang == 'en' ? "Apply" : 'Applica'}
2098
- cancelText={lang == 'en' ? "Cancel" : 'Annulla'}
2099
- on:cancel-click={handleCancelClick}
2100
- on:confirm-click={() => handleApplyClick(quickFilterActive, quickFilterActive.type.key == 'custom')}
2101
- />
2102
- </div>
2103
- {/if}
2104
- </div>
2105
- </Menu>
2132
+ {/if}
2133
+ </MenuOrDrawer>
2106
2134
 
2107
2135
  <MediaQuery let:sAndDown>
2108
2136
  <Drawer
@@ -2273,8 +2301,14 @@
2273
2301
  }
2274
2302
 
2275
2303
  .header-label {
2276
- margin-right: 5px;
2277
- font-size: small;
2304
+ margin-right: var(
2305
+ --dynamic-table-header-label-margin,
2306
+ var(--dynamic-table-default-label-margin)
2307
+ );
2308
+ font-size: var(
2309
+ --dynamic-table-header-label-font-size,
2310
+ var(--dynamic-table-default-label-font-size)
2311
+ );
2278
2312
  }
2279
2313
 
2280
2314
  .header-sort-icon {
@@ -2373,14 +2407,12 @@
2373
2407
  align-items: center;
2374
2408
  box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
2375
2409
  position: fixed;
2376
- padding: 10px;
2377
2410
  border-radius: 10px;
2378
2411
  background-color: var(
2379
2412
  --dynamic-table-cell-editor-background-color,
2380
2413
  var(--dynamic-table-default-cell-editor-background-color)
2381
2414
  );
2382
- height: 200px;
2383
- width: 500px;
2415
+ width: 400px;
2384
2416
  }
2385
2417
 
2386
2418
  .row-activator {
@@ -2397,7 +2429,6 @@
2397
2429
  align-items: center;
2398
2430
  box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
2399
2431
  position: fixed;
2400
- padding: 10px;
2401
2432
  border-radius: 10px;
2402
2433
  background-color: var(
2403
2434
  --dynamic-table-quick-filter-background-color,