@likable-hair/svelte 4.0.22 → 4.0.24

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.
@@ -240,33 +240,23 @@ $effect(() => {
240
240
  --quick-actions-z-index,
241
241
  var(--quick-actions-default-z-index)
242
242
  );
243
- width: 90%;
243
+ display: flex;
244
+ justify-content: center;
245
+ left: 0px;
246
+ right: 0px;
247
+ padding-top: 24px;
248
+ padding-bottom: 24px;
249
+ backdrop-filter: blur(2px);
250
+ background-color: rgb(var(--global-color-background-100),.6);
251
+ mask: linear-gradient(to top, transparent 0%, black 30%, black 100%);
244
252
  }
245
253
 
246
254
  .container-top {
247
- top: 16px;
248
- left: 250px;
255
+ top: 0px;
249
256
  }
250
257
 
251
258
  .container-bottom {
252
- bottom: 64px;
253
- }
254
-
255
- @media (max-width: 1025px) {
256
- .container-top, .container-bottom {
257
- position: fixed;
258
- z-index: 48;
259
- width: 80%;
260
- }
261
-
262
- .container-top {
263
- top: 16px;
264
- left: auto;
265
- }
266
-
267
- .container-bottom {
268
- bottom: 64px;
269
- }
259
+ bottom: 16px;
270
260
  }
271
261
 
