@synopackageland/ui 0.20.6 → 0.20.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.
- package/CHANGELOG.md +19 -4
- package/LICENSES/source-notices.md +110 -0
- package/README.md +1 -1
- package/dist/components/composite/form/FormItem.vue.d.ts +1 -1
- package/dist/components/composite/record-panel/recordPanelWidth.d.ts +4 -25
- package/dist/components/primitives/context-menu/ContextMenu.vue.d.ts +2 -2
- package/dist/composables/collisionBoundary.d.ts +7 -1
- package/dist/composables/elementWidth.d.ts +8 -2
- package/dist/dnd/autoScroll.d.ts +3 -22
- package/dist/dnd/dragKit.d.ts +1 -1
- package/dist/grid/cells/number.d.ts +1 -1
- package/dist/grid/cells/types.d.ts +1 -1
- package/dist/grid/clipboard/tsv.d.ts +1 -2
- package/dist/grid/contracts.d.ts +1 -1
- package/dist/grid/focus/editor-style.d.ts +1 -1
- package/dist/grid/host/controller.d.ts +11 -11
- package/dist/grid/range/block.d.ts +1 -1
- package/dist/grid-core/auto-scroll.d.ts +7 -7
- package/dist/grid-core/column-resize.d.ts +1 -1
- package/dist/grid-core/config.d.ts +1 -1
- package/dist/grid-core/keys.d.ts +2 -2
- package/dist/grid-core/renderer/layout.d.ts +1 -1
- package/dist/grid-core/selection-controller.d.ts +2 -2
- package/dist/grid-core/theme.d.ts +5 -5
- package/dist/grid.js +13 -13
- package/dist/index.js +10053 -10034
- package/dist/interaction/ime.d.ts +3 -22
- package/dist/json-preview/preview.js +8206 -8192
- package/dist/lib/adaptiveLayout.d.ts +7 -0
- package/dist/lib/fieldWidth.d.ts +2 -2
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/layout-rules.md +1 -1
- package/docs/mobile-native.md +2 -2
- package/docs/ux-grid.md +6 -8
- package/package.json +2 -3
- package/LICENSES/ux-foundation.md +0 -83
- package/LICENSES/ux-grid-baserow.md +0 -35
- package/LICENSES/ux-grid-teable.md +0 -48
- package/docs/ux-foundation.md +0 -133
package/dist/grid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @synopackageland/ui/grid
|
|
1
|
+
/*! @synopackageland/ui/grid: MIT, Copyright (c) 2023-2025 Teable, Inc. and Copyright (c) 2019-present Baserow B.V. in parts; see LICENSES/source-notices.md */
|
|
2
2
|
import { watch as ue, toValue as eo, getCurrentScope as qo, onScopeDispose as to, shallowRef as ce, defineComponent as Xo, useId as Yo, ref as xe, computed as _, onMounted as jo, onBeforeUnmount as Qo, openBlock as pe, createElementBlock as Ce, unref as J, createElementVNode as ee, toDisplayString as we, normalizeStyle as Be, Fragment as Zo, renderList as Jo, createCommentVNode as Oe, renderSlot as hn, createTextVNode as ei, inject as ti } from "vue";
|
|
3
3
|
import { useUiText as ni } from "./index.js";
|
|
4
4
|
var H = /* @__PURE__ */ ((e) => (e.Rows = "Rows", e.Columns = "Columns", e.Cells = "Cells", e.None = "None", e))(H || {}), x = /* @__PURE__ */ ((e) => (e.Cell = "Cell", e.ActiveCell = "ActiveCell", e.AppendRow = "AppendRow", e.AppendColumn = "AppendColumn", e.ColumnHeader = "ColumnHeader", e.ColumnHeaderMenu = "ColumnHeaderMenu", e.ColumnPrimaryIcon = "ColumnPrimaryIcon", e.ColumnDescription = "ColumnDescription", e.ColumnResizeHandler = "ColumnResizeHandler", e.ColumnFreezeHandler = "ColumnFreezeHandler", e.RowHeaderDragHandler = "RowHeaderDragHandler", e.RowHeaderExpandHandler = "RowHeaderExpandHandler", e.RowHeaderCheckbox = "RowHeaderCheckbox", e.RowGroupControl = "RowGroupControl", e.RowGroupHeader = "RowGroupHeader", e.RowHeader = "RowHeader", e.AllCheckbox = "AllCheckbox", e.FillHandler = "FillHandler", e.Blank = "Blank", e.None = "None", e))(x || {}), O = /* @__PURE__ */ ((e) => (e.Rows = "Rows", e.Columns = "Columns", e.None = "None", e))(O || {}), X = /* @__PURE__ */ ((e) => (e.Spacer = "Spacer", e.Drag = "Drag", e.Expand = "Expand", e.Checkbox = "Checkbox", e))(X || {}), de = /* @__PURE__ */ ((e) => (e.All = "all", e.None = "none", e.Column = "column", e.Row = "row", e))(de || {}), $ = /* @__PURE__ */ ((e) => (e.All = "all", e.None = "none", e.Column = "column", e.Row = "row", e.Cell = "cell", e))($ || {}), se = /* @__PURE__ */ ((e) => (e[e.Group = 0] = "Group", e[e.Row = 1] = "Row", e[e.Append = 2] = "Append", e))(se || {});
|
|
@@ -18,7 +18,7 @@ const B = {
|
|
|
18
18
|
columnResizeHandlerPaddingTop: 4,
|
|
19
19
|
columnFreezeHandlerWidth: 8,
|
|
20
20
|
columnFreezeHandlerHeight: 30,
|
|
21
|
-
/**
|
|
21
|
+
/** The minimum while resizing. */
|
|
22
22
|
columnMinWidth: 100,
|
|
23
23
|
cellHorizontalPadding: 8,
|
|
24
24
|
cellVerticalPaddingMD: 10,
|
|
@@ -936,7 +936,7 @@ const ma = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
936
936
|
if (o && n?.write) {
|
|
937
937
|
const a = new o({
|
|
938
938
|
"text/plain": e.then(({ text: s }) => new Blob([s], { type: "text/plain" })),
|
|
939
|
-
//
|
|
939
|
+
// Null means no HTML; an empty table keeps the blob type valid in every browser.
|
|
940
940
|
"text/html": e.then(({ text: s, html: r }) => new Blob([r ?? Ra(s)], { type: "text/html" }))
|
|
941
941
|
});
|
|
942
942
|
return n.write([a]);
|
|
@@ -2279,7 +2279,7 @@ class Rs {
|
|
|
2279
2279
|
/**
|
|
2280
2280
|
* Touch on a grid no wider than 640 px. There a tap opens the record (the
|
|
2281
2281
|
* cell and its editor cannot fit beside the keyboard), the row header shows
|
|
2282
|
-
* numbers only and no column is frozen
|
|
2282
|
+
* numbers only and no column is frozen.
|
|
2283
2283
|
*/
|
|
2284
2284
|
get isPhone() {
|
|
2285
2285
|
return !!this.config.touch && this.width > 0 && this.width <= Ss;
|
|
@@ -2315,7 +2315,7 @@ class Rs {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
/**
|
|
2317
2317
|
* Frozen columns that fit: the scrolling part keeps at least 240 px, so on a
|
|
2318
|
-
* phone a wide first column stops freezing
|
|
2318
|
+
* phone a wide first column stops freezing.
|
|
2319
2319
|
*/
|
|
2320
2320
|
freezeCount(t) {
|
|
2321
2321
|
const { columns: n } = this.config, o = Math.min(t, n.length);
|
|
@@ -2398,7 +2398,7 @@ class Rs {
|
|
|
2398
2398
|
height: this.coord.getRowHeight(o)
|
|
2399
2399
|
};
|
|
2400
2400
|
}
|
|
2401
|
-
/** Minimal scroll that shows the cell with
|
|
2401
|
+
/** Minimal scroll that shows the cell with a 16 px buffer; instant. */
|
|
2402
2402
|
scrollToCell(t) {
|
|
2403
2403
|
const [n, o] = t, { coord: i } = this, a = B.cellScrollBuffer;
|
|
2404
2404
|
let { scrollLeft: s, scrollTop: r } = this.scroll;
|
|
@@ -2434,7 +2434,7 @@ class Rs {
|
|
|
2434
2434
|
get isFillEnabled() {
|
|
2435
2435
|
return !!this.config.fillable && !this.config.readonly && this.config.selectable !== "none" && !this.config.touch;
|
|
2436
2436
|
}
|
|
2437
|
-
/** No resize handle on touch: a 5 px edge is no finger target
|
|
2437
|
+
/** No resize handle on touch: a 5 px edge is no finger target. */
|
|
2438
2438
|
get isResizeEnabled() {
|
|
2439
2439
|
return this.config.columnResizable && !this.config.touch;
|
|
2440
2440
|
}
|
|
@@ -2579,11 +2579,11 @@ class Rs {
|
|
|
2579
2579
|
* The tapped row or header keeps a pressed tint until `clearTapFeedback`.
|
|
2580
2580
|
*
|
|
2581
2581
|
* - A cell on a phone (`isPhone`): selects it and opens the record
|
|
2582
|
-
* (`rowExpand` with the column)
|
|
2582
|
+
* (`rowExpand` with the column).
|
|
2583
2583
|
* - A cell on a wider touch screen: the first tap selects it, a second tap
|
|
2584
2584
|
* on the selected cell asks for an edit (`tap` trigger).
|
|
2585
|
-
* - A header with a menu opens the menu
|
|
2586
|
-
*
|
|
2585
|
+
* - A header with a menu opens the menu (the 16 px chevron is no finger
|
|
2586
|
+
* target); without one it selects the column.
|
|
2587
2587
|
* - The row header is one target: on a phone it opens the record; wider, it
|
|
2588
2588
|
* expands the row with the `expand` control, else toggles the checkbox.
|
|
2589
2589
|
*
|
|
@@ -2648,7 +2648,7 @@ class Rs {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
/**
|
|
2650
2650
|
* After an edit of `cell` commits: Enter moves down, Tab right, Shift+Tab
|
|
2651
|
-
* left
|
|
2651
|
+
* left, from the edited cell.
|
|
2652
2652
|
*/
|
|
2653
2653
|
moveAfterEdit(t, n) {
|
|
2654
2654
|
const { rowCount: o, columns: i } = this.config;
|
|
@@ -3619,7 +3619,7 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3619
3619
|
});
|
|
3620
3620
|
},
|
|
3621
3621
|
describe: (e, { labels: t }) => e.value ? t.checked : t.unchecked,
|
|
3622
|
-
//
|
|
3622
|
+
// The icon box is hit exactly, plus 4 px around it (a 24 px target at 16 px).
|
|
3623
3623
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3624
3624
|
if (e.readonly) return null;
|
|
3625
3625
|
const i = Xn(n.width, n.height, o), a = { x: i.x - 4, y: Math.max(0, i.y - 4), width: i.width + 8, height: Math.min(n.height, i.height + 8) };
|
|
@@ -3634,7 +3634,7 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3634
3634
|
er(e, c, s, a, n.value > l ? i.ratingOn : i.ratingOff), c += a + At;
|
|
3635
3635
|
},
|
|
3636
3636
|
describe: (e, { labels: t }) => e.value > 0 ? yo(t.rating, { value: e.value, max: st(e) }) : "",
|
|
3637
|
-
// Click the n-th star: value n; click the current value again: clear
|
|
3637
|
+
// Click the n-th star: value n; click the current value again: clear.
|
|
3638
3638
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3639
3639
|
if (e.readonly) return null;
|
|
3640
3640
|
const i = o.icon + At, a = st(e), s = { x: o.padding, y: Math.max(0, n.height / 2 - o.icon), width: a * i, height: Math.min(n.height, 2 * o.icon) };
|