@c2n/list 0.0.12 → 0.0.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.
@@ -0,0 +1 @@
1
+ {"schemaVersion":"1.0.0","readme":"","modules":[{"kind":"javascript-module","path":"src/list.ts","declarations":[{"kind":"class","description":"A vertical list of `c2-list-item` rows with single or multiple selection. The list owns the selection: it reads the\n`value` of the clicked row, updates its own `value` (a `;`-separated list in the attribute, an array in the property)\nand pushes the selected state down to every row through context, so rows never need a `selected` attribute of\ntheir own when they live inside a list.\n\nKeyboard: the list is a `listbox` with a roving `tabindex`. Arrow Up/Down move between enabled rows, Home/End jump to\nthe first/last, Enter and Space select the focused row, and typing letters jumps to the next row starting with them.\n\nBesides rows, the default slot accepts `<hr>` dividers and `<h1>`–`<h6>` group headings; both are styled by the\n`__divider` and `__heading` tokens and skipped by selection and keyboard.","name":"List","cssProperties":[{"type":{"text":"color"},"name":"--c2-list--background","default":"#ffffff"},{"type":{"text":"pixel"},"name":"--c2-list--gap"},{"type":{"text":"border-radius"},"name":"--c2-list--border-top-left-radius"},{"type":{"text":"border-radius"},"name":"--c2-list--border-top-right-radius"},{"type":{"text":"border-radius"},"name":"--c2-list--border-bottom-left-radius"},{"type":{"text":"border-radius"},"name":"--c2-list--border-bottom-right-radius"},{"type":{"text":"border"},"name":"--c2-list--border-top"},{"type":{"text":"border"},"name":"--c2-list--border-bottom"},{"type":{"text":"border"},"name":"--c2-list--border-right"},{"type":{"text":"border"},"name":"--c2-list--border-left"},{"type":{"text":"box-shadow"},"name":"--c2-list--box-shadow"},{"type":{"text":"padding"},"name":"--c2-list--padding-top","default":"4px"},{"type":{"text":"padding"},"name":"--c2-list--padding-bottom","default":"4px"},{"type":{"text":"padding"},"name":"--c2-list--padding-right","default":"4px"},{"type":{"text":"padding"},"name":"--c2-list--padding-left","default":"4px"},{"type":{"text":"pixel"},"description":"Scrolls when the rows are taller than this.","name":"--c2-list--max-height"},{"type":{"text":"color"},"name":"--c2-list__divider--color","default":"#e4e4e7"},{"type":{"text":"margin"},"name":"--c2-list__divider--margin","default":"4px 0"},{"type":{"text":"color"},"name":"--c2-list__heading--color","default":"#71717a"},{"type":{"text":"font-size"},"name":"--c2-list__heading--font-size","default":"11px"},{"type":{"text":"font-weight"},"name":"--c2-list__heading--font-weight","default":"600"},{"type":{"text":"letter-spacing"},"name":"--c2-list__heading--letter-spacing","default":"0.06em"},{"type":{"text":"text-transform"},"name":"--c2-list__heading--text-transform","default":"uppercase"},{"type":{"text":"padding"},"name":"--c2-list__heading--padding-top","default":"10px"},{"type":{"text":"padding"},"name":"--c2-list__heading--padding-right","default":"10px"},{"type":{"text":"padding"},"name":"--c2-list__heading--padding-bottom","default":"4px"},{"type":{"text":"padding"},"name":"--c2-list__heading--padding-left","default":"10px"}],"slots":[{"description":"The rows: `c2-list-item` elements (or wrappers whose first child is a `c2-list-item`), plus `<hr>` dividers and heading elements.","name":"default"}],"members":[{"kind":"field","name":"value","type":{"text":"string[]"},"default":"[]","description":"Selected values. Written as `value=\"a;b\"` in markup, read as `['a', 'b']` from the property.","attribute":"value","reflects":true},{"kind":"field","name":"data","type":{"text":"unknown[]"},"default":"[]","description":"The `data` of every selected row, in `value` order. Not an attribute."},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Dims the whole list and ignores clicks and keyboard.","attribute":"disabled","reflects":true},{"kind":"field","name":"multiple","type":{"text":"boolean"},"default":"false","description":"Allow several rows to be selected; clicking a selected row deselects it.","attribute":"multiple"},{"kind":"field","name":"required","type":{"text":"boolean"},"default":"false","description":"Keep at least one row selected: clicking the only selected row does nothing.","attribute":"required"},{"kind":"field","name":"listItemSlot","type":{"text":"HTMLSlotElement"},"privacy":"private"},{"kind":"field","name":"focusedItem","type":{"text":"ListItem | undefined"},"privacy":"private","default":"undefined","description":"The row that currently holds the roving tabindex."},{"kind":"field","name":"typeahead","type":{"text":"string"},"privacy":"private","default":"''"},{"kind":"field","name":"typeaheadTimer","type":{"text":"ReturnType<typeof setTimeout> | undefined"},"privacy":"private"},{"kind":"field","name":"items","type":{"text":"ListItem[]"},"description":"Slotted rows, in DOM order (dividers and headings excluded).","readonly":true},{"kind":"field","name":"enabledItems","type":{"text":"ListItem[]"},"privacy":"private","readonly":true},{"kind":"method","name":"handleSlotChange","privacy":"private"},{"kind":"method","name":"syncRows","privacy":"private","description":"Mirrors the selection onto the rows: `data`, the roving tabindex, and `joined-before` / `joined-after` on adjacent\nselected rows so `c2-list-item` can square the corners between them and a run of selected rows reads as one block."},{"kind":"method","name":"setFocusedItem","privacy":"private","parameters":[{"name":"item","type":{"text":"ListItem"}},{"name":"focus","default":"true"}]},{"kind":"method","name":"handleListItemClick","privacy":"private","parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"select","privacy":"private","parameters":[{"name":"value","type":{"text":"string"}}],"description":"Applies a user selection of `value` (toggle in `multiple` mode) and fires `selection-change`."},{"kind":"method","name":"handleKeydown","privacy":"private","parameters":[{"name":"event","type":{"text":"KeyboardEvent"}}]},{"kind":"method","name":"dispatchSelectionChangeEvent","privacy":"private"},{"kind":"method","name":"syncPaddingClasses","privacy":"private","description":"Flush lists (no vertical padding) let the first and last rows take the list's corner radius."},{"kind":"method","name":"_initComponent","description":"private function used for demo project in some edge case need to refresh component"}],"events":[{"name":"selection-change","type":{"text":"CustomEvent<SelectionChangeEventDetail>"},"description":"Fired after the user changes the selection. `detail.value` is the array of selected values, `detail.data` the matching `data` of each row. Does not bubble: several components fire `selection-change`, so a listener belongs on the element itself rather than on an ancestor."}],"attributes":[{"name":"value","type":{"text":"string[]"},"default":"[]","description":"Selected values. Written as `value=\"a;b\"` in markup, read as `['a', 'b']` from the property.","fieldName":"value"},{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Dims the whole list and ignores clicks and keyboard.","fieldName":"disabled"},{"name":"multiple","type":{"text":"boolean"},"default":"false","description":"Allow several rows to be selected; clicking a selected row deselects it.","fieldName":"multiple"},{"name":"required","type":{"text":"boolean"},"default":"false","description":"Keep at least one row selected: clicking the only selected row does nothing.","fieldName":"required"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-list","customElement":true,"slotComponents":["c2-list-item"]}],"exports":[{"kind":"js","name":"List","declaration":{"name":"List","module":"src/list.ts"}},{"kind":"custom-element-definition","name":"c2-list","declaration":{"name":"List","module":"src/list.ts"}}]}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c2n/list",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "main": "dist/list.js",
6
6
  "exports": {
@@ -21,6 +21,7 @@
21
21
  "files": [
22
22
  "dist",
23
23
  "types",
24
+ "custom-elements.json",
24
25
  "react.d.ts",
25
26
  "react.js",
26
27
  "vue.d.ts",
@@ -61,13 +62,13 @@
61
62
  }
62
63
  },
63
64
  "dependencies": {
64
- "@c2n/core": "0.0.12",
65
- "@c2n/list-item": "0.0.12",
65
+ "@c2n/core": "0.0.13",
66
+ "@c2n/list-item": "0.0.13",
66
67
  "lit": "3.3.3"
67
68
  },
68
69
  "devDependencies": {
69
70
  "@c2n/config": "*"
70
71
  },
71
72
  "customElements": "custom-elements.json",
72
- "gitHead": "43e38b42ac221ffeef99a773c42dd3356961d26a"
73
+ "gitHead": "aa19b641f64fbc54c36b7649a8171d7a686abbdd"
73
74
  }