@spaethtech/svelte-ui 0.7.1-dev.37.ab40d6b → 0.7.1-dev.38.b73de30

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.
@@ -268,22 +268,42 @@
268
268
  <div>
269
269
  <h4 class="mb-1 font-semibold">Dynamic dates</h4>
270
270
  <p class="mb-1 text-xs [color:color-mix(in_srgb,var(--ui-color-text)_70%,transparent)]">
271
- <code class="font-mono">now()</code> is the current time; add a signed offset
272
- <code class="font-mono">now()±&lt;n&gt;&lt;unit&gt;</code> — units <code>s m h d w</code>
273
- (e.g. <code>now()-7d</code>, <code>now()+1h</code>). Resolved when the query runs.
271
+ <code class="font-mono">now()</code> is the current time, resolved when the query runs. Add a
272
+ signed offset <code class="font-mono">now()±&lt;n&gt;&lt;unit&gt;</code> — units
273
+ <code>s</code> <code>m</code> <code>h</code> <code>d</code> <code>w</code>. Great with a date
274
+ column and <code>&gt;=</code>/<code>&lt;</code> or a range.
274
275
  </p>
276
+ <table class="w-full text-left">
277
+ <tbody
278
+ class="[&_td]:py-0.5 [&_td:first-child]:whitespace-nowrap [&_td:first-child]:pr-4 [&_td:first-child]:font-mono [&_td:last-child]:text-xs [&_td:last-child]:[color:color-mix(in_srgb,var(--ui-color-text)_65%,transparent)]"
279
+ >
280
+ <tr><td>$created &gt;= now()-7d</td><td>in the last 7 days</td></tr>
281
+ <tr><td>$expires &lt; now()</td><td>already expired</td></tr>
282
+ <tr><td>$due |= [now()..now()+30d]</td><td>due within 30 days</td></tr>
283
+ </tbody>
284
+ </table>
275
285
  </div>
276
286
  <div>
277
287
  <h4 class="mb-1 font-semibold">Examples</h4>
278
- <pre
279
- class="overflow-x-auto rounded p-2 font-mono text-xs [background-color:color-mix(in_srgb,var(--ui-color-text)_6%,transparent)]"><code
280
- >$status == active
281
- $email ~= /@gmail\.com$/i
282
- $price |= [20..50) && $role |= [admin, ops]
283
- $created >= now()-7d && $status == open
284
- $ip|inet |= [10.0.0.0|inet..10.255.255.255|inet]
285
- "lemon balm" || $featured == true</code
286
- ></pre>
288
+ <table class="w-full text-left">
289
+ <tbody
290
+ class="[&_td]:py-0.5 [&_td:first-child]:whitespace-nowrap [&_td:first-child]:pr-4 [&_td:first-child]:font-mono [&_td:last-child]:text-xs [&_td:last-child]:[color:color-mix(in_srgb,var(--ui-color-text)_65%,transparent)]"
291
+ >
292
+ <tr><td>$status == active</td><td>exact match</td></tr>
293
+ <tr><td>$name ^= Ada</td><td>starts with “Ada”</td></tr>
294
+ <tr><td>$email ~= @gmail.com</td><td>contains substring</td></tr>
295
+ <tr><td>$email ~= /@gmail\.com$/i</td><td>regex, case-insensitive</td></tr>
296
+ <tr><td>$age &gt;= 30</td><td>numeric compare</td></tr>
297
+ <tr><td>$age |= [21..40)</td><td>range — 21 ≤ age &lt; 40</td></tr>
298
+ <tr><td>$role |= [admin, ops]</td><td>any of a set</td></tr>
299
+ <tr><td>$tags &amp;= [urgent, vip]</td><td>all of (multi-value column)</td></tr>
300
+ <tr><td>$created &gt;= now()-7d</td><td>dynamic date (last 7 days)</td></tr>
301
+ <tr><td>$ip|inet &gt;= 10.0.0.0|inet</td><td>typed IP compare</td></tr>
302
+ <tr><td>!($role == admin)</td><td>negate a group</td></tr>
303
+ <tr><td>$status == open &amp;&amp; $priority &gt;= 3</td><td>combine with &amp;&amp; / ||</td></tr>
304
+ <tr><td>"lemon balm"</td><td>free-text search (no $)</td></tr>
305
+ </tbody>
306
+ </table>
287
307
  </div>
288
308
  <p class="text-xs [color:color-mix(in_srgb,var(--ui-color-text)_60%,transparent)]">
289
309
  Tip: type <kbd class="rounded border px-1 {bc}">$</kbd> for columns; enum columns suggest
@@ -232,7 +232,8 @@ Config-driven, responsive 12-column data table over a `DataGrid`.
232
232
  ### Query
233
233
 
234
234
  Filter bar over a `DataSet` — monospace input with `$column` + enum-value autocomplete and a help
235
- dialog.
235
+ dialog (operators, casts, dynamic `now()` dates, and a worked examples table). The DSL supports
236
+ `now()` / `now()±<n><unit>` dynamic dates — see the help dialog + the data spec.
236
237
 
237
238
  - **Location**: `src/lib/components/Query.svelte`
238
239
  - **Props**: `dataset` (`DataSet`), `placeholder`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaethtech/svelte-ui",
3
- "version": "0.7.1-dev.37.ab40d6b",
3
+ "version": "0.7.1-dev.38.b73de30",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/spaethtech/svelte-ui.git"