@updog/data-editor-wc 0.1.64 → 0.1.65
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 +20 -2
- package/index.d.ts +6 -1
- package/index.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,6 +120,20 @@ Use for primitive values. The element observes these and re-renders on change.
|
|
|
120
120
|
|
|
121
121
|
Everything else — objects, functions, arrays — must be set as a JS property or via `configure()`.
|
|
122
122
|
|
|
123
|
+
**Never put a callback in a template.** Set `onComplete`, `onError`, `onColumnMatch` and `onValueMatch`
|
|
124
|
+
through `configure()` or a property assignment. Written as a template binding they silently do nothing in
|
|
125
|
+
Vue and Svelte, and break the build in Angular.
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<!-- wrong -->
|
|
129
|
+
<updog-editor :onComplete="save" />
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
// right
|
|
134
|
+
editor.configure({ onComplete: save });
|
|
135
|
+
```
|
|
136
|
+
|
|
123
137
|
```js
|
|
124
138
|
const editor = document.querySelector("updog-editor");
|
|
125
139
|
editor.columns = [...];
|
|
@@ -484,9 +498,13 @@ See the [Styling reference](https://docs.updog.tech/styling/) for the full varia
|
|
|
484
498
|
Internal elements use BEM-style class names prefixed with `updog__`. Target them for deep customization:
|
|
485
499
|
|
|
486
500
|
```css
|
|
487
|
-
updog-editor .
|
|
501
|
+
updog-editor .updog-button--primary { background: purple; }
|
|
488
502
|
```
|
|
489
503
|
|
|
504
|
+
There are two prefixes, and they are not interchangeable. Editor-level structure uses `updog__`
|
|
505
|
+
(`updog__data-editor`, `updog__layout`); the controls inside it come from the UI kit and use
|
|
506
|
+
`updog-` (`updog-button`, `updog-button--primary`, `updog-text--md`).
|
|
507
|
+
|
|
490
508
|
### Global CSS interaction
|
|
491
509
|
|
|
492
510
|
Because there is no Shadow DOM, your page's global CSS applies inside the editor. If you have aggressive resets (e.g., `button { all: unset }`), scope them away from `updog-editor` descendants:
|
|
@@ -497,7 +515,7 @@ body *:not(updog-editor *) { /* your global rules */ }
|
|
|
497
515
|
|
|
498
516
|
## Notes
|
|
499
517
|
|
|
500
|
-
- Fonts are inherited from your page.
|
|
518
|
+
- Fonts are inherited from your page. If your app sets no `font-family`, the editor renders in the browser default, which is usually a serif. Set one on your app or on `updog-editor`. (`--updog-font-family` exists and defaults to system fonts, but only the grid's cell-editor input reads it.)
|
|
501
519
|
- In modal mode, the editor portals to `document.body` as a full-screen overlay. In inline mode, it renders in place with no overlay.
|
|
502
520
|
- Multiple `<updog-editor>` instances on the same page are fully independent.
|
|
503
521
|
|
package/index.d.ts
CHANGED
|
@@ -1419,6 +1419,11 @@ type DataEditorLocalStorage = false | {
|
|
|
1419
1419
|
*/
|
|
1420
1420
|
licenseGrant?: boolean;
|
|
1421
1421
|
};
|
|
1422
|
+
/**
|
|
1423
|
+
* Rendering mode. `"modal"` wraps the editor in a full-screen dialog
|
|
1424
|
+
* overlay. `"inline"` renders it directly in the DOM.
|
|
1425
|
+
*/
|
|
1426
|
+
type DataEditorMode = "modal" | "inline";
|
|
1422
1427
|
/** Shared props present in both modal and inline modes. */
|
|
1423
1428
|
type DataEditorCommonProps<TRow extends DataEditorRow = DataEditorRow> = DataEditorBaseProps<TRow> & {
|
|
1424
1429
|
/** Your Updog license key. Validated on each open. */
|
|
@@ -1576,4 +1581,4 @@ declare global {
|
|
|
1576
1581
|
}
|
|
1577
1582
|
}
|
|
1578
1583
|
|
|
1579
|
-
export type { UpdogEditorElement, UpdogEditorProps };
|
|
1584
|
+
export type { CellValidator, ChatContext, ChatErrorSummary, ChatResponseChunk, ChatRow, ChatRowStatus, ChunkSourceOptions, DataEditorChat, DataEditorColumn, DataEditorFormat, DataEditorLocalStorage, DataEditorMode, DataEditorProps, DataEditorResult, DataEditorRow, DataEditorSourceResult, DataEditorTranslations, DataEditorVariant, InitialRowChange, RemoteSource, ResultRow, UpdogEditorElement, UpdogEditorProps, UpdogError, UpdogErrorCode, ValidationError, ValueMatchInput, ValueMatchOutput };
|
package/index.js
CHANGED
|
@@ -50901,7 +50901,7 @@ var KI = {
|
|
|
50901
50901
|
prop: "mode",
|
|
50902
50902
|
type: "string"
|
|
50903
50903
|
}
|
|
50904
|
-
}, qI = class extends HTMLElement {
|
|
50904
|
+
}, qI = new Set(Object.values(KI).filter((e) => e.type === "boolean").map((e) => e.prop)), JI = (e, t) => qI.has(e) && t === "" ? !0 : t, YI = class extends HTMLElement {
|
|
50905
50905
|
_root = null;
|
|
50906
50906
|
_props = {};
|
|
50907
50907
|
_renderScheduled = !1;
|
|
@@ -50938,24 +50938,24 @@ var KI = {
|
|
|
50938
50938
|
}));
|
|
50939
50939
|
}
|
|
50940
50940
|
};
|
|
50941
|
-
for (let e of /* @__PURE__ */ "columns.primaryKey.apiKey.className.localStorage.loadData.__server.onComplete.translations.importFormats.exportFormats.remoteSources.enableDeleteRow.enableAddRow.enableCreateColumn.onColumnMatch.onValueMatch.synonyms.sampleData.rowHeight.headerHeight.locale.variant.rtl.readonly.mode.chat".split(".")) Object.defineProperty(
|
|
50941
|
+
for (let e of /* @__PURE__ */ "columns.primaryKey.apiKey.className.localStorage.loadData.__server.onComplete.translations.importFormats.exportFormats.remoteSources.enableDeleteRow.enableAddRow.enableCreateColumn.onColumnMatch.onValueMatch.synonyms.sampleData.rowHeight.headerHeight.locale.variant.rtl.readonly.mode.chat".split(".")) Object.defineProperty(YI.prototype, e, {
|
|
50942
50942
|
get() {
|
|
50943
50943
|
return this._props[e];
|
|
50944
50944
|
},
|
|
50945
50945
|
set(t) {
|
|
50946
|
-
this._props[e] = t, this._scheduleRender();
|
|
50946
|
+
this._props[e] = JI(e, t), this._scheduleRender();
|
|
50947
50947
|
},
|
|
50948
50948
|
enumerable: !0,
|
|
50949
50949
|
configurable: !0
|
|
50950
50950
|
});
|
|
50951
|
-
Object.defineProperty(
|
|
50951
|
+
Object.defineProperty(YI.prototype, "open", {
|
|
50952
50952
|
get() {
|
|
50953
50953
|
return this.hasAttribute("open");
|
|
50954
50954
|
},
|
|
50955
50955
|
set(e) {
|
|
50956
|
-
e ? this.setAttribute("open", "") : this.removeAttribute("open");
|
|
50956
|
+
JI("open", e) ? this.setAttribute("open", "") : this.removeAttribute("open");
|
|
50957
50957
|
},
|
|
50958
50958
|
enumerable: !0,
|
|
50959
50959
|
configurable: !0
|
|
50960
|
-
}), customElements.define("updog-editor",
|
|
50960
|
+
}), customElements.define("updog-editor", YI);
|
|
50961
50961
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updog/data-editor-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
4
4
|
"description": "Client-side CSV importer and spreadsheet editor as a Web Component. Drop into Vue, Angular, Svelte, or vanilla JS. Import CSV, Excel, JSON; edit 1M+ rows entirely in the browser.",
|
|
5
5
|
"author": "Mikhail Kutateladze <admin@updog.tech>",
|
|
6
6
|
"homepage": "https://updog.tech",
|