272
262
  .select-container {
@@ -278,8 +268,14 @@ $effect(() => {
278
268
  var(--quick-actions-default-background-color)
279
269
  );
280
270
  border-radius: 8px;
281
- padding: 5px;
282
- margin-bottom: 10px;
271
+ padding: 8px;
272
+ margin-bottom: 16px;
273
+ }
274
+
275
+ @media (max-width: 1024px) {
276
+ .select-container {
277
+ width: 90%;
278
+ }
283
279
  }
284
280
 
285
281
  .select-info {
@@ -323,7 +319,7 @@ $effect(() => {
323
319
 
324
320
  .select-actions {
325
321
  display: flex;
326
- margin: 0 8px;
322
+ margin-left: 8px;
327
323
  justify-content: flex-end;
328
324
  width: 100%;
329
325
  gap: 8px;
@@ -369,7 +365,7 @@ $effect(() => {
369
365
  bottom: 121px;
370
366
  }
371
367
 
372
- @media (max-width: 1500px) {
368
+ @media (max-width: 1440px) {
373
369
  .more-actions-container-menu {
374
370
  display: grid;
375
371
  grid-template-columns: 1fr;
@@ -94,7 +94,7 @@ const [send, receive] = crossfade({
94
94
  };
95
95
  },
96
96
  });
97
- 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 = {}, dynamicFilters = true, useSelectedItemsOnly = 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();
97
+ 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
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 = {}, 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
99
  const DEFAULT_MIN_WIDTH_PX = 100, DEFAULT_MAX_WIDTH_PX = 400;
100
100
  let totalSections = $derived((totalRows - renderedRowsNumber) / sectionRowsNumber);
@@ -942,8 +942,8 @@ function resizeHeader(th, header) {
942
942
  {/if}
943
943
 
944
944
  <div class="filter-container">
945
- {#if filtersVisible}
946
- <div>
945
+ <div>
946
+ {#if filtersVisible}
947
947
  {#if dynamicFilters}
948
948
  <Filters
949
949
  bind:filters
@@ -953,6 +953,7 @@ function resizeHeader(th, header) {
953
953
  onremoveFilter={e => { handleRemoveFilter(e.detail.filter) }}
954
954
  onremoveAllFilters={() => handleRemoveAllFilters()}
955
955
  --filters-default-wrapper-width="100%"
956
+ --filters-button-height=29px
956
957
  {lang}
957
958
  {dateLocale}
958
959
  {editFilterMode}
@@ -986,6 +987,7 @@ function resizeHeader(th, header) {
986
987
  onremoveFilter={e => { handleRemoveFilter(e.detail.filter) }}
987
988
  onremoveAllFilters={() => handleRemoveAllFilters()}
988
989
  --filters-default-wrapper-width="100%"
990
+ --filters-button-height=29px
989
991
  {lang}
990
992
  {dateLocale}
991
993
  {editFilterMode}
@@ -996,8 +998,8 @@ function resizeHeader(th, header) {
996
998
  >
997
999
  </Filters>
998
1000
  {/if}
999
- </div>
1000
- {/if}
1001
+ {/if}
1002
+ </div>
1001
1003
 
1002
1004
  <div>
1003
1005
  {@render appendSnippet?.()}
@@ -1076,7 +1078,7 @@ function resizeHeader(th, header) {
1076
1078
  class="non-resizable"
1077
1079
  bind:this={headersHTML['non-resizable']}
1078
1080
  >
1079
- {#if selectMode === "multiple"}
1081
+ {#if selectMode === "multiple" && !selectedAllDisabled}
1080
1082
  <Checkbox
1081
1083
  id="select-all"
1082
1084
  value={selectedAll}
@@ -1102,6 +1104,7 @@ function resizeHeader(th, header) {
1102
1104
  style:max-width={header.maxWidth}
1103
1105
  class:sortable={header.sortable}
1104
1106
  onclick={() => handleHeaderClick(header)}
1107
+ id={header.value}
1105
1108
  bind:this={headersHTML[header.value]}
1106
1109
  >
1107
1110
  {#if resizableColumns}
@@ -2246,7 +2249,7 @@ function resizeHeader(th, header) {
2246
2249
  .results-number {
2247
2250
  margin: 0px 0px 4px 4px;
2248
2251
  display: flex;
2249
- align-items: center;
2252
+ align-items: top;
2250
2253
  gap: 4px;
2251
2254
  min-width: 90px;
2252
2255
  }
@@ -176,6 +176,7 @@ declare class __sveltets_Render<Item extends {
176
176
  } | undefined;
177
177
  dynamicFilters?: boolean;
178
178
  useSelectedItemsOnly?: boolean;
179
+ selectedAllDisabled?: boolean;
179
180
  class?: {
180
181
  container?: string;
181
182
  header?: string;
@@ -526,7 +527,7 @@ declare class __sveltets_Render<Item extends {
526
527
  };
527
528
  events(): {};
528
529
  slots(): {};
529
- bindings(): "searchText" | "sortedBy" | "sortDirection" | "filters" | "selectedItems" | "unselectedItems" | "selectedAll";
530
+ bindings(): "searchText" | "sortedBy" | "sortDirection" | "resizedColumnSizeWithPadding" | "filters" | "selectedItems" | "unselectedItems" | "selectedAll";
530
531
  exports(): {};
531
532
  }
532
533
  interface $$IsomorphicComponent {
@@ -5,11 +5,12 @@ import {} from "svelte";
5
5
  import Filters from "../search/Filters.svelte";
6
6
  import SearchBar from "../search/SearchBar.svelte";
7
7
  import Converter from "../../../utils/filters/filters";
8
+ import MediaQuery from "../../simple/common/MediaQuery.svelte";
8
9
  let { headers = [], items = [], sortedBy = $bindable(undefined), sortDirection = $bindable("asc"), page = $bindable(1), maxPage = undefined, rowsPerPageOptions = [
9
10
  { label: "20", value: 20 },
10
11
  { label: "50", value: 50 },
11
12
  { label: "100", value: 100 },
12
- ], hideRowsPerPage = false, totalElements = undefined, rowsPerPage = $bindable(20), filters = $bindable([]), searchBarColumns = undefined, searchBarVisible = true, lang = "en", editFilterMode = "one-edit", showActiveFilters = true, resizableColumns = false, resizedColumnSizeWithPadding = {}, pointerOnRowHover = undefined, doubleClickActive = false, doubleClickDelay = 250, calculateRowStyles = undefined, calculateRowClasses = undefined, class: clazz = {}, onfiltersChange, onpaginationChange, onremoveFilter, onremoveAllFilters, customFilterChipSnippet, customFilterSnippet, filterAppendSnippet, onrowClick, onrowDoubleClick, appendSnippet, customSnippet, headerLabelSnippet, headerSnippet, rowActionsSnippet, onsort, footerSnippet, rangeDescriptorSnippet, searchBarSnippet, noDataSnippet, oncolumnResize, } = $props();
13
+ ], hideRowsPerPage = false, totalElements = undefined, rowsPerPage = $bindable(20), filters = $bindable([]), searchBarColumns = undefined, searchBarVisible = true, lang = "en", searchBarPlaceholder = lang == 'en' ? "Type to search..." : "Scrivi per cercare...", editFilterMode = "one-edit", showActiveFilters = true, resizableColumns = false, resizedColumnSizeWithPadding = {}, pointerOnRowHover = undefined, doubleClickActive = false, doubleClickDelay = 250, calculateRowStyles = undefined, calculateRowClasses = undefined, class: clazz = {}, onfiltersChange, onpaginationChange, onremoveFilter, onremoveAllFilters, customFilterChipSnippet, customFilterSnippet, filterAppendSnippet, onrowClick, onrowDoubleClick, appendSnippet, customSnippet, headerLabelSnippet, headerSnippet, rowActionsSnippet, onsort, footerSnippet, rangeDescriptorSnippet, searchBarSnippet, noDataSnippet, oncolumnResize, } = $props();
13
14
  let searchBarInput = $state(), searchText = $state(), sortModify;
14
15
  let rowsPerPageSelection = $state([]);
15
16
  $effect(() => {
@@ -111,37 +112,41 @@ function buildFilters(params) {
111
112
  </script>
112
113
 
113
114
  <div class="paginated-table">
114
- <div class="filter-container">
115
- {#if searchBarVisible}
116
- {#if searchBarSnippet}
117
- {@render searchBarSnippet({ handleSearchChange })}
118
- {:else}
119
- <div class="search-bar-container">
120
- <SearchBar
121
- bind:input={searchBarInput}
122
- bind:value={searchText}
123
- --search-bar-default-height="36px"
124
- --search-bar-default-border-radius="4px"
125
- --search-bar-default-ring-color="rgb(var(--global-color-background-300),.6)"
126
- --search-bar-default-background-color="rgb(var(--global-color-background-300),.4)"
127
- ></SearchBar>
128
- </div>
129
- {/if}
130
- {/if}
131
- <Filters
132
- bind:filters
133
- onapplyFilter={handleFiltersChange}
134
- onremoveFilter={handleRemoveFilter}
135
- onremoveAllFilters={handleRemoveAllFilters}
136
- --filters-default-wrapper-width={!!searchBarVisible ? undefined : "100%"}
137
- {lang}
138
- {editFilterMode}
139
- {showActiveFilters}
140
- appendSnippet={filterAppendSnippet}
141
- customChipSnippet={customFilterChipSnippet}
142
- customSnippet={customFilterSnippet}
143
- ></Filters>
144
- </div>
115
+ <MediaQuery>
116
+ {#snippet defaultSnippet({ mAndDown })}
117
+ <div class="searchbar-and-filter-container {mAndDown ? 'mobile' : 'desktop'}">
118
+ {#if searchBarVisible}
119
+ {#if searchBarSnippet}
120
+ {@render searchBarSnippet({ handleSearchChange })}
121
+ {:else}
122
+ <SearchBar
123
+ placeholder={searchBarPlaceholder}
124
+ bind:input={searchBarInput}
125
+ bind:value={searchText}
126
+ --search-bar-default-width={mAndDown ? "100%" : "450px"}
127
+ --search-bar-default-height="36px"
128
+ --search-bar-default-border-radius="4px"
129
+ --search-bar-default-ring-color="rgb(var(--global-color-background-300),.6)"
130
+ --search-bar-default-background-color="rgb(var(--global-color-background-300),.4)"
131
+ ></SearchBar>
132
+ {/if}
133
+ {/if}
134
+ <Filters
135
+ bind:filters
136
+ onapplyFilter={handleFiltersChange}
137
+ onremoveFilter={handleRemoveFilter}
138
+ onremoveAllFilters={handleRemoveAllFilters}
139
+ --filters-default-wrapper-width={!!searchBarVisible ? undefined : "100%"}
140
+ {lang}
141
+ {editFilterMode}
142
+ {showActiveFilters}
143
+ appendSnippet={filterAppendSnippet}
144
+ customChipSnippet={customFilterChipSnippet}
145
+ customSnippet={customFilterSnippet}
146
+ ></Filters>
147
+ </div>
148
+ {/snippet}
149
+ </MediaQuery>
145
150
  <SimpleTable
146
151
  {headers}
147
152
  class={clazz.simpleTable}
@@ -234,20 +239,17 @@ function buildFilters(params) {
234
239
  width: 100%;
235
240
  }
236
241
 
237
- .filter-container {
242
+ .searchbar-and-filter-container {
238
243
  display: flex;
239
- align-items: center;
240
- flex-direction: row;
241
244
  gap: 12px;
242
- width: 100%;
243
245
  }
244
246
 
245
- .search-bar-container {
246
- padding: var(
247
- --paginated-table-search-bar-container-padding,
248
- var(--paginated-table-search-bar-container-default-padding, 0)
249
- );
250
- flex-grow: 1;
247
+ .searchbar-and-filter-container.desktop {
248
+ flex-direction: row;
249
+ }
250
+
251
+ .searchbar-and-filter-container.mobile {
252
+ flex-direction: column;
251
253
  }
252
254
 
253
255
  @media only screen and (max-width: 768px) {
@@ -5,6 +5,7 @@ import Icon from "../simple/media/Icon.svelte";
5
5
  import {} from "../simple/lists/ColorInvertedSelector.svelte";
6
6
  import { writable } from "svelte/store";
7
7
  import {} from "svelte";
8
+ import mediaQuery from "../../stores/mediaQuery";
8
9
  let { drawerOpened = $bindable(false), sidebarExpanded = $bindable(false), class: clazz = {}, ondrawerChange, onsidebarToggle, headerSnippet, innerMenuSnippet, sidebarSnippet, logoSnippet, menuSnippet, userSnippet, children, } = $props();
9
10
  const sidebarPinned = writable(false);
10
11
  let headerElement;
@@ -26,6 +27,11 @@ function toggleSidebar() {
26
27
  onsidebarToggle({ detail: { expanded: sidebarExpanded } });
27
28
  }
28
29
  }
30
+ $effect(() => {
31
+ if ($mediaQuery.m || $mediaQuery.s || $mediaQuery.xs) {
32
+ sidebarExpanded = false;
33
+ }
34
+ });
29
35
  </script>
30
36
 
31
37
  <MediaQuery>
@@ -48,7 +54,7 @@ function toggleSidebar() {
48
54
  onclick={toggleMenu}
49
55
  />
50
56
  </div>
51
- {:else if !sidebarExpanded}
57
+ {:else}
52
58
  {#if !sidebarExpanded}
53
59
  <div style:margin-right="2rem">
54
60
  <Icon
@@ -176,7 +182,6 @@ function toggleSidebar() {
176
182
  justify-content: center;
177
183
  align-items: center;
178
184
  width: 100%;
179
- margin-bottom: 1rem;
180
185
  }
181
186
 
182
187
  .logo-container {
@@ -5,6 +5,6 @@
5
5
  --file-input-list-default-selected-row-color: rgb(var(--global-color-contrast-1000));
6
6
  --file-input-list-default-selected-row-background: rgb(var(--global-color-background-500));
7
7
  --file-input-list-default-hover-color: rgb(var(--global-color-contrast-900));
8
- --file-input-list-default-border-color: rgb(var(--global-color-primary-100));
8
+ --file-input-list-default-border: 2px dashed rgb(var(--global-color-contrast-900), .4);
9
9
  --file-input-list-default-border-radius: 5px
10
10
  }
@@ -224,10 +224,9 @@ function isImageFile(file) {
224
224
  }
225
225
 
226
226
  .body-container {
227
- border: dotted;
228
- border-color: var(
229
- --file-input-list-border-color,
230
- var(--file-input-list-default-border-color)
227
+ border: var(
228
+ --file-input-list-border,
229
+ var(--file-input-list-default-border)
231
230
  );
232
231
  border-radius: var(
233
232
  --file-input-list-border-radius,
@@ -60,6 +60,8 @@ function handleKeypress(params) {
60
60
  }
61
61
  function handleElementClick(element) {
62
62
  selected = element.name;
63
+ if (element.disabled)
64
+ return;
63
65
  if (onselect) {
64
66
  onselect({
65
67
  detail: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair and others",
4
- "version": "4.0.22",
4
+ "version": "4.0.24",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",