@neovici/cosmoz-treenode-navigator 8.2.0 → 8.3.1
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.
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# cosmoz-treenode-navigator
|
|
2
2
|
|
|
3
|
-
[](https://github.com/semantic-release/semantic-release)
|
|
3
|
+
[](https://github.com/Neovici/cosmoz-treenode-navigator/actions?workflow=CI)
|
|
5
4
|
|
|
6
5
|
A [PionJS](https://github.com/nicholaspmccracken/pion)-based web component for navigating, searching, and selecting nodes in a hierarchical tree structure.
|
|
7
6
|
|
|
@@ -95,14 +94,15 @@ A trigger button that opens a dialog containing the tree navigator. This is the
|
|
|
95
94
|
|
|
96
95
|
#### Properties / Attributes
|
|
97
96
|
|
|
98
|
-
| Property | Attribute | Type | Default
|
|
99
|
-
| ----------------------- | ------------------- | --------- |
|
|
100
|
-
| `tree` | -- | `Tree` | --
|
|
101
|
-
| `nodePath` | -- | `string` | `''`
|
|
102
|
-
| `opened` | -- | `boolean` | `false`
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
97
|
+
| Property | Attribute | Type | Default | Description |
|
|
98
|
+
| ----------------------- | ------------------- | --------- | ------------- | --------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| `tree` | -- | `Tree` | -- | The tree data structure (set via JS) |
|
|
100
|
+
| `nodePath` | -- | `string` | `''` | Selected node's path locator (two-way bindable) |
|
|
101
|
+
| `opened` | -- | `boolean` | `false` | Whether the dialog is open (two-way bindable) |
|
|
102
|
+
| `variant` | `variant` | `string` | `'secondary'` | Button variant for the open trigger (`'primary'`, `'secondary'`, `'tertiary'`, `'destructive'`, `'link'`) |
|
|
103
|
+
| `showReset` | `show-reset` | `boolean` | `false` | Show the reset/clear button |
|
|
104
|
+
| `searchMinLength` | `search-min-length` | `number` | `3` | Minimum characters to trigger search |
|
|
105
|
+
| `searchDebounceTimeout` | -- | `number` | `500` | Debounce timeout (ms) before search triggers |
|
|
106
106
|
|
|
107
107
|
#### Events
|
|
108
108
|
|
|
@@ -134,6 +134,14 @@ A trigger button that opens a dialog containing the tree navigator. This is the
|
|
|
134
134
|
| `select-button` | The "Select" confirmation button |
|
|
135
135
|
| `cancel-button` | The "Cancel" button |
|
|
136
136
|
|
|
137
|
+
The open button also exports the inner `cosmoz-button`'s `button` part as `action-open-button`, allowing consumers to style the native button element through the component boundary:
|
|
138
|
+
|
|
139
|
+
```css
|
|
140
|
+
cosmoz-treenode-button-view::part(action-open-button) {
|
|
141
|
+
/* styles applied to the open button's inner button part */
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
137
145
|
#### Container Query Support
|
|
138
146
|
|
|
139
147
|
The host element is declared as a CSS container (`container-type: inline-size`). When the component's width shrinks to 80px or less, the selected node path text is automatically hidden, leaving only the icon. This allows graceful degradation in narrow layouts without media queries.
|
|
@@ -279,6 +287,7 @@ All buttons have been converted to `cosmoz-button` components. Update any CSS se
|
|
|
279
287
|
| `npm run test:watch` | Run tests in watch mode |
|
|
280
288
|
| `npm run lint` | Lint with ESLint |
|
|
281
289
|
| `npm run build` | Compile TypeScript |
|
|
290
|
+
| `npm run changeset` | Create a changeset for version bump |
|
|
282
291
|
| `npm run storybook:build` | Build static Storybook |
|
|
283
292
|
|
|
284
293
|
Tests use [Vitest](https://vitest.dev/) with two projects: `unit` (jsdom) for helper function tests, and `storybook` (Playwright browser mode) for component interaction tests via Storybook play functions.
|
|
@@ -26,7 +26,7 @@ const defaultIcon = html `<svg
|
|
|
26
26
|
<circle cx="17" cy="17" r="2" />
|
|
27
27
|
<path d="M7 9v3c0 1.66 1.34 3 3 3h7" />
|
|
28
28
|
</svg>`;
|
|
29
|
-
const CosmozNodeButtonView = ({ tree, showReset = false, searchMinLength = 3, searchDebounceTimeout = 500, }) => {
|
|
29
|
+
const CosmozNodeButtonView = ({ tree, showReset = false, searchMinLength = 3, searchDebounceTimeout = 500, variant = 'secondary', }) => {
|
|
30
30
|
const dialogRef = useRef(null);
|
|
31
31
|
const tooltipTimeoutRef = useRef();
|
|
32
32
|
// nodePath is the single source of truth - external two-way binding
|
|
@@ -124,11 +124,12 @@ const CosmozNodeButtonView = ({ tree, showReset = false, searchMinLength = 3, se
|
|
|
124
124
|
.disabled=${tooltipDisabled}
|
|
125
125
|
>
|
|
126
126
|
<cosmoz-button
|
|
127
|
-
variant
|
|
127
|
+
variant=${variant}
|
|
128
128
|
full-width
|
|
129
129
|
data-testid="open-button"
|
|
130
130
|
@click=${onOpen}
|
|
131
131
|
part="action-open"
|
|
132
|
+
exportparts="button:action-open-button"
|
|
132
133
|
>
|
|
133
134
|
<slot name="prefix" slot="prefix">${defaultIcon}</slot>
|
|
134
135
|
<div class="path-text">
|
|
@@ -198,6 +199,7 @@ const CosmozNodeButtonView = ({ tree, showReset = false, searchMinLength = 3, se
|
|
|
198
199
|
CosmozNodeButtonView.observedAttributes = [
|
|
199
200
|
'show-reset',
|
|
200
201
|
'search-min-length',
|
|
202
|
+
'variant',
|
|
201
203
|
];
|
|
202
204
|
customElements.define('cosmoz-treenode-button-view', component(CosmozNodeButtonView, {
|
|
203
205
|
styleSheets: [style],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmoz-treenode-button-view.js","sourceRoot":"","sources":["../src/cosmoz-treenode-button-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,IAAI,EACJ,SAAS,EACT,OAAO,EACP,WAAW,EACX,MAAM,EACN,QAAQ,GACR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,MAAM,sCAAsC,CAAC;AAEzD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,yBAAyB,CAAC;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MAAM;;;;yCAIqB,WAAW;;cAEtC,WAAW;;;;;KAKpB,IAAI,CACL,SAAS,IAAI,CAAC,CAAC,QAAQ,EACvB,GAAG,EAAE,CACJ,IAAI,CAAA;;eAEM,KAAK;;;;QAIZ,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sBACX,CAClB;;;;;;KAMC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACZ,SAAS,CAAC,OAAO,GAAG,EAAsB,CAAC;IAC5C,CAAC,CAAC;;sCAEiC,iBAAiB;yBAC9B,CAAC,CAAC,0CAA0C,CAAC;;;;;iBAKrD,QAAQ;0BACC,iBAAiB;sCACL,4BAA4B;wBAC1C,eAAe;8BACT,qBAAqB;aACtC,IAAI;eACF,MAAM;;;;;;;;;kBASH,CAAC,mBAAmB;eACvB,QAAQ;;;;QAIf,CAAC,CAAC,QAAQ,CAAC;;;;eAIJ,OAAO;;;;QAId,CAAC,CAAC,QAAQ,CAAC;;;;;EAKjB,CAAC;AACH,CAAC,CAAC;AAEF,oBAAoB,CAAC,kBAAkB,GAAG;IACzC,YAAY;IACZ,mBAAmB;IACnB,SAAS;CACwB,CAAC;AAEnC,cAAc,CAAC,MAAM,CACpB,6BAA6B,EAC7B,SAAS,CAAC,oBAAoB,EAAE;IAC/B,WAAW,EAAE,CAAC,KAAK,CAAC;CACpB,CAAC,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-treenode-navigator",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Pion component that lets you navigate and search through hierarchically structured data-nodes and select one of them.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,38 +39,15 @@
|
|
|
39
39
|
"test:watch": "vitest",
|
|
40
40
|
"prepare": "husky",
|
|
41
41
|
"build": "tsc",
|
|
42
|
+
"changeset": "changeset",
|
|
42
43
|
"storybook:start": "storybook dev -p 8000",
|
|
43
44
|
"storybook:build": "storybook build",
|
|
44
45
|
"storybook:deploy": "storybook-to-ghpages",
|
|
45
46
|
"storybook:preview": "npm run storybook:build && http-server ./storybook-static/ --silent"
|
|
46
47
|
},
|
|
47
|
-
"release": {
|
|
48
|
-
"plugins": [
|
|
49
|
-
"@semantic-release/commit-analyzer",
|
|
50
|
-
"@semantic-release/release-notes-generator",
|
|
51
|
-
"@semantic-release/changelog",
|
|
52
|
-
"@semantic-release/github",
|
|
53
|
-
"@semantic-release/npm",
|
|
54
|
-
"@semantic-release/git"
|
|
55
|
-
],
|
|
56
|
-
"branch": "master",
|
|
57
|
-
"preset": "conventionalcommits"
|
|
58
|
-
},
|
|
59
48
|
"publishConfig": {
|
|
60
49
|
"access": "public"
|
|
61
50
|
},
|
|
62
|
-
"commitlint": {
|
|
63
|
-
"extends": [
|
|
64
|
-
"@commitlint/config-conventional"
|
|
65
|
-
],
|
|
66
|
-
"rules": {
|
|
67
|
-
"body-max-line-length": [
|
|
68
|
-
1,
|
|
69
|
-
"always",
|
|
70
|
-
600
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
51
|
"exports": {
|
|
75
52
|
".": {
|
|
76
53
|
"types": "./dist/cosmoz-treenode-navigator.d.ts",
|
|
@@ -99,12 +76,9 @@
|
|
|
99
76
|
"lit-html": "^2.0.0 || ^3.0.0"
|
|
100
77
|
},
|
|
101
78
|
"devDependencies": {
|
|
102
|
-
"@
|
|
103
|
-
"@commitlint/config-conventional": "^20.0.0",
|
|
79
|
+
"@changesets/cli": "^3.0.0",
|
|
104
80
|
"@neovici/cfg": "^2.8.0",
|
|
105
|
-
"@playwright/test": "
|
|
106
|
-
"@semantic-release/changelog": "^6.0.0",
|
|
107
|
-
"@semantic-release/git": "^10.0.0",
|
|
81
|
+
"@playwright/test": "1.60.0",
|
|
108
82
|
"@storybook/addon-docs": "^10.0.0",
|
|
109
83
|
"@storybook/addon-vitest": "^10.2.4",
|
|
110
84
|
"@storybook/web-components-vite": "^10.2.4",
|
|
@@ -117,13 +91,9 @@
|
|
|
117
91
|
"lint-staged": "^16.2.7",
|
|
118
92
|
"lit": "^3.2.1",
|
|
119
93
|
"remark-gfm": "^4.0.1",
|
|
120
|
-
"semantic-release": "^25.0.0",
|
|
121
94
|
"shadow-dom-testing-library": "^1.13.1",
|
|
122
95
|
"storybook": "^10.0.0",
|
|
123
96
|
"typescript": "^5.8.2",
|
|
124
97
|
"vitest": "^4.0.18"
|
|
125
|
-
},
|
|
126
|
-
"overrides": {
|
|
127
|
-
"conventional-changelog-conventionalcommits": ">= 8.0.0"
|
|
128
98
|
}
|
|
129
99
|
}
|