bank20baht-ui 0.1.7 → 0.1.8

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.
@@ -21,11 +21,11 @@ export type CellRenderer = (value: unknown, row: Record<string, unknown>) => unk
21
21
  * t.cursorMode = true; t.hasNext = true; t.hasPrev = false;
22
22
  * t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));
23
23
  *
24
- * Set `column-picker` for a built-in "Columns" toggle — it walks `columns`
25
- * (or the first row's keys, same as the header does) and lets the user
26
- * show/hide them client-side, no host wiring required:
24
+ * A built-in "Columns" toggle is ON by default — it walks `columns` (or the
25
+ * first row's keys, same as the header does) and lets the user show/hide
26
+ * them client-side, no host wiring required. Set `t.columnPicker = false`
27
+ * (JS property — a boolean attribute can't express "off") to hide it:
27
28
  *
28
- * t.columnPicker = true;
29
29
  * t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));
30
30
  *
31
31
  * `visibleColumns` still works standalone for a host-controlled subset (no
@@ -53,7 +53,7 @@ export declare class BahtTable extends BahtElement {
53
53
  renderers: Record<string, CellRenderer>;
54
54
  /** Subset + order of `columns` to render; empty/omitted = show all. */
55
55
  visibleColumns: string[];
56
- /** Built-in "Columns" toggle — derives its options from `columns`/rows. */
56
+ /** Built-in "Columns" toggle — derives its options from `columns`/rows. Set `column-picker="false"` to hide it. */
57
57
  columnPicker: boolean;
58
58
  page: number;
59
59
  totalPages: number;
@@ -8348,7 +8348,7 @@
8348
8348
  "declarations": [
8349
8349
  {
8350
8350
  "kind": "class",
8351
- "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));\n\nSet `column-picker` for a built-in \"Columns\" toggle — it walks `columns`\n(or the first row's keys, same as the header does) and lets the user\nshow/hide them client-side, no host wiring required:\n\n t.columnPicker = true;\n t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));\n\n`visibleColumns` still works standalone for a host-controlled subset (no\nrefetch) — pass it explicitly and the built-in picker (if also enabled)\nstarts from that selection and keeps emitting updates for it.",
8351
+ "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));\n\nA built-in \"Columns\" toggle is ON by default — it walks `columns` (or the\nfirst row's keys, same as the header does) and lets the user show/hide\nthem client-side, no host wiring required. Set `t.columnPicker = false`\n(JS property — a boolean attribute can't express \"off\") to hide it:\n\n t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));\n\n`visibleColumns` still works standalone for a host-controlled subset (no\nrefetch) — pass it explicitly and the built-in picker (if also enabled)\nstarts from that selection and keeps emitting updates for it.",
8352
8352
  "name": "BahtTable",
8353
8353
  "members": [
8354
8354
  {
@@ -8477,8 +8477,8 @@
8477
8477
  "type": {
8478
8478
  "text": "boolean"
8479
8479
  },
8480
- "default": "false",
8481
- "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows.",
8480
+ "default": "true",
8481
+ "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows. Set `column-picker=\"false\"` to hide it.",
8482
8482
  "attribute": "column-picker"
8483
8483
  },
8484
8484
  {
@@ -8788,8 +8788,8 @@
8788
8788
  "type": {
8789
8789
  "text": "boolean"
8790
8790
  },
8791
- "default": "false",
8792
- "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows.",
8791
+ "default": "true",
8792
+ "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows. Set `column-picker=\"false\"` to hide it.",
8793
8793
  "fieldName": "columnPicker"
8794
8794
  },
8795
8795
  {
package/dist/index.js CHANGED
@@ -313,7 +313,7 @@ var xe = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, f = (t, e,
313
313
  };
314
314
  let b = class extends c {
315
315
  constructor() {
316
- super(...arguments), this.items = [], this.columns = {}, this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "No records yet.", this.showIndex = !0, this.indexOffset = 0, this.skeletonRows = 10, this.rowKey = "", this.clickable = !0, this.renderers = {}, this.visibleColumns = [], this.columnPicker = !1, this.page = 1, this.totalPages = 1, this.cursorMode = !1, this.hasNext = !1, this.hasPrev = !1, this.pickerOpen = !1, this.pickedColumns = null, this.onDocMousedown = (t) => {
316
+ super(...arguments), this.items = [], this.columns = {}, this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "No records yet.", this.showIndex = !0, this.indexOffset = 0, this.skeletonRows = 10, this.rowKey = "", this.clickable = !0, this.renderers = {}, this.visibleColumns = [], this.columnPicker = !0, this.page = 1, this.totalPages = 1, this.cursorMode = !1, this.hasNext = !1, this.hasPrev = !1, this.pickerOpen = !1, this.pickedColumns = null, this.onDocMousedown = (t) => {
317
317
  this.contains(t.target) || (this.pickerOpen = !1);
318
318
  };
319
319
  }
@@ -583,7 +583,7 @@
583
583
  },
584
584
  {
585
585
  "name": "baht-table",
586
- "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));\n\nSet `column-picker` for a built-in \"Columns\" toggle — it walks `columns`\n(or the first row's keys, same as the header does) and lets the user\nshow/hide them client-side, no host wiring required:\n\n t.columnPicker = true;\n t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));\n\n`visibleColumns` still works standalone for a host-controlled subset (no\nrefetch) — pass it explicitly and the built-in picker (if also enabled)\nstarts from that selection and keeps emitting updates for it.\n---\n\n\n### **Events:**\n - **baht-columns-change**\n- **baht-row-click**",
586
+ "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));\n\nA built-in \"Columns\" toggle is ON by default — it walks `columns` (or the\nfirst row's keys, same as the header does) and lets the user show/hide\nthem client-side, no host wiring required. Set `t.columnPicker = false`\n(JS property — a boolean attribute can't express \"off\") to hide it:\n\n t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));\n\n`visibleColumns` still works standalone for a host-controlled subset (no\nrefetch) — pass it explicitly and the built-in picker (if also enabled)\nstarts from that selection and keeps emitting updates for it.\n---\n\n\n### **Events:**\n - **baht-columns-change**\n- **baht-row-click**",
587
587
  "attributes": [
588
588
  { "name": "loading", "values": [] },
589
589
  { "name": "error", "values": [] },
@@ -608,7 +608,7 @@
608
608
  },
609
609
  {
610
610
  "name": "column-picker",
611
- "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows.",
611
+ "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows. Set `column-picker=\"false\"` to hide it.",
612
612
  "values": []
613
613
  },
614
614
  { "name": "page", "values": [] },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "bank20baht-ui",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1452,7 +1452,7 @@
1452
1452
  },
1453
1453
  {
1454
1454
  "name": "baht-table",
1455
- "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));\n\nSet `column-picker` for a built-in \"Columns\" toggle — it walks `columns`\n(or the first row's keys, same as the header does) and lets the user\nshow/hide them client-side, no host wiring required:\n\n t.columnPicker = true;\n t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));\n\n`visibleColumns` still works standalone for a host-controlled subset (no\nrefetch) — pass it explicitly and the built-in picker (if also enabled)\nstarts from that selection and keeps emitting updates for it.\n---\n\n\n### **Events:**\n - **baht-columns-change**\n- **baht-row-click**",
1455
+ "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));\n\nA built-in \"Columns\" toggle is ON by default — it walks `columns` (or the\nfirst row's keys, same as the header does) and lets the user show/hide\nthem client-side, no host wiring required. Set `t.columnPicker = false`\n(JS property — a boolean attribute can't express \"off\") to hide it:\n\n t.addEventListener('baht-columns-change', (e) => console.log(e.detail.visibleColumns));\n\n`visibleColumns` still works standalone for a host-controlled subset (no\nrefetch) — pass it explicitly and the built-in picker (if also enabled)\nstarts from that selection and keeps emitting updates for it.\n---\n\n\n### **Events:**\n - **baht-columns-change**\n- **baht-row-click**",
1456
1456
  "doc-url": "",
1457
1457
  "attributes": [
1458
1458
  {
@@ -1499,8 +1499,8 @@
1499
1499
  },
1500
1500
  {
1501
1501
  "name": "column-picker",
1502
- "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows.",
1503
- "value": { "type": "boolean", "default": "false" }
1502
+ "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows. Set `column-picker=\"false\"` to hide it.",
1503
+ "value": { "type": "boolean", "default": "true" }
1504
1504
  },
1505
1505
  { "name": "page", "value": { "type": "number", "default": "1" } },
1506
1506
  {
@@ -1570,7 +1570,7 @@
1570
1570
  },
1571
1571
  {
1572
1572
  "name": "columnPicker",
1573
- "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows.",
1573
+ "description": "Built-in \"Columns\" toggle — derives its options from `columns`/rows. Set `column-picker=\"false\"` to hide it.",
1574
1574
  "type": "boolean"
1575
1575
  },
1576
1576
  { "name": "page", "type": "number" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bank20baht-ui",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "JSON-driven form + workflow engine. Send JSON in, get an interactive form out.",
6
6
  "license": "MIT",