simplesvelte 2.2.12 → 2.2.13

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.
@@ -106,7 +106,7 @@
106
106
 
107
107
  // For multiple selection, work with current array state
108
108
  const currentValue = Array.isArray(normalizedValue) ? normalizedValue : []
109
-
109
+
110
110
  if (currentValue.includes(itemValue)) {
111
111
  value = currentValue.filter((v) => v !== itemValue)
112
112
  } else {
@@ -268,10 +268,22 @@ function normalizeRequest(request, skipPatterns) {
268
268
  ...request,
269
269
  // Normalize filter model
270
270
  filterModel: request.filterModel,
271
- // Normalize group keys
271
+ // Normalize group keys - but respect skipNormalization patterns
272
272
  groupKeys: request.groupKeys.map((key, index) => {
273
273
  const col = request.rowGroupCols[index];
274
274
  const fieldName = col?.field || col?.id;
275
+ // Check if this field should skip normalization
276
+ if (fieldName && skipPatterns) {
277
+ const shouldSkip = skipPatterns.some((pattern) => {
278
+ if (typeof pattern === 'string') {
279
+ return fieldName === pattern;
280
+ }
281
+ return pattern.test(fieldName);
282
+ });
283
+ if (shouldSkip) {
284
+ return key; // Return original key without normalization
285
+ }
286
+ }
275
287
  return normalizeValue(key, fieldName, skipPatterns);
276
288
  }),
277
289
  };
@@ -433,12 +445,28 @@ function applyDateFilter(where, field, filter) {
433
445
  if (/^\d{4}-\d{2}-\d{2}$/.test(dateFrom)) {
434
446
  dateFrom = new Date(dateFrom + 'T00:00:00.000Z').toISOString();
435
447
  }
448
+ // If it's a date with space-separated time (YYYY-MM-DD HH:MM:SS), convert to ISO format
449
+ else if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(dateFrom)) {
450
+ dateFrom = new Date(dateFrom.replace(' ', 'T') + '.000Z').toISOString();
451
+ }
452
+ // If it's already a valid date string, ensure it's in ISO format
453
+ else if (isDateString(dateFrom)) {
454
+ dateFrom = new Date(dateFrom).toISOString();
455
+ }
436
456
  }
437
457
  if (dateTo && typeof dateTo === 'string') {
438
458
  // If it's just a date (YYYY-MM-DD), convert to end of day in ISO format
439
459
  if (/^\d{4}-\d{2}-\d{2}$/.test(dateTo)) {
440
460
  dateTo = new Date(dateTo + 'T23:59:59.999Z').toISOString();
441
461
  }
462
+ // If it's a date with space-separated time (YYYY-MM-DD HH:MM:SS), convert to ISO format
463
+ else if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(dateTo)) {
464
+ dateTo = new Date(dateTo.replace(' ', 'T') + '.000Z').toISOString();
465
+ }
466
+ // If it's already a valid date string, ensure it's in ISO format
467
+ else if (isDateString(dateTo)) {
468
+ dateTo = new Date(dateTo).toISOString();
469
+ }
442
470
  }
443
471
  switch (type) {
444
472
  case 'equals':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simplesvelte",
3
- "version": "2.2.12",
3
+ "version": "2.2.13",
4
4
  "scripts": {
5
5
  "dev": "bun vite dev",
6
6
  "build": "bun vite build && bun run prepack",