@jungherz-de/notionkit-elements 1.5.3 → 1.6.0
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 +25 -16
- package/dist/components/base.js +346 -0
- package/dist/components/nk-ai-input-row.js +2 -1
- package/dist/components/nk-ai-msg.js +10 -3
- package/dist/components/nk-ai-thread.js +2 -1
- package/dist/components/nk-app.js +2 -1
- package/dist/components/nk-avatar-group.js +2 -1
- package/dist/components/nk-avatar.js +57 -0
- package/dist/components/nk-banner.js +2 -1
- package/dist/components/nk-block-host.js +2 -1
- package/dist/components/nk-board-view.js +4 -2
- package/dist/components/nk-breadcrumb.js +2 -1
- package/dist/components/nk-btn.js +2 -1
- package/dist/components/nk-callout.js +2 -1
- package/dist/components/nk-check.js +2 -1
- package/dist/components/nk-cmdk.js +2 -1
- package/dist/components/nk-code.js +2 -1
- package/dist/components/nk-comment.js +9 -6
- package/dist/components/nk-comments.js +2 -1
- package/dist/components/nk-danger-zone.js +2 -1
- package/dist/components/nk-database.js +2 -1
- package/dist/components/nk-divider.js +2 -1
- package/dist/components/nk-emoji-picker.js +2 -1
- package/dist/components/nk-empty.js +2 -1
- package/dist/components/nk-field.js +2 -1
- package/dist/components/nk-fields.js +2 -1
- package/dist/components/nk-filter-bar.js +2 -1
- package/dist/components/nk-heading.js +2 -1
- package/dist/components/nk-input.js +2 -1
- package/dist/components/nk-kbd.js +2 -1
- package/dist/components/nk-list-view.js +96 -0
- package/dist/components/nk-member-list.js +2 -1
- package/dist/components/nk-member-row.js +10 -6
- package/dist/components/nk-mention.js +2 -1
- package/dist/components/nk-menu-item.js +23 -3
- package/dist/components/nk-menu.js +2 -1
- package/dist/components/nk-modal.js +2 -1
- package/dist/components/nk-model-card.js +2 -1
- package/dist/components/nk-page-actions.js +2 -1
- package/dist/components/nk-page-cover.js +12 -11
- package/dist/components/nk-page-title.js +2 -1
- package/dist/components/nk-page.js +12 -4
- package/dist/components/nk-panel.js +61 -0
- package/dist/components/nk-panels.js +18 -0
- package/dist/components/nk-pop.js +2 -1
- package/dist/components/nk-profile-row.js +2 -1
- package/dist/components/nk-progress.js +5 -2
- package/dist/components/nk-prop.js +54 -0
- package/dist/components/nk-props.js +21 -0
- package/dist/components/nk-quote.js +2 -1
- package/dist/components/nk-radio.js +2 -1
- package/dist/components/nk-section-label.js +2 -1
- package/dist/components/nk-segmented.js +2 -1
- package/dist/components/nk-select.js +2 -1
- package/dist/components/nk-settings-pane.js +2 -1
- package/dist/components/nk-settings-user.js +2 -1
- package/dist/components/nk-sidebar.js +2 -1
- package/dist/components/nk-skeleton.js +2 -1
- package/dist/components/nk-slider.js +2 -1
- package/dist/components/nk-stat.js +2 -1
- package/dist/components/nk-stats.js +2 -1
- package/dist/components/nk-switch.js +2 -1
- package/dist/components/nk-synced.js +2 -1
- package/dist/components/nk-tab-bar-item.js +2 -1
- package/dist/components/nk-tab-bar.js +2 -1
- package/dist/components/nk-tab.js +2 -1
- package/dist/components/nk-table-view.js +6 -2
- package/dist/components/nk-tabs.js +2 -1
- package/dist/components/nk-tag.js +2 -1
- package/dist/components/nk-template-btn.js +2 -1
- package/dist/components/nk-textarea.js +2 -1
- package/dist/components/nk-theme-toggle.js +2 -1
- package/dist/components/nk-toast.js +2 -1
- package/dist/components/nk-todo.js +2 -1
- package/dist/components/nk-toggle.js +2 -1
- package/dist/components/nk-topbar.js +2 -1
- package/dist/components/nk-tree-item.js +2 -1
- package/dist/components/nk-tree.js +2 -1
- package/dist/components/nk-workspace-switcher.js +2 -1
- package/dist/components/shared/avatar-BiqCaHOt.js +19 -0
- package/dist/components/shared/{property-cell-CtXQpUjQ.js → property-cell-o7N30kAQ.js} +8 -3
- package/dist/notionkit-elements.esm.js +374 -34
- package/dist/notionkit-elements.js +380 -33
- package/dist/notionkit-elements.min.js +1 -1
- package/package.json +4 -3
- package/src/components/content/nk-progress.js +3 -1
- package/src/components/data/nk-ai-msg.js +8 -2
- package/src/components/data/nk-comment.js +7 -5
- package/src/components/data/nk-list-view.js +93 -0
- package/src/components/data/nk-table-view.js +2 -0
- package/src/components/overlays/nk-menu-item.js +21 -2
- package/src/components/page/nk-avatar.js +55 -0
- package/src/components/page/nk-member-row.js +8 -5
- package/src/components/page/nk-page-cover.js +10 -10
- package/src/components/page/nk-page.js +10 -3
- package/src/components/page/nk-panel.js +59 -0
- package/src/components/page/nk-panels.js +16 -0
- package/src/components/page/nk-prop.js +52 -0
- package/src/components/page/nk-props.js +19 -0
- package/src/index.js +14 -0
- package/src/util/avatar.js +17 -0
- package/src/util/property-cell.js +7 -3
- package/dist/components/shared/base-C3eJwHKA.js +0 -366
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
3
|
+
|
|
4
|
+
// <nk-prop label="Due" icon="📅">2 June 2026</nk-prop>
|
|
5
|
+
// → <div class="nk-prop"><dt class="p-name"><span class="p-icon">📅</span>Due</dt><dd class="p-value">2 June 2026</dd></div>
|
|
6
|
+
// The value is the element's content – tags, an avatar and a name, a date, a
|
|
7
|
+
// <nk-progress wide>. slot="icon" replaces the icon glyph. A click on the
|
|
8
|
+
// name or the value fires nk-action { action: 'name' | 'value', label }, the
|
|
9
|
+
// moment Notion opens the property's editor.
|
|
10
|
+
class NkProp extends NkElement {
|
|
11
|
+
static get observedAttributes() { return ['label', 'icon']; }
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
this._row = this.createElement('div', ['nk-prop']);
|
|
15
|
+
this._name = this.createElement('dt', ['p-name']);
|
|
16
|
+
this._icon = this.createElement('span', ['p-icon']);
|
|
17
|
+
const iconSlot = this.createElement('slot', [], { name: 'icon' });
|
|
18
|
+
iconSlot.appendChild(this._icon);
|
|
19
|
+
this._label = document.createTextNode('');
|
|
20
|
+
this._name.append(iconSlot, this._label);
|
|
21
|
+
this._value = this.createElement('dd', ['p-value']);
|
|
22
|
+
this._value.appendChild(document.createElement('slot'));
|
|
23
|
+
this._row.append(this._name, this._value);
|
|
24
|
+
this._wrapper.appendChild(this._row);
|
|
25
|
+
this._sync();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_sync() {
|
|
29
|
+
const icon = this.getAttribute('icon');
|
|
30
|
+
this._icon.textContent = icon || '';
|
|
31
|
+
this._icon.style.display = icon ? '' : 'none';
|
|
32
|
+
this._label.data = this.getAttribute('label') || '';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
setupEvents() {
|
|
36
|
+
this._onClick = (e) => {
|
|
37
|
+
const part = e.composedPath().includes(this._name) ? 'name' : 'value';
|
|
38
|
+
this.emit('nk-action', { action: part, label: this.label });
|
|
39
|
+
};
|
|
40
|
+
this._row.addEventListener('click', this._onClick);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
teardownEvents() { this._row?.removeEventListener('click', this._onClick); }
|
|
44
|
+
onAttributeChanged() { this._sync(); }
|
|
45
|
+
|
|
46
|
+
get label() { return this.getAttribute('label') || ''; }
|
|
47
|
+
set label(v) { this.setAttribute('label', v); }
|
|
48
|
+
get icon() { return this.getAttribute('icon'); }
|
|
49
|
+
set icon(v) { v == null ? this.removeAttribute('icon') : this.setAttribute('icon', v); }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
customElements.define('nk-prop', NkProp);
|
|
53
|
+
|
|
54
|
+
export { NkProp };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
3
|
+
|
|
4
|
+
// <nk-props>
|
|
5
|
+
// <nk-prop label="Status" icon="◉"><nk-tag color="blue">In progress</nk-tag></nk-prop>
|
|
6
|
+
// <nk-prop label="Owner" icon="👤"><nk-avatar size="small">MK</nk-avatar>Marcel Karas</nk-prop>
|
|
7
|
+
// </nk-props>
|
|
8
|
+
// → <dl class="nk-props">…</dl> – the properties under a page title. The rows
|
|
9
|
+
// are <nk-prop> hosts with display: contents, so each .nk-prop is a row of
|
|
10
|
+
// this list.
|
|
11
|
+
class NkProps extends NkElement {
|
|
12
|
+
render() {
|
|
13
|
+
const list = this.createElement('dl', ['nk-props']);
|
|
14
|
+
list.appendChild(document.createElement('slot'));
|
|
15
|
+
this._wrapper.appendChild(list);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('nk-props', NkProps);
|
|
20
|
+
|
|
21
|
+
export { NkProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-quote cite="Ada Lovelace">The Analytical Engine weaves…</nk-quote>
|
|
4
5
|
// .q-cite has no ::slotted() twin, so the citation is rendered here.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkFormElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-radio name="style" value="concise" checked>Concise</nk-radio>
|
|
4
5
|
// → <label class="nk-check"><input type="radio"> Concise</label>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-section-label addable>Favourites</nk-section-label>
|
|
4
5
|
// → <div class="nk-section-label">Favourites <span class="plus">+</span></div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkFormElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-segmented name="range" value="week">
|
|
4
5
|
// <button value="week">Week</button><button value="month">Month</button>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-settings-pane name="profile" label="My profile" icon="👤" group="Account" title="My profile" active>…</nk-settings-pane>
|
|
4
5
|
// `title` is the heading, never a tooltip – see NkElement.takeTitle().
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-settings-user slot="user" name="Marcel Karas" mail="marcel@…" avatar="MK"></nk-settings-user>
|
|
4
5
|
// → <div class="nk-settings-user"><div class="avatar">MK</div><div class="u-text"><div class="name">…</div><div class="mail">…</div></div></div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-sidebar slot="sidebar">
|
|
4
5
|
// <nk-workspace-switcher slot="workspace" name="Acme"></nk-workspace-switcher>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-skeleton height="18" width="60%"></nk-skeleton>
|
|
4
5
|
// <nk-skeleton lines="3" widths="100%,85%,40%"></nk-skeleton>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkFormElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-slider name="size" min="12" max="18" value="14" show-value></nk-slider>
|
|
4
5
|
// → <input type="range" class="nk-slider"> <div class="nk-slider-value">14</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-stat label="Active pages" value="128" delta="▲ 12 this week" trend="up"></nk-stat>
|
|
4
5
|
// → <div class="nk-stat"><div class="s-label">…</div><div class="s-value">…</div><div class="s-delta up">…</div></div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkFormElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-switch name="notify" checked></nk-switch>
|
|
4
5
|
// → <button class="nk-switch" role="switch" aria-checked="true">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-synced badge="⟳ 3 places">…</nk-synced>
|
|
4
5
|
// → <div class="nk-synced"><span class="synced-badge">⟳ 3 places</span>…</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-tab-bar-item icon="📥" value="inbox" active>Inbox</nk-tab-bar-item>
|
|
4
5
|
// → <button class="nk-tab-bar-item active" type="button">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-tab value="notes" active>📝 Notes</nk-tab> → <span class="nk-tab active" role="tab">
|
|
4
5
|
class NkTab extends NkElement {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as compareBy, r as renderPropertyCell } from './shared/property-cell-
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import { c as compareBy, r as renderPropertyCell } from './shared/property-cell-o7N30kAQ.js';
|
|
3
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
4
|
+
import './shared/avatar-BiqCaHOt.js';
|
|
3
5
|
|
|
4
6
|
// <nk-table-view name="table" label="▦ Table" count new-row sortable wrap></nk-table-view>
|
|
5
7
|
// `wrap` lets cell text break (`.nk-table.wrap`), like Notion's "wrap column".
|
|
@@ -50,6 +52,8 @@ class NkTableView extends NkElement {
|
|
|
50
52
|
const r = this.createElement('tr', [], { 'data-id': row.id ?? '' });
|
|
51
53
|
for (const col of this._columns) {
|
|
52
54
|
const td = document.createElement('td');
|
|
55
|
+
// Numbers right-aligned in figures of equal width, as Notion sets them.
|
|
56
|
+
if (col.type === 'number') td.className = 'num';
|
|
53
57
|
td.appendChild(renderPropertyCell(col, row[col.key], row));
|
|
54
58
|
r.appendChild(td);
|
|
55
59
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-tag color="blue">Text</nk-tag> — modifier class .blue becomes color="blue".
|
|
4
5
|
// Notion's nine select colours; without `color` the stylesheet draws the grey tag.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-template-btn icon="📅" value="week-plan">Insert week plan</nk-template-btn>
|
|
4
5
|
// → <button class="nk-template-btn">📅 Insert week plan</button>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkFormElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-textarea name="bio" rows="3" wide>Text</nk-textarea> → <textarea class="nk-textarea wide">
|
|
4
5
|
// The initial value is the `value` attribute, or the element's text content.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement, getCurrentTheme } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-theme-toggle slot="actions"></nk-theme-toggle>
|
|
4
5
|
// → <button class="nk-topbar-btn nk-theme-toggle">🌙</button>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkFormElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-todo name="task" value="1" checked>Write the docs</nk-todo>
|
|
4
5
|
// → <label class="nk-todo"><input type="checkbox"><span>Write the docs</span></label>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NkElement } from './base.js';
|
|
2
|
+
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
2
3
|
|
|
3
4
|
// <nk-toggle label="Details" open>Body…</nk-toggle>
|
|
4
5
|
// → <details class="nk-toggle" open><summary>Details</summary><div class="toggle-body">…</div></details>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Shared by every element that draws an avatar: nk-avatar itself, member
|
|
2
|
+
// rows, comments and the person cells of a database view.
|
|
3
|
+
const AVATAR_COLORS = ['gray', 'brown', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'red'];
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Paints an .nk-avatar. One of Notion's nine colour names becomes its class,
|
|
7
|
+
* so the tokens decide the shade in each theme; any other value – a hex, a
|
|
8
|
+
* gradient, a var() – is taken as an inline background, as before 1.6.0.
|
|
9
|
+
* Without a colour the avatar keeps the stylesheet's gradient.
|
|
10
|
+
*/
|
|
11
|
+
function paintAvatar(el, color) {
|
|
12
|
+
for (const c of AVATAR_COLORS) el.classList.toggle(c, c === color);
|
|
13
|
+
el.style.background = color && !AVATAR_COLORS.includes(color) ? color : '';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** "Sara Lindt" → "SL". */
|
|
17
|
+
const initialsOf = name => String(name || '').split(/\s+/).map(w => w[0]).filter(Boolean).join('').slice(0, 2).toUpperCase();
|
|
18
|
+
|
|
19
|
+
export { initialsOf as i, paintAvatar as p };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { i as initialsOf, p as paintAvatar } from './avatar-BiqCaHOt.js';
|
|
2
|
+
|
|
1
3
|
// Polymorphic property renderer for database views. Returns plain DOM built
|
|
2
4
|
// from NotionKit classes – deliberately not a custom element: every cell rule
|
|
3
5
|
// starts with `.nk-table`, so a cell inside its own shadow root would never
|
|
@@ -5,6 +7,7 @@
|
|
|
5
7
|
//
|
|
6
8
|
// column: { key, label, type, icon, options: [{ value, label, color }], title }
|
|
7
9
|
// types: text | select | multi-select | date | person | checkbox | url | number | progress
|
|
10
|
+
|
|
8
11
|
const el = (tag, cls, text) => { const n = document.createElement(tag); if (cls) n.className = cls; if (text != null) n.textContent = text; return n; };
|
|
9
12
|
const COLORS = ['gray', 'brown', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'red'];
|
|
10
13
|
|
|
@@ -38,14 +41,16 @@ function renderPropertyCell(column, value, row = {}) {
|
|
|
38
41
|
case 'person': {
|
|
39
42
|
const cell = el('span', 'person-cell');
|
|
40
43
|
const p = typeof value === 'string' ? { name: value } : value;
|
|
41
|
-
|
|
42
|
-
avatar
|
|
44
|
+
// color: one of Notion's nine names, or any CSS background; none – the avatar gradient.
|
|
45
|
+
const avatar = el('span', 'nk-avatar small', p.initials || p.avatar || initialsOf(p.name));
|
|
46
|
+
paintAvatar(avatar, p.color);
|
|
43
47
|
cell.append(avatar, document.createTextNode(' ' + (p.name || '')));
|
|
44
48
|
return cell;
|
|
45
49
|
}
|
|
46
50
|
case 'checkbox': return checkbox(column, !!value, row);
|
|
47
51
|
case 'url': { const a = el('a', null, String(value).replace(/^https?:\/\//, '')); a.href = String(value); a.target = '_blank'; a.rel = 'noopener'; return a; }
|
|
48
|
-
|
|
52
|
+
// column.locale / column.format: Intl.NumberFormat locale and options, e.g. { minimumFractionDigits: 1 }.
|
|
53
|
+
case 'number': return el('span', null, typeof value === 'number' ? value.toLocaleString(column.locale, column.format) : String(value));
|
|
49
54
|
case 'progress': return progress(Number(value) || 0);
|
|
50
55
|
default: {
|
|
51
56
|
if (column.title) {
|