@mono-lit/helper 0.0.6 → 0.0.7
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/dist/{control-tooltip-C3rA_nSH.js → control-tooltip-CoPD37_h.js} +20 -11
- package/dist/{data-source-options-Cz9fVLK8.js → data-source-options-CS0w0wlO.js} +26 -9
- package/dist/{data-source-options-QjuI73g8.js → data-source-options-lDR-g9Eb.js} +26 -9
- package/dist/{data-source-read-FxqzQkk2.js → data-source-read-Cp_h7NIf.js} +5 -2
- package/dist/{data-source-read-i6CYSUEl.js → data-source-read-DTJ_Mnez.js} +5 -2
- package/dist/{excel-BPdDt06G.js → excel-DtRpxmxs.js} +1 -1
- package/dist/{export-DgomqI_3.js → export-D27RJa1w.js} +1 -1
- package/dist/export.js +3 -3
- package/dist/{field-tooltip-FyMi9vNM.js → field-tooltip-Csk4s2ve.js} +2 -3
- package/dist/field-tooltip-addon-B32dizW_.js +22 -0
- package/dist/{control-tooltip-7vegYmq3.js → field-tooltip-addon-CWCp19mJ.js} +36 -12
- package/dist/{field-tooltip.css_raw-DEctHXKm.js → field-tooltip.css_raw-U5UeTa2d.js} +3 -4
- package/dist/{field-validation-CHHQi1zl.js → field-validation-CFmUmuDx.js} +1 -1
- package/dist/field-validation.css_raw-Cx6SGrfP.js +178 -0
- package/dist/{form-control-core-rW2WvOcb.js → form-control-core-BbiACMtL.js} +1 -1
- package/dist/{hydration-flush-9AJE8FRl.js → hydration-flush-BaE9gN3C.js} +67 -17
- package/dist/index.js +10 -10
- package/dist/{index.node-tTkISFn2.js → index.node-Mg0Snp0t.js} +5 -5
- package/dist/index.node.js +10 -10
- package/dist/input.css_raw-Br-T8RWv.js +5 -0
- package/dist/{light-slots-BnBR29E7.js → light-slots-B5Ck0t_E.js} +1 -1
- package/dist/{light-slots-Cb6e-LU3.js → light-slots-_no0r2Z-.js} +1 -1
- package/dist/mono-button-CLkHg3WW.js +871 -0
- package/dist/{mono-button.shadow-CIBGisyo.js → mono-button.shadow-DqZMpcqY.js} +1 -1
- package/dist/{mono-data-chart-ChkelNT7.js → mono-data-chart-BAH9Zb3p.js} +2 -2
- package/dist/{mono-data-dropdown-DxpUUk2y.js → mono-data-dropdown-BsY5IuIo.js} +72 -6
- package/dist/{mono-data-grid-KDpu4d4_.js → mono-data-grid-CZFjpnOD.js} +125 -18
- package/dist/{mono-data-grid-8jmeIXUU.js → mono-data-grid-kV4jYu2g.js} +124 -17
- package/dist/{mono-element-Bc9wElPy.js → mono-element-CKcT0rwv.js} +1 -1
- package/dist/{mono-form-controller-BkMR8g14.js → mono-form-controller-BrA10erm.js} +12 -1
- package/dist/{mono-ui-KOBJcnXk.js → mono-ui-kvLVIf1V.js} +43 -15
- package/dist/{popup-portal-C8ttHDRX.js → popup-portal-CINuVjNY.js} +53 -6
- package/dist/src/components/accordion/mono-accordion.d.ts +0 -1
- package/dist/src/components/alert/mono-alert.d.ts +0 -1
- package/dist/src/components/breadcrumb/mono-breadcrumb-list.d.ts +0 -1
- package/dist/src/components/breadcrumb/mono-breadcrumb.d.ts +0 -1
- package/dist/src/components/button/mono-button-dropdown.d.ts +0 -1
- package/dist/src/components/button/mono-button.d.ts +0 -1
- package/dist/src/components/card/mono-card.d.ts +0 -1
- package/dist/src/components/chart/mono-chart-presets.d.ts +0 -4
- package/dist/src/components/chart/mono-chart.d.ts +0 -1
- package/dist/src/components/checkbox/mono-checkbox.d.ts +0 -1
- package/dist/src/components/chip/mono-chip.d.ts +0 -1
- package/dist/src/components/date/mono-date.d.ts +0 -1
- package/dist/src/components/drawer/mono-drawer.d.ts +0 -1
- package/dist/src/components/dropdown/mono-dropdown.d.ts +0 -1
- package/dist/src/components/dropdown-table/mono-dropdown-table.d.ts +0 -1
- package/dist/src/components/file-upload/mono-file-upload.d.ts +0 -1
- package/dist/src/components/filter/mono-filter-builder.d.ts +0 -1
- package/dist/src/components/input/mono-input.d.ts +0 -1
- package/dist/src/components/menu/mono-menu.d.ts +0 -1
- package/dist/src/components/modal/mono-modal.d.ts +0 -1
- package/dist/src/components/nav/mono-nav.d.ts +0 -1
- package/dist/src/components/otp/mono-otp.d.ts +0 -1
- package/dist/src/components/radio/mono-radio.d.ts +0 -1
- package/dist/src/components/rich-text-editor/mono-rich-text-editor.d.ts +0 -1
- package/dist/src/components/select/mono-select.d.ts +0 -1
- package/dist/src/components/sidebar/mono-sidebar.d.ts +0 -1
- package/dist/src/components/slider/mono-slider.d.ts +0 -1
- package/dist/src/components/switch/mono-switch.d.ts +0 -1
- package/dist/src/components/table/column-autosize.d.ts +23 -1
- package/dist/src/components/table/mono-data-grid.d.ts +6 -0
- package/dist/src/components/table/mono-table-checkbox.d.ts +0 -1
- package/dist/src/components/table/mono-table-detail.d.ts +0 -1
- package/dist/src/components/table/mono-table-empty.d.ts +0 -1
- package/dist/src/components/table/mono-table-error.d.ts +0 -1
- package/dist/src/components/table/mono-table-info.d.ts +0 -1
- package/dist/src/components/table/mono-table-loading.d.ts +0 -1
- package/dist/src/components/table/mono-table-page-size.d.ts +0 -1
- package/dist/src/components/table/mono-table-paging-group.d.ts +0 -1
- package/dist/src/components/table/mono-table-paging.d.ts +0 -1
- package/dist/src/components/table/mono-table-search.d.ts +0 -1
- package/dist/src/components/table/mono-table-sort.d.ts +0 -1
- package/dist/src/components/table/mono-table-summary.d.ts +0 -1
- package/dist/src/components/table/mono-table-th.d.ts +0 -1
- package/dist/src/components/table/table-controller-core.d.ts +2 -0
- package/dist/src/components/tabs/mono-tabs.d.ts +0 -1
- package/dist/src/components/tag-input/mono-tag-input.d.ts +0 -1
- package/dist/src/components/textarea/mono-textarea.d.ts +0 -1
- package/dist/src/components/tooltip/field-tooltip-addon.d.ts +5 -0
- package/dist/src/composables/popup-portal.d.ts +24 -1
- package/dist/{styles-BODNpZV1.js → styles-D-ergrfR.js} +1 -1
- package/dist/{tooltip-Drekihf5.js → tooltip-Cu5IrDS9.js} +1 -2
- package/dist/tooltip.js +2 -3
- package/dist/ui/accordion.js +4 -11
- package/dist/ui/alert.js +3 -10
- package/dist/ui/breadcrumb.js +4 -14
- package/dist/ui/button-dropdown.js +22 -15
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.js +4 -11
- package/dist/ui/chart.js +4 -23
- package/dist/ui/checkbox.js +4 -11
- package/dist/ui/chip.js +6 -9
- package/dist/ui/date.js +5 -12
- package/dist/ui/drawer.js +5 -12
- package/dist/ui/dropdown-table.js +89 -37
- package/dist/ui/dropdown.js +34 -21
- package/dist/ui/file-upload.js +4 -11
- package/dist/ui/filter.js +3 -10
- package/dist/ui/form.js +1 -1
- package/dist/ui/index.css +3840 -3840
- package/dist/ui/input.js +6 -13
- package/dist/ui/menu.js +4 -11
- package/dist/ui/modal.js +6 -13
- package/dist/ui/nav.js +4 -11
- package/dist/ui/otp.js +6 -13
- package/dist/ui/radio.js +4 -11
- package/dist/ui/rich-text-editor.js +4 -11
- package/dist/ui/select.js +12 -14
- package/dist/ui/shadow/accordion.js +1 -1
- package/dist/ui/shadow/alert.js +1 -1
- package/dist/ui/shadow/breadcrumb.js +1 -1
- package/dist/ui/shadow/button-dropdown.js +21 -7
- package/dist/ui/shadow/button.js +1 -1
- package/dist/ui/shadow/card.js +1 -1
- package/dist/ui/shadow/chart.js +3 -3
- package/dist/ui/shadow/checkbox.js +2 -2
- package/dist/ui/shadow/chip.js +1 -1
- package/dist/ui/shadow/date.js +4 -4
- package/dist/ui/shadow/drawer.js +2 -2
- package/dist/ui/shadow/dropdown-table.js +159 -34
- package/dist/ui/shadow/dropdown.js +31 -11
- package/dist/ui/shadow/file-upload.js +2 -2
- package/dist/ui/shadow/filter.js +1 -1
- package/dist/ui/shadow/input.js +5 -5
- package/dist/ui/shadow/menu.js +1 -1
- package/dist/ui/shadow/modal.js +3 -3
- package/dist/ui/shadow/nav.js +1 -1
- package/dist/ui/shadow/otp.js +5 -5
- package/dist/ui/shadow/radio.js +2 -2
- package/dist/ui/shadow/rich-text-editor.js +2 -2
- package/dist/ui/shadow/select.js +11 -6
- package/dist/ui/shadow/sidebar.js +2 -2
- package/dist/ui/shadow/slider.js +4 -4
- package/dist/ui/shadow/switch.js +2 -2
- package/dist/ui/shadow/table.js +84 -20
- package/dist/ui/shadow/tabs.js +1 -1
- package/dist/ui/shadow/tag-input.js +117 -21
- package/dist/ui/shadow/textarea.js +4 -4
- package/dist/ui/sidebar.js +4 -11
- package/dist/ui/slider.js +5 -12
- package/dist/ui/switch.js +4 -11
- package/dist/ui/table.js +85 -64
- package/dist/ui/tabs.js +4 -11
- package/dist/ui/tag-input.js +118 -29
- package/dist/ui/textarea.js +6 -13
- package/dist/ui/theme/luma.css +495 -495
- package/dist/ui/theme/lyra.css +495 -495
- package/dist/ui/theme/maia.css +495 -495
- package/dist/ui/theme/mira.css +495 -495
- package/dist/ui/theme/nova.css +495 -495
- package/dist/ui/theme/one.css +742 -742
- package/dist/ui/theme/rhea.css +495 -495
- package/dist/ui/theme/sera.css +495 -495
- package/dist/ui/theme/vega.css +495 -495
- package/package.json +2 -2
- package/dist/field-validation.css_raw-B3Iu33rS.js +0 -178
- package/dist/input.css_raw-CQu2fAsU.js +0 -5
- package/dist/mono-button-Cy5-Y0At.js +0 -878
- package/dist/tooltip-loader-3U9FTOXj.js +0 -20
- package/dist/tooltip-loader-Dcp9AUZn.js +0 -23
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { d as __exportAll } from "./styles-BODNpZV1.js";
|
|
2
1
|
import { n as unwrapReactive, t as resolveMaybeReactive } from "./reactive-Dtd-esHO.js";
|
|
3
2
|
import { i as registerPopupLayer, o as unregisterPopupLayer } from "./popup-stack-C64WCuXq.js";
|
|
4
|
-
import { t as loadFloatingUi } from "./tooltip-loader-Dcp9AUZn.js";
|
|
5
3
|
|
|
6
4
|
//#region src/components/tooltip/tooltip-config.ts
|
|
7
5
|
const DEFAULT_TOOLTIP_OPTIONS = {
|
|
@@ -48,16 +46,27 @@ function resolveTooltipOptions(local, anchor) {
|
|
|
48
46
|
return out;
|
|
49
47
|
}
|
|
50
48
|
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/tooltip/tooltip-loader.ts
|
|
51
|
+
/**
|
|
52
|
+
* Cached loader for the OPTIONAL `@floating-ui/dom` peer (which itself depends on
|
|
53
|
+
* `@floating-ui/core` — both are the consumer's to install).
|
|
54
|
+
*
|
|
55
|
+
* Loaded on the FIRST show, never at import: registering a tooltip in
|
|
56
|
+
* `<script setup>` costs nothing until somebody actually hovers. Externalized by
|
|
57
|
+
* `NEVER_BUNDLE` in `tsdown.config.ts`, so the consumer's bundler resolves and splits it.
|
|
58
|
+
*/
|
|
59
|
+
let _floatingPromise = null;
|
|
60
|
+
function loadFloatingUi() {
|
|
61
|
+
_floatingPromise ??= import("@floating-ui/dom").catch((err) => {
|
|
62
|
+
_floatingPromise = null;
|
|
63
|
+
throw new Error("[mono-tooltip] needs the optional peer dependencies \"@floating-ui/dom\" and \"@floating-ui/core\". Install them in your app: pnpm add @floating-ui/dom @floating-ui/core" + (err?.message ? ` (original error: ${err.message})` : ""));
|
|
64
|
+
});
|
|
65
|
+
return _floatingPromise;
|
|
66
|
+
}
|
|
67
|
+
|
|
51
68
|
//#endregion
|
|
52
69
|
//#region src/components/tooltip/control-tooltip.ts
|
|
53
|
-
var control_tooltip_exports = /* @__PURE__ */ __exportAll({
|
|
54
|
-
ANCHOR_ATTR_PREFIX: () => ANCHOR_ATTR_PREFIX,
|
|
55
|
-
controlMonoTooltip: () => controlMonoTooltip,
|
|
56
|
-
createTooltipController: () => createTooltipController,
|
|
57
|
-
destroyAllTooltipControllers: () => destroyAllTooltipControllers,
|
|
58
|
-
hasLiveDocument: () => hasLiveDocument,
|
|
59
|
-
monoTooltip: () => monoTooltip
|
|
60
|
-
});
|
|
61
70
|
/** Grace period so an INTERACTIVE tooltip can be reached across the offset gap. */
|
|
62
71
|
const INTERACTIVE_HIDE_GRACE = 120;
|
|
63
72
|
/** Longest the exit transition may take before the element is removed anyway. */
|
|
@@ -692,4 +701,4 @@ function destroyAllTooltipControllers() {
|
|
|
692
701
|
}
|
|
693
702
|
|
|
694
703
|
//#endregion
|
|
695
|
-
export {
|
|
704
|
+
export { monoTooltip as a, getMonoTooltipGlobal as c, hasLiveDocument as i, resolveTooltipOptions as l, createTooltipController as n, loadFloatingUi as o, destroyAllTooltipControllers as r, DEFAULT_TOOLTIP_OPTIONS as s, controlMonoTooltip as t, setMonoTooltipGlobal as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isPath, r as mergePatch, t as getFieldValue } from "./field-path-BabiMrrA.js";
|
|
2
2
|
import { D as compileFilterPredicate, E as andPredicates, T as andFilters, f as mergeSearchFields } from "./normalize-error-BmLbgANw.js";
|
|
3
|
-
import { i as searchFilterOf, s as flattenLeaves, t as isDataSourceLike } from "./data-source-read-
|
|
3
|
+
import { i as searchFilterOf, s as flattenLeaves, t as isDataSourceLike } from "./data-source-read-DTJ_Mnez.js";
|
|
4
4
|
import { t as resolveMaybeReactive } from "./reactive-Dtd-esHO.js";
|
|
5
5
|
import { s as odataStringToArray, t as arrayToODataString } from "./filter-odata-Bi27XUpQ.js";
|
|
6
6
|
|
|
@@ -36,6 +36,21 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
36
36
|
let filter = null;
|
|
37
37
|
let sortList = [];
|
|
38
38
|
let page = [];
|
|
39
|
+
/**
|
|
40
|
+
* `applied()` as of the last `load()`, or null once a query setter has written since.
|
|
41
|
+
*
|
|
42
|
+
* `totalCount()` / `isLastPage()` re-ran the whole filter + search + SORT per call, and the
|
|
43
|
+
* grid asks them on every sync — every virtual-scroll window shift, ~3 times per chunk of a
|
|
44
|
+
* chunked "all" load. `load()` always recomputes (so an in-place edit of the data shows on the
|
|
45
|
+
* next load) and stores it here; every setter that WRITES clears it.
|
|
46
|
+
*/
|
|
47
|
+
let appliedCache = null;
|
|
48
|
+
const matched = () => appliedCache ??= applied();
|
|
49
|
+
/** Pass a setter's written value through, dropping the cached match set. */
|
|
50
|
+
const moved = (v) => {
|
|
51
|
+
appliedCache = null;
|
|
52
|
+
return v;
|
|
53
|
+
};
|
|
39
54
|
const emit = (event, arg) => (handlers[event] ?? []).slice().forEach((h) => h(arg));
|
|
40
55
|
/** Normalise a single devextreme sort entry into `{ selector, desc }`. */
|
|
41
56
|
function normalizeSortEntry(value) {
|
|
@@ -104,19 +119,19 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
104
119
|
/** Full backing array (unfiltered) — lets the grid derive header-filter values. */
|
|
105
120
|
data: () => [...all],
|
|
106
121
|
isLoading: () => false,
|
|
107
|
-
totalCount: () =>
|
|
108
|
-
isLastPage: () => (pageIndex + 1) * pageSize >=
|
|
122
|
+
totalCount: () => matched().length,
|
|
123
|
+
isLastPage: () => (pageIndex + 1) * pageSize >= matched().length,
|
|
109
124
|
paginate: (value) => value === void 0 ? paginate : paginate = value,
|
|
110
125
|
pageSize: (value) => value === void 0 ? pageSize : pageSize = value,
|
|
111
126
|
pageIndex: (value) => value === void 0 ? pageIndex : pageIndex = value,
|
|
112
|
-
searchValue: (value) => value === void 0 ? search : search = value || null,
|
|
113
|
-
searchExpr: (value) => value === void 0 ? searchExpr : searchExpr = value ?? null,
|
|
114
|
-
searchOperation: (op) => op === void 0 ? searchOperation : searchOperation = op,
|
|
115
|
-
filter: (value) => value === void 0 ? filter : filter = typeof value === "function" ? value : null,
|
|
116
|
-
sort: (value) => value === void 0 ? sortList : sortList = normalizeSortList(value),
|
|
127
|
+
searchValue: (value) => value === void 0 ? search : moved(search = value || null),
|
|
128
|
+
searchExpr: (value) => value === void 0 ? searchExpr : moved(searchExpr = value ?? null),
|
|
129
|
+
searchOperation: (op) => op === void 0 ? searchOperation : moved(searchOperation = op),
|
|
130
|
+
filter: (value) => value === void 0 ? filter : moved(filter = typeof value === "function" ? value : null),
|
|
131
|
+
sort: (value) => value === void 0 ? sortList : moved(sortList = normalizeSortList(value)),
|
|
117
132
|
load: () => {
|
|
118
133
|
emit("loadingChanged", true);
|
|
119
|
-
const rows = applied();
|
|
134
|
+
const rows = appliedCache = applied();
|
|
120
135
|
const start = pageIndex * pageSize;
|
|
121
136
|
page = paginate ? rows.slice(start, start + pageSize) : rows.slice();
|
|
122
137
|
emit("changed");
|
|
@@ -127,6 +142,7 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
127
142
|
/** Replace the backing array and reload from page 0. */
|
|
128
143
|
setData: (next) => {
|
|
129
144
|
all = normalizeInput(next, opts.group);
|
|
145
|
+
appliedCache = null;
|
|
130
146
|
pageIndex = 0;
|
|
131
147
|
return Promise.resolve(source.load());
|
|
132
148
|
},
|
|
@@ -139,6 +155,7 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
139
155
|
const keyExpr = opts.keyExpr ?? "Id";
|
|
140
156
|
const idx = all.findIndex((row) => String(row?.[keyExpr]) === String(key));
|
|
141
157
|
if (idx >= 0) all[idx] = mergePatch(all[idx], values);
|
|
158
|
+
appliedCache = null;
|
|
142
159
|
return Promise.resolve(source.load());
|
|
143
160
|
}
|
|
144
161
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as isPath, r as mergePatch, t as getFieldValue } from "./field-path-BabiMrrA.js";
|
|
2
|
-
import { i as searchFilterOf, s as flattenLeaves, t as isDataSourceLike } from "./data-source-read-
|
|
2
|
+
import { i as searchFilterOf, s as flattenLeaves, t as isDataSourceLike } from "./data-source-read-Cp_h7NIf.js";
|
|
3
3
|
import { n as andPredicates, r as compileFilterPredicate, t as andFilters } from "./filter-eval-ChDSaAUH.js";
|
|
4
4
|
import { h as mergeSearchFields } from "./normalize-error-D93O4q8g.js";
|
|
5
5
|
import { t as resolveMaybeReactive } from "./reactive-Dtd-esHO.js";
|
|
@@ -37,6 +37,21 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
37
37
|
let filter = null;
|
|
38
38
|
let sortList = [];
|
|
39
39
|
let page = [];
|
|
40
|
+
/**
|
|
41
|
+
* `applied()` as of the last `load()`, or null once a query setter has written since.
|
|
42
|
+
*
|
|
43
|
+
* `totalCount()` / `isLastPage()` re-ran the whole filter + search + SORT per call, and the
|
|
44
|
+
* grid asks them on every sync — every virtual-scroll window shift, ~3 times per chunk of a
|
|
45
|
+
* chunked "all" load. `load()` always recomputes (so an in-place edit of the data shows on the
|
|
46
|
+
* next load) and stores it here; every setter that WRITES clears it.
|
|
47
|
+
*/
|
|
48
|
+
let appliedCache = null;
|
|
49
|
+
const matched = () => appliedCache ??= applied();
|
|
50
|
+
/** Pass a setter's written value through, dropping the cached match set. */
|
|
51
|
+
const moved = (v) => {
|
|
52
|
+
appliedCache = null;
|
|
53
|
+
return v;
|
|
54
|
+
};
|
|
40
55
|
const emit = (event, arg) => (handlers[event] ?? []).slice().forEach((h) => h(arg));
|
|
41
56
|
/** Normalise a single devextreme sort entry into `{ selector, desc }`. */
|
|
42
57
|
function normalizeSortEntry(value) {
|
|
@@ -105,19 +120,19 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
105
120
|
/** Full backing array (unfiltered) — lets the grid derive header-filter values. */
|
|
106
121
|
data: () => [...all],
|
|
107
122
|
isLoading: () => false,
|
|
108
|
-
totalCount: () =>
|
|
109
|
-
isLastPage: () => (pageIndex + 1) * pageSize >=
|
|
123
|
+
totalCount: () => matched().length,
|
|
124
|
+
isLastPage: () => (pageIndex + 1) * pageSize >= matched().length,
|
|
110
125
|
paginate: (value) => value === void 0 ? paginate : paginate = value,
|
|
111
126
|
pageSize: (value) => value === void 0 ? pageSize : pageSize = value,
|
|
112
127
|
pageIndex: (value) => value === void 0 ? pageIndex : pageIndex = value,
|
|
113
|
-
searchValue: (value) => value === void 0 ? search : search = value || null,
|
|
114
|
-
searchExpr: (value) => value === void 0 ? searchExpr : searchExpr = value ?? null,
|
|
115
|
-
searchOperation: (op) => op === void 0 ? searchOperation : searchOperation = op,
|
|
116
|
-
filter: (value) => value === void 0 ? filter : filter = typeof value === "function" ? value : null,
|
|
117
|
-
sort: (value) => value === void 0 ? sortList : sortList = normalizeSortList(value),
|
|
128
|
+
searchValue: (value) => value === void 0 ? search : moved(search = value || null),
|
|
129
|
+
searchExpr: (value) => value === void 0 ? searchExpr : moved(searchExpr = value ?? null),
|
|
130
|
+
searchOperation: (op) => op === void 0 ? searchOperation : moved(searchOperation = op),
|
|
131
|
+
filter: (value) => value === void 0 ? filter : moved(filter = typeof value === "function" ? value : null),
|
|
132
|
+
sort: (value) => value === void 0 ? sortList : moved(sortList = normalizeSortList(value)),
|
|
118
133
|
load: () => {
|
|
119
134
|
emit("loadingChanged", true);
|
|
120
|
-
const rows = applied();
|
|
135
|
+
const rows = appliedCache = applied();
|
|
121
136
|
const start = pageIndex * pageSize;
|
|
122
137
|
page = paginate ? rows.slice(start, start + pageSize) : rows.slice();
|
|
123
138
|
emit("changed");
|
|
@@ -128,6 +143,7 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
128
143
|
/** Replace the backing array and reload from page 0. */
|
|
129
144
|
setData: (next) => {
|
|
130
145
|
all = normalizeInput(next, opts.group);
|
|
146
|
+
appliedCache = null;
|
|
131
147
|
pageIndex = 0;
|
|
132
148
|
return Promise.resolve(source.load());
|
|
133
149
|
},
|
|
@@ -140,6 +156,7 @@ function monoArraySource(data = [], opts = {}) {
|
|
|
140
156
|
const keyExpr = opts.keyExpr ?? "Id";
|
|
141
157
|
const idx = all.findIndex((row) => String(row?.[keyExpr]) === String(key));
|
|
142
158
|
if (idx >= 0) all[idx] = mergePatch(all[idx], values);
|
|
159
|
+
appliedCache = null;
|
|
143
160
|
return Promise.resolve(source.load());
|
|
144
161
|
}
|
|
145
162
|
};
|
|
@@ -20,8 +20,11 @@ function isGroupNode(x) {
|
|
|
20
20
|
*/
|
|
21
21
|
function flattenLeaves(rows) {
|
|
22
22
|
const out = [];
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const walk = (list) => {
|
|
24
|
+
for (const row of list) if (isGroupNode(row)) walk(row.items);
|
|
25
|
+
else out.push(row);
|
|
26
|
+
};
|
|
27
|
+
walk(rows);
|
|
25
28
|
return out;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
@@ -20,8 +20,11 @@ function isGroupNode(x) {
|
|
|
20
20
|
*/
|
|
21
21
|
function flattenLeaves(rows) {
|
|
22
22
|
const out = [];
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const walk = (list) => {
|
|
24
|
+
for (const row of list) if (isGroupNode(row)) walk(row.items);
|
|
25
|
+
else out.push(row);
|
|
26
|
+
};
|
|
27
|
+
walk(rows);
|
|
25
28
|
return out;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as flattenInline, i as toExcelStyle, n as combineStyles, r as mergeStyles } from "./styles-
|
|
1
|
+
import { a as flattenInline, i as toExcelStyle, n as combineStyles, r as mergeStyles } from "./styles-D-ergrfR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/export/sheet-name.ts
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as stripDirectives, i as escapeCellText, n as parseMarkdown, o as __commonJSMin, r as encodeDirective, s as __toESM } from "./markdown-uGlE_OfJ.js";
|
|
2
|
-
import { n as isReadableSource, r as readAllRows } from "./data-source-read-
|
|
2
|
+
import { n as isReadableSource, r as readAllRows } from "./data-source-read-DTJ_Mnez.js";
|
|
3
3
|
import { n as unwrapReactive } from "./reactive-Dtd-esHO.js";
|
|
4
4
|
import { t as DEFAULT_STYLES } from "./excel-BXzr3uI1.js";
|
|
5
5
|
|
package/dist/export.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as escapeCellText,
|
|
2
|
-
import { n as isReadableSource, r as readAllRows } from "./data-source-read-
|
|
1
|
+
import { c as escapeCellText, d as __toESM, l as stripDirectives, o as parseMarkdown, s as encodeDirective, t as DEFAULT_STYLES, u as __commonJSMin } from "./styles-D-ergrfR.js";
|
|
2
|
+
import { n as isReadableSource, r as readAllRows } from "./data-source-read-Cp_h7NIf.js";
|
|
3
3
|
import { n as unwrapReactive } from "./reactive-Dtd-esHO.js";
|
|
4
4
|
|
|
5
5
|
//#region src/export/download.ts
|
|
@@ -2341,7 +2341,7 @@ async function exportTable(options) {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
let workbookPromise = null;
|
|
2343
2343
|
const workbook = () => {
|
|
2344
|
-
workbookPromise ??= import("./excel-
|
|
2344
|
+
workbookPromise ??= import("./excel-DtRpxmxs.js").then(({ renderExcel }) => renderExcel(parseMarkdown(rendered), {
|
|
2345
2345
|
...options,
|
|
2346
2346
|
back: options.detail?.back,
|
|
2347
2347
|
sheets: detailSheets.map((s) => ({
|
|
@@ -106,9 +106,8 @@ let _probe = null;
|
|
|
106
106
|
function probeTooltip() {
|
|
107
107
|
_probe ??= (async () => {
|
|
108
108
|
try {
|
|
109
|
-
const
|
|
110
|
-
await
|
|
111
|
-
return controlMonoTooltip;
|
|
109
|
+
const { loadFieldTooltipAddon } = await import("./field-tooltip-addon-B32dizW_.js");
|
|
110
|
+
return await loadFieldTooltipAddon();
|
|
112
111
|
} catch {
|
|
113
112
|
return null;
|
|
114
113
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { o as loadFloatingUi, t as controlMonoTooltip } from "./control-tooltip-CoPD37_h.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/tooltip/field-tooltip-addon.ts
|
|
4
|
+
/**
|
|
5
|
+
* The tooltip addon as `field-tooltip` lazy-loads it — ONE module, imported dynamically and
|
|
6
|
+
* from nowhere else.
|
|
7
|
+
*
|
|
8
|
+
* `field-tooltip` used to `import()` `control-tooltip` and `tooltip-loader` directly. Both are
|
|
9
|
+
* also imported STATICALLY by the root entry, so rolldown had to hand the dynamic importer a
|
|
10
|
+
* synthesized namespace object (`__exportAll`) — and its runtime helpers sat in the report
|
|
11
|
+
* engine's markdown chunk, so `import … from '@mono-lit/helper'` loaded and evaluated ~500KB of
|
|
12
|
+
* remark/micromark. A module that is only ever dynamically imported is its own chunk entry, and
|
|
13
|
+
* `import()` returns its real namespace: no helper, no markdown.
|
|
14
|
+
*/
|
|
15
|
+
/** `controlMonoTooltip` once the optional `@floating-ui/dom` peer has loaded; rejects without it. */
|
|
16
|
+
async function loadFieldTooltipAddon() {
|
|
17
|
+
await loadFloatingUi();
|
|
18
|
+
return controlMonoTooltip;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { loadFieldTooltipAddon };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { i as registerPopupLayer, o as unregisterPopupLayer } from "./popup-stack-C64WCuXq.js";
|
|
2
2
|
import { n as unwrapReactive, t as resolveMaybeReactive } from "./reactive-Dtd-esHO.js";
|
|
3
|
-
import { loadFloatingUi } from "./tooltip-loader-3U9FTOXj.js";
|
|
4
3
|
|
|
5
4
|
//#region src/components/tooltip/tooltip-config.ts
|
|
6
5
|
const DEFAULT_TOOLTIP_OPTIONS = {
|
|
@@ -39,6 +38,25 @@ function resolveTooltipOptions(local, anchor) {
|
|
|
39
38
|
return out;
|
|
40
39
|
}
|
|
41
40
|
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/tooltip/tooltip-loader.ts
|
|
43
|
+
/**
|
|
44
|
+
* Cached loader for the OPTIONAL `@floating-ui/dom` peer (which itself depends on
|
|
45
|
+
* `@floating-ui/core` — both are the consumer's to install).
|
|
46
|
+
*
|
|
47
|
+
* Loaded on the FIRST show, never at import: registering a tooltip in
|
|
48
|
+
* `<script setup>` costs nothing until somebody actually hovers. Externalized by
|
|
49
|
+
* `NEVER_BUNDLE` in `tsdown.config.ts`, so the consumer's bundler resolves and splits it.
|
|
50
|
+
*/
|
|
51
|
+
let _floatingPromise = null;
|
|
52
|
+
function loadFloatingUi() {
|
|
53
|
+
_floatingPromise ??= import("@floating-ui/dom").catch((err) => {
|
|
54
|
+
_floatingPromise = null;
|
|
55
|
+
throw new Error("[mono-tooltip] needs the optional peer dependencies \"@floating-ui/dom\" and \"@floating-ui/core\". Install them in your app: pnpm add @floating-ui/dom @floating-ui/core" + (err?.message ? ` (original error: ${err.message})` : ""));
|
|
56
|
+
});
|
|
57
|
+
return _floatingPromise;
|
|
58
|
+
}
|
|
59
|
+
|
|
42
60
|
//#endregion
|
|
43
61
|
//#region src/components/tooltip/control-tooltip.ts
|
|
44
62
|
/** Grace period so an INTERACTIVE tooltip can be reached across the offset gap. */
|
|
@@ -660,19 +678,25 @@ var TooltipInstance = class {
|
|
|
660
678
|
function controlMonoTooltip(target, options = {}) {
|
|
661
679
|
return new TooltipInstance(target, options);
|
|
662
680
|
}
|
|
681
|
+
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/components/tooltip/field-tooltip-addon.ts
|
|
663
684
|
/**
|
|
664
|
-
*
|
|
665
|
-
*
|
|
685
|
+
* The tooltip addon as `field-tooltip` lazy-loads it — ONE module, imported dynamically and
|
|
686
|
+
* from nowhere else.
|
|
687
|
+
*
|
|
688
|
+
* `field-tooltip` used to `import()` `control-tooltip` and `tooltip-loader` directly. Both are
|
|
689
|
+
* also imported STATICALLY by the root entry, so rolldown had to hand the dynamic importer a
|
|
690
|
+
* synthesized namespace object (`__exportAll`) — and its runtime helpers sat in the report
|
|
691
|
+
* engine's markdown chunk, so `import … from '@mono-lit/helper'` loaded and evaluated ~500KB of
|
|
692
|
+
* remark/micromark. A module that is only ever dynamically imported is its own chunk entry, and
|
|
693
|
+
* `import()` returns its real namespace: no helper, no markdown.
|
|
666
694
|
*/
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const monoTooltip = controlMonoTooltip;
|
|
672
|
-
/** @internal — close and forget every live controller. Public as `destroyAllMonoTooltips`. */
|
|
673
|
-
function destroyAllTooltipControllers() {
|
|
674
|
-
each((i) => i.destroy());
|
|
695
|
+
/** `controlMonoTooltip` once the optional `@floating-ui/dom` peer has loaded; rejects without it. */
|
|
696
|
+
async function loadFieldTooltipAddon() {
|
|
697
|
+
await loadFloatingUi();
|
|
698
|
+
return controlMonoTooltip;
|
|
675
699
|
}
|
|
676
700
|
|
|
677
701
|
//#endregion
|
|
678
|
-
export {
|
|
702
|
+
export { loadFieldTooltipAddon };
|
|
@@ -106,9 +106,8 @@ let _probe = null;
|
|
|
106
106
|
function probeTooltip() {
|
|
107
107
|
_probe ??= (async () => {
|
|
108
108
|
try {
|
|
109
|
-
const
|
|
110
|
-
await
|
|
111
|
-
return controlMonoTooltip;
|
|
109
|
+
const { loadFieldTooltipAddon } = await import("./field-tooltip-addon-CWCp19mJ.js");
|
|
110
|
+
return await loadFieldTooltipAddon();
|
|
112
111
|
} catch {
|
|
113
112
|
return null;
|
|
114
113
|
}
|
|
@@ -264,7 +263,7 @@ var FieldTooltipController = class {
|
|
|
264
263
|
|
|
265
264
|
//#endregion
|
|
266
265
|
//#region \0raw:C:\Users\VCT-DEV\Desktop\libs\packages\helper\src\components\form\field-tooltip.css?raw.js
|
|
267
|
-
var field_tooltip_css_raw_default = "/* =========================================\n Field tooltip — the BUILT-IN bubble behind a plain-text `tooltip=\"…\"` on\n every field control (input, select, tag-input, date, textarea,\n dropdown-table, slider). No floating-ui: composables/field-tooltip.ts\n shows it in the top layer (Popover API) and writes its fixed `top` /\n `left`, `mono-side` (top|bottom) and the arrow's x. The object form\n (`.tooltip=${{…}}`) is the tooltip addon instead and never reaches here.\n\n Looks like the addon's default `mono-tooltip`, and reads its public knobs:\n --mono-tooltip-bg / -color / -radius / -max-width / -font-size /\n -line-height / -padding-x / -padding-y.\n\n Light: imported once by entries/index.css. Shadow: appended to each\n control's shadow sheet.\n ========================================= */\n\n[mono-field-bubble] {\n --_mono-field-tip-bg: var(--mono-tooltip-bg, var(--foreground));\n --_mono-field-tip-arrow: calc(var(--mono-spacing) * 2);\n\n /* undo the [popover] UA box (inset:0; margin:auto; border; Canvas …) */\n position: fixed;\n inset: auto;\n top: 0;\n left: 0;\n z-index: var(--mono-popup-z, 1000);\n display: none;\n box-sizing: border-box;\n width: max-content;\n max-width: min(var(--mono-tooltip-max-width, 20rem), calc(100vw - 16px));\n height: auto;\n margin: 0;\n overflow: visible;\n padding: var(--mono-tooltip-padding-y, calc(var(--mono-spacing) * 1.5)) var(--mono-tooltip-padding-x, calc(var(--mono-spacing) * 3));\n border: 0;\n border-radius: var(--mono-tooltip-radius, var(--mono-radius-md));\n background: var(--_mono-field-tip-bg);\n color: var(--mono-tooltip-color, var(--background));\n box-shadow: var(--mono-tooltip-shadow, 0 0 0 0 transparent);\n\n /* it sits inside the label — drop everything the label row set */\n font-family: inherit;\n font-size: var(--mono-tooltip-font-size, var(--mono-text-xs));\n font-weight: var(--mono-font-weight-normal, 400);\n font-style: normal;\n line-height: var(--mono-tooltip-line-height, var(--mono-text-xs--lh));\n letter-spacing: normal;\n text-transform: none;\n text-align: start;\n white-space: normal;\n overflow-wrap: break-word;\n cursor: default;\n user-select: text;\n pointer-events: auto;\n}\n\n[mono-field-bubble][mono-open] {\n display: block;\n animation: mono-field-tip-in var(--mono-duration, 150ms) var(--mono-ease, ease) both;\n}\n\n/* The arrow, plus (::before) an invisible bridge over the gap so the pointer\n can travel from the icon onto the bubble without it closing. */\n[mono-field-bubble]::after {\n content: '';\n position: absolute;\n left: var(--_mono-field-tip-arrow-x, 50%);\n width: var(--_mono-field-tip-arrow);\n height: var(--_mono-field-tip-arrow);\n background: inherit;\n border-radius: 2px;\n translate: -50% 0;\n rotate: 45deg;\n}\n\n[mono-field-bubble]::before {\n content: '';\n position: absolute;\n inset-inline: 0;\n height: 8px;\n}\n\n[mono-field-bubble]:not([mono-side=\"bottom\"])::after {\n bottom: calc(var(--_mono-field-tip-arrow) / -2 + 1px);\n}\n[mono-field-bubble]:not([mono-side=\"bottom\"])::before {\n top: 100%;\n}\n[mono-field-bubble][mono-side=\"bottom\"]::after {\n top: calc(var(--_mono-field-tip-arrow) / -2 + 1px);\n}\n[mono-field-bubble][mono-side=\"bottom\"]::before {\n bottom: 100%;\n}\n\n@keyframes mono-field-tip-in {\n from {\n opacity: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n [mono-field-bubble][mono-open] {\n animation: none;\n }\n}\n";
|
|
266
|
+
var field_tooltip_css_raw_default = "/* =========================================\r\n Field tooltip — the BUILT-IN bubble behind a plain-text `tooltip=\"…\"` on\r\n every field control (input, select, tag-input, date, textarea,\r\n dropdown-table, slider). No floating-ui: composables/field-tooltip.ts\r\n shows it in the top layer (Popover API) and writes its fixed `top` /\r\n `left`, `mono-side` (top|bottom) and the arrow's x. The object form\r\n (`.tooltip=${{…}}`) is the tooltip addon instead and never reaches here.\r\n\r\n Looks like the addon's default `mono-tooltip`, and reads its public knobs:\r\n --mono-tooltip-bg / -color / -radius / -max-width / -font-size /\r\n -line-height / -padding-x / -padding-y.\r\n\r\n Light: imported once by entries/index.css. Shadow: appended to each\r\n control's shadow sheet.\r\n ========================================= */\r\n\r\n[mono-field-bubble] {\r\n --_mono-field-tip-bg: var(--mono-tooltip-bg, var(--foreground));\r\n --_mono-field-tip-arrow: calc(var(--mono-spacing) * 2);\r\n\r\n /* undo the [popover] UA box (inset:0; margin:auto; border; Canvas …) */\r\n position: fixed;\r\n inset: auto;\r\n top: 0;\r\n left: 0;\r\n z-index: var(--mono-popup-z, 1000);\r\n display: none;\r\n box-sizing: border-box;\r\n width: max-content;\r\n max-width: min(var(--mono-tooltip-max-width, 20rem), calc(100vw - 16px));\r\n height: auto;\r\n margin: 0;\r\n overflow: visible;\r\n padding: var(--mono-tooltip-padding-y, calc(var(--mono-spacing) * 1.5)) var(--mono-tooltip-padding-x, calc(var(--mono-spacing) * 3));\r\n border: 0;\r\n border-radius: var(--mono-tooltip-radius, var(--mono-radius-md));\r\n background: var(--_mono-field-tip-bg);\r\n color: var(--mono-tooltip-color, var(--background));\r\n box-shadow: var(--mono-tooltip-shadow, 0 0 0 0 transparent);\r\n\r\n /* it sits inside the label — drop everything the label row set */\r\n font-family: inherit;\r\n font-size: var(--mono-tooltip-font-size, var(--mono-text-xs));\r\n font-weight: var(--mono-font-weight-normal, 400);\r\n font-style: normal;\r\n line-height: var(--mono-tooltip-line-height, var(--mono-text-xs--lh));\r\n letter-spacing: normal;\r\n text-transform: none;\r\n text-align: start;\r\n white-space: normal;\r\n overflow-wrap: break-word;\r\n cursor: default;\r\n user-select: text;\r\n pointer-events: auto;\r\n}\r\n\r\n[mono-field-bubble][mono-open] {\r\n display: block;\r\n animation: mono-field-tip-in var(--mono-duration, 150ms) var(--mono-ease, ease) both;\r\n}\r\n\r\n/* The arrow, plus (::before) an invisible bridge over the gap so the pointer\r\n can travel from the icon onto the bubble without it closing. */\r\n[mono-field-bubble]::after {\r\n content: '';\r\n position: absolute;\r\n left: var(--_mono-field-tip-arrow-x, 50%);\r\n width: var(--_mono-field-tip-arrow);\r\n height: var(--_mono-field-tip-arrow);\r\n background: inherit;\r\n border-radius: 2px;\r\n translate: -50% 0;\r\n rotate: 45deg;\r\n}\r\n\r\n[mono-field-bubble]::before {\r\n content: '';\r\n position: absolute;\r\n inset-inline: 0;\r\n height: 8px;\r\n}\r\n\r\n[mono-field-bubble]:not([mono-side=\"bottom\"])::after {\r\n bottom: calc(var(--_mono-field-tip-arrow) / -2 + 1px);\r\n}\r\n[mono-field-bubble]:not([mono-side=\"bottom\"])::before {\r\n top: 100%;\r\n}\r\n[mono-field-bubble][mono-side=\"bottom\"]::after {\r\n top: calc(var(--_mono-field-tip-arrow) / -2 + 1px);\r\n}\r\n[mono-field-bubble][mono-side=\"bottom\"]::before {\r\n bottom: 100%;\r\n}\r\n\r\n@keyframes mono-field-tip-in {\r\n from {\r\n opacity: 0;\r\n }\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n [mono-field-bubble][mono-open] {\r\n animation: none;\r\n }\r\n}\r\n";
|
|
268
267
|
|
|
269
268
|
//#endregion
|
|
270
269
|
export { FieldTooltipController as n, FieldBubble as r, field_tooltip_css_raw_default as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as checkCircleIcon, t as alertCircleIcon } from "./field-icons-t8rXRCKs.js";
|
|
2
|
-
import { n as FieldBubble } from "./field-tooltip-
|
|
2
|
+
import { n as FieldBubble } from "./field-tooltip-Csk4s2ve.js";
|
|
3
3
|
import { html, nothing } from "lit";
|
|
4
4
|
import { ref } from "lit/directives/ref.js";
|
|
5
5
|
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { r as checkCircleIcon, t as alertCircleIcon } from "./field-icons-t8rXRCKs.js";
|
|
2
|
+
import { r as FieldBubble } from "./field-tooltip.css_raw-U5UeTa2d.js";
|
|
3
|
+
import { html, nothing } from "lit";
|
|
4
|
+
import { ref } from "lit/directives/ref.js";
|
|
5
|
+
|
|
6
|
+
//#region src/composables/field-validation.ts
|
|
7
|
+
/** `default` (or no state) → `null`: a stateless message stays in the bottom row. */
|
|
8
|
+
function toneOf(state) {
|
|
9
|
+
if (state === "invalid" || state === "error") return "invalid";
|
|
10
|
+
if (state === "valid" || state === "success") return "valid";
|
|
11
|
+
if (state === "warning") return "warning";
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
var FieldValidationController = class {
|
|
15
|
+
constructor(host, read, getBox) {
|
|
16
|
+
this.host = host;
|
|
17
|
+
this.read = read;
|
|
18
|
+
this.getBox = getBox;
|
|
19
|
+
this._iconBubble = new FieldBubble({
|
|
20
|
+
side: "top",
|
|
21
|
+
align: "center"
|
|
22
|
+
});
|
|
23
|
+
this._floatBubble = new FieldBubble({
|
|
24
|
+
side: "bottom",
|
|
25
|
+
align: "start"
|
|
26
|
+
});
|
|
27
|
+
this._hovered = false;
|
|
28
|
+
this._focused = false;
|
|
29
|
+
this._onIconClick = (e) => {
|
|
30
|
+
stopEvent(e);
|
|
31
|
+
this._iconBubble.show();
|
|
32
|
+
};
|
|
33
|
+
this._onEnter = () => {
|
|
34
|
+
this._hovered = true;
|
|
35
|
+
this._syncFloat();
|
|
36
|
+
};
|
|
37
|
+
this._onLeave = (e) => {
|
|
38
|
+
if (e.pointerType === "touch") return;
|
|
39
|
+
this._hovered = false;
|
|
40
|
+
this._syncFloat();
|
|
41
|
+
};
|
|
42
|
+
this._onFocusIn = (e) => {
|
|
43
|
+
this._focused = true;
|
|
44
|
+
this._syncFloat();
|
|
45
|
+
if (this.notice?.position === "icon" && isFocusVisible(e)) this._iconBubble.show();
|
|
46
|
+
};
|
|
47
|
+
this._onFocusOut = (e) => {
|
|
48
|
+
const next = e.relatedTarget;
|
|
49
|
+
if (next && (next === this.host || this.host.contains(next))) return;
|
|
50
|
+
this._focused = false;
|
|
51
|
+
this._syncFloat();
|
|
52
|
+
this._iconBubble.hide();
|
|
53
|
+
};
|
|
54
|
+
host.addController(this);
|
|
55
|
+
}
|
|
56
|
+
/** The message that moved out of the bottom row, or `null` (bottom mode / no text). */
|
|
57
|
+
get notice() {
|
|
58
|
+
const { position, state, text } = this.read();
|
|
59
|
+
if (position !== "icon" && position !== "float") return null;
|
|
60
|
+
const message = typeof text === "string" ? text.trim() : "";
|
|
61
|
+
const tone = toneOf(state);
|
|
62
|
+
if (!message || !tone) return null;
|
|
63
|
+
return {
|
|
64
|
+
position,
|
|
65
|
+
tone,
|
|
66
|
+
text: message
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** True when the bottom row should show the helper and keep the validation text sr-only. */
|
|
70
|
+
get moved() {
|
|
71
|
+
return this.notice !== null;
|
|
72
|
+
}
|
|
73
|
+
hostConnected() {
|
|
74
|
+
this.host.addEventListener("pointerenter", this._onEnter);
|
|
75
|
+
this.host.addEventListener("pointerleave", this._onLeave);
|
|
76
|
+
this.host.addEventListener("focusin", this._onFocusIn);
|
|
77
|
+
this.host.addEventListener("focusout", this._onFocusOut);
|
|
78
|
+
}
|
|
79
|
+
hostDisconnected() {
|
|
80
|
+
this.host.removeEventListener("pointerenter", this._onEnter);
|
|
81
|
+
this.host.removeEventListener("pointerleave", this._onLeave);
|
|
82
|
+
this.host.removeEventListener("focusin", this._onFocusIn);
|
|
83
|
+
this.host.removeEventListener("focusout", this._onFocusOut);
|
|
84
|
+
this._iconBubble.hide();
|
|
85
|
+
this._floatBubble.hide();
|
|
86
|
+
this._hovered = false;
|
|
87
|
+
this._focused = false;
|
|
88
|
+
}
|
|
89
|
+
hostUpdated() {
|
|
90
|
+
this._floatBubble.setAnchor(this.getBox() ?? null);
|
|
91
|
+
if (this.notice?.position !== "icon") this._iconBubble.hide();
|
|
92
|
+
this._syncFloat();
|
|
93
|
+
this._iconBubble.place();
|
|
94
|
+
this._floatBubble.place();
|
|
95
|
+
}
|
|
96
|
+
/** Re-evaluate the float bubble — for popups the host opens without a re-render (date's calendar). */
|
|
97
|
+
refresh() {
|
|
98
|
+
this._syncFloat();
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* `icon` mode: the state icon for inside the box (before the clear button /
|
|
102
|
+
* actions). `anchored` wraps it in a zero-height `[mono-validation-anchor]`
|
|
103
|
+
* — for the textarea, whose box can't hold children.
|
|
104
|
+
*/
|
|
105
|
+
renderIcon(options = {}) {
|
|
106
|
+
const notice = this.notice;
|
|
107
|
+
if (notice?.position !== "icon") return nothing;
|
|
108
|
+
const icon = html`<span
|
|
109
|
+
mono-validation-icon
|
|
110
|
+
mono-state=${notice.tone}
|
|
111
|
+
aria-hidden="true"
|
|
112
|
+
@pointerenter=${this._iconBubble.show}
|
|
113
|
+
@pointerleave=${this._iconBubble.onPointerLeave}
|
|
114
|
+
@pointerdown=${stopEvent}
|
|
115
|
+
@click=${this._onIconClick}
|
|
116
|
+
${ref(this._iconBubble.setAnchor)}
|
|
117
|
+
>${this._glyph(notice.tone)}<span
|
|
118
|
+
mono-field-bubble
|
|
119
|
+
mono-validation-tip
|
|
120
|
+
mono-state=${notice.tone}
|
|
121
|
+
popover="manual"
|
|
122
|
+
@pointerenter=${this._iconBubble.cancelHide}
|
|
123
|
+
@pointerleave=${this._iconBubble.onPointerLeave}
|
|
124
|
+
@click=${stopEvent}
|
|
125
|
+
${ref(this._iconBubble.setBubble)}
|
|
126
|
+
>${notice.text}</span></span>`;
|
|
127
|
+
return options.anchored ? html`<span mono-validation-anchor>${icon}</span>` : icon;
|
|
128
|
+
}
|
|
129
|
+
/** `float` mode: the bubble that floats under the box while the field is hovered or focused. */
|
|
130
|
+
renderFloat() {
|
|
131
|
+
const notice = this.notice;
|
|
132
|
+
if (notice?.position !== "float") return nothing;
|
|
133
|
+
return html`<span
|
|
134
|
+
mono-field-bubble
|
|
135
|
+
mono-validation-float
|
|
136
|
+
mono-state=${notice.tone}
|
|
137
|
+
aria-hidden="true"
|
|
138
|
+
popover="manual"
|
|
139
|
+
@click=${stopEvent}
|
|
140
|
+
${ref(this._floatBubble.setBubble)}
|
|
141
|
+
>${notice.text}</span>`;
|
|
142
|
+
}
|
|
143
|
+
/** Light build: UnoCSS mask icons; shadow build: inline SVG (page icon CSS can't reach a shadow root). */
|
|
144
|
+
_glyph(tone) {
|
|
145
|
+
if (this.host.renderRoot instanceof ShadowRoot) return tone === "valid" ? checkCircleIcon() : alertCircleIcon();
|
|
146
|
+
return tone === "valid" ? html`<span class="mono-icon i-mdi-check-circle-outline" mono-icon aria-hidden="true"></span>` : html`<span class="mono-icon i-mdi-alert-circle-outline" mono-icon aria-hidden="true"></span>`;
|
|
147
|
+
}
|
|
148
|
+
_syncFloat() {
|
|
149
|
+
const notice = this.notice;
|
|
150
|
+
const active = this._hovered || this._focused;
|
|
151
|
+
if (notice?.position === "float" && active && !this.read().suppressed) this._floatBubble.show();
|
|
152
|
+
else if (!active) this._floatBubble.scheduleHide();
|
|
153
|
+
else this._floatBubble.hide();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const stopEvent = (e) => {
|
|
157
|
+
e.preventDefault();
|
|
158
|
+
e.stopPropagation();
|
|
159
|
+
};
|
|
160
|
+
function isFocusVisible(e) {
|
|
161
|
+
const target = e.composedPath?.()[0] ?? e.target;
|
|
162
|
+
try {
|
|
163
|
+
return !!target?.matches?.(":focus-visible");
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region \0raw:C:\Users\VCT-DEV\Desktop\libs\packages\helper\src\components\form\label-position.css?raw.js
|
|
171
|
+
var label_position_css_raw_default = "/* =========================================\r\n label-position — shared by every field-like control\r\n (input, select, tag-input, date, textarea, dropdown-table; otp — left / right only).\r\n\r\n `top` (default) emits NO attribute, so nothing here touches it. The other\r\n three are layout-only: the label's type, colour and states stay with each\r\n component's own label rules.\r\n\r\n Each component's root writes the private slots read below:\r\n --_mono-lp-width left/right label column (--mono-<c>-label-width, auto)\r\n --_mono-lp-gap left/right column gap (--mono-<c>-label-side-gap)\r\n --_mono-lp-height one control row — the side label centres on it\r\n --_mono-lp-box-min the box's resting min-height (textarea: its rows)\r\n --_mono-lp-padding-x the box's inline-start padding — the notch lines up with the text\r\n --_mono-lp-font notched label font-size (--mono-<c>-label-notch-font-size)\r\n --_mono-lp-notch-bg the surface the notch is cut from (--mono-<c>-label-notch-bg)\r\n --_mono-lp-field-bg the box's own surface — paints the notch's lower half\r\n\r\n Light: imported once by entries/index.css. Shadow: appended to each\r\n component's shadow sheet (the inner root keeps its `mono-<c>` attribute).\r\n ========================================= */\r\n\r\n/* ── left / right — label column + field column; messages stay under the box ── */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table], [mono-otp]):is([mono-label-position=\"left\"], [mono-label-position=\"right\"]) {\r\n display: grid;\r\n grid-template-columns: var(--_mono-lp-width) minmax(0, 1fr);\r\n column-gap: var(--_mono-lp-gap);\r\n align-items: start;\r\n}\r\n\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table], [mono-otp])[mono-label-position=\"right\"] {\r\n grid-template-columns: minmax(0, 1fr) var(--_mono-lp-width);\r\n}\r\n\r\n/* Everything but the label lives in the field column (an absolute panel then\r\n measures against that column too). */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table], [mono-otp])[mono-label-position=\"left\"] > * {\r\n grid-column: 2;\r\n}\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table], [mono-otp])[mono-label-position=\"right\"] > * {\r\n grid-column: 1;\r\n}\r\n\r\n/* The label centres on the FIRST control row, so a tag-input growing chip\r\n rows or a tall textarea keeps it beside the top line. */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table], [mono-otp]):is([mono-label-position=\"left\"], [mono-label-position=\"right\"]) > :is([mono-label], [mono-dd-label]) {\r\n grid-row: 1;\r\n grid-column: 1;\r\n min-height: var(--_mono-lp-height);\r\n margin: 0;\r\n}\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table], [mono-otp])[mono-label-position=\"right\"] > :is([mono-label], [mono-dd-label]) {\r\n grid-column: 2;\r\n}\r\n\r\n/* ── notched — shared by both looks: the label leaves the flow ── */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table])[mono-label-position=\"notched\"] {\r\n position: relative;\r\n}\r\n\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table])[mono-label-position=\"notched\"] > :is([mono-label], [mono-dd-label]) {\r\n position: absolute;\r\n z-index: 1;\r\n max-width: calc(100% - 2 * var(--_mono-lp-padding-x) - 2 * var(--mono-spacing));\r\n margin: 0;\r\n font-size: var(--_mono-lp-font);\r\n line-height: 1;\r\n white-space: nowrap;\r\n}\r\n\r\n/* ── notched + outlined — the label sits ON the top border: ──Label── ──\r\n The \"notch\" is a background patch: page surface above the border line, the\r\n box's surface below it. On a non-solid parent set --mono-<c>-label-notch-bg. */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table])[mono-label-position=\"notched\"]:is(:not([mono-variant]), [mono-variant=\"outlined\"]) {\r\n padding-top: calc(var(--_mono-lp-font) / 2);\r\n}\r\n\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table])[mono-label-position=\"notched\"]:is(:not([mono-variant]), [mono-variant=\"outlined\"]) > :is([mono-label], [mono-dd-label]) {\r\n top: 0;\r\n inset-inline-start: calc(var(--mono-border-width) + var(--_mono-lp-padding-x) - var(--mono-spacing));\r\n padding-inline: var(--mono-spacing);\r\n background:\r\n linear-gradient(var(--_mono-lp-field-bg), var(--_mono-lp-field-bg)) bottom / 100% 50% no-repeat,\r\n var(--_mono-lp-notch-bg);\r\n}\r\n\r\n/* ── notched + filled / underlined — no outline to cut, so the label insets\r\n into the top of the box (Material \"filled\") and the box grows by its line ── */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table])[mono-label-position=\"notched\"]:is([mono-variant=\"filled\"], [mono-variant=\"underlined\"]) > :is([mono-label], [mono-dd-label]) {\r\n top: calc(var(--mono-border-width) + var(--_mono-lp-inset-y));\r\n inset-inline-start: calc(var(--mono-border-width) + var(--_mono-lp-padding-x));\r\n}\r\n\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea])[mono-label-position=\"notched\"]:is([mono-variant=\"filled\"], [mono-variant=\"underlined\"]) > :is([mono-field], [mono-trigger], textarea[mono-native]),\r\n[mono-dropdown-table][mono-label-position=\"notched\"]:is([mono-variant=\"filled\"], [mono-variant=\"underlined\"]) > [mono-dd-control] > [mono-dd-trigger] {\r\n min-height: calc(var(--_mono-lp-box-min) + var(--_mono-lp-font) + var(--_mono-lp-inset-y));\r\n padding-top: calc(var(--_mono-lp-inset-y) + var(--_mono-lp-font) + var(--_mono-lp-padding-y, 0px));\r\n}\r\n\r\n/* Slots the component sheets don't need to set. */\r\n:is([mono-input], [mono-select], [mono-tag-input], [mono-date], [mono-textarea], [mono-dropdown-table])[mono-label-position] {\r\n --_mono-lp-inset-y: calc(var(--mono-spacing) * 1.5);\r\n}\r\n";
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region \0raw:C:\Users\VCT-DEV\Desktop\libs\packages\helper\src\components\form\field-validation.css?raw.js
|
|
175
|
+
var field_validation_css_raw_default = "/* =========================================\r\n validation-position — `icon` and `float` (composables/field-validation.ts)\r\n on input, select, tag-input, date, textarea and dropdown-table.\r\n\r\n The bubbles share the [mono-field-bubble] look (field-tooltip.css); this\r\n sheet paints them in the state colour, and draws the state icon inside the\r\n box. Knobs:\r\n --mono-validation-invalid-bg / -color (default --destructive / -foreground)\r\n --mono-validation-warning-bg / -color (default --warning / -foreground)\r\n --mono-validation-valid-bg / -color (default --success / -foreground)\r\n --mono-validation-icon-size (default 1rem)\r\n\r\n Light: imported once by entries/index.css. Shadow: appended to each\r\n control's shadow sheet.\r\n ========================================= */\r\n\r\n/* ── state-coloured bubbles ── */\r\n[mono-field-bubble][mono-state=\"invalid\"] {\r\n --_mono-field-tip-bg: var(--mono-validation-invalid-bg, var(--destructive));\r\n color: var(--mono-validation-invalid-color, var(--destructive-foreground, #fff));\r\n}\r\n[mono-field-bubble][mono-state=\"warning\"] {\r\n --_mono-field-tip-bg: var(--mono-validation-warning-bg, var(--warning));\r\n color: var(--mono-validation-warning-color, var(--warning-foreground, #fff));\r\n}\r\n[mono-field-bubble][mono-state=\"valid\"] {\r\n --_mono-field-tip-bg: var(--mono-validation-valid-bg, var(--success));\r\n color: var(--mono-validation-valid-color, var(--success-foreground, #fff));\r\n}\r\n\r\n/* ── float: a compact message under the box ── */\r\n[mono-field-bubble][mono-validation-float] {\r\n max-width: min(var(--mono-validation-float-max-width, 24rem), calc(100vw - 16px));\r\n padding: var(--mono-validation-float-padding-y, var(--mono-spacing)) var(--mono-validation-float-padding-x, calc(var(--mono-spacing) * 2));\r\n font-size: var(--mono-validation-float-font-size, var(--mono-text-xs));\r\n /* hover-transparent: it must not steal the pointer from the field it describes */\r\n pointer-events: none;\r\n}\r\n[mono-field-bubble][mono-validation-float]::before {\r\n display: none;\r\n}\r\n\r\n/* ── icon: the state glyph inside the box ── */\r\n[mono-validation-icon] {\r\n position: relative;\r\n display: inline-flex;\r\n flex: none;\r\n align-items: center;\r\n justify-content: center;\r\n align-self: center;\r\n margin-inline: var(--mono-validation-icon-gap, var(--mono-spacing));\r\n font-size: var(--mono-validation-icon-size, 1rem);\r\n line-height: 1;\r\n cursor: help;\r\n /* a disabled field turns events off — the reason is exactly what to show */\r\n pointer-events: auto;\r\n}\r\n[mono-validation-icon] > [mono-icon] {\r\n width: 1em;\r\n height: 1em;\r\n}\r\n[mono-validation-icon][mono-state=\"invalid\"] {\r\n color: var(--mono-validation-invalid-bg, var(--destructive));\r\n}\r\n[mono-validation-icon][mono-state=\"warning\"] {\r\n color: var(--mono-validation-warning-bg, var(--warning));\r\n}\r\n[mono-validation-icon][mono-state=\"valid\"] {\r\n color: var(--mono-validation-valid-bg, var(--success));\r\n}\r\n\r\n/* textarea: the box can't hold children, so a zero-height anchor sits on the\r\n textarea's top edge (its negative margin cancels the flex gap it adds) and\r\n the icon pins to the top-right corner, over reserved inline padding. */\r\n[mono-textarea] > [mono-validation-anchor] {\r\n position: relative;\r\n z-index: 1;\r\n display: block;\r\n height: 0;\r\n margin-bottom: calc(-1 * var(--mono-textarea-gap, calc(var(--mono-spacing) * 3)));\r\n}\r\n[mono-textarea] > [mono-validation-anchor] > [mono-validation-icon] {\r\n position: absolute;\r\n top: calc(var(--mono-border-width) + var(--_mono-textarea-padding-y, var(--mono-spacing)));\r\n inset-inline-end: calc(var(--mono-border-width) + var(--_mono-textarea-padding-x, calc(var(--mono-spacing) * 2.5)));\r\n margin: 0;\r\n}\r\n[mono-textarea]:has(> [mono-validation-anchor]) > textarea[mono-native] {\r\n padding-inline-end: calc(var(--_mono-textarea-padding-x, calc(var(--mono-spacing) * 2.5)) + var(--mono-validation-icon-size, 1rem) + var(--mono-spacing));\r\n}\r\n/* side labels: the anchor shares the textarea's grid row */\r\n[mono-textarea]:is([mono-label-position=\"left\"], [mono-label-position=\"right\"]) > :is([mono-validation-anchor], textarea[mono-native]) {\r\n grid-row: 1;\r\n align-self: start;\r\n}\r\n[mono-textarea]:is([mono-label-position=\"left\"], [mono-label-position=\"right\"]) > [mono-validation-anchor] {\r\n margin-bottom: 0;\r\n}\r\n\r\n/* ── the moved message stays for assistive tech only ── */\r\n[mono-sr-only] {\r\n position: absolute !important;\r\n width: 1px !important;\r\n height: 1px !important;\r\n margin: -1px !important;\r\n padding: 0 !important;\r\n overflow: hidden !important;\r\n clip-path: inset(50%) !important;\r\n white-space: nowrap !important;\r\n border: 0 !important;\r\n}\r\n";
|
|
176
|
+
|
|
177
|
+
//#endregion
|
|
178
|
+
export { label_position_css_raw_default as n, FieldValidationController as r, field_validation_css_raw_default as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __decorate, c as defineHybridPropAlias, l as defineHybridPropAliases, s as booleanStringConverter } from "./hydration-flush-
|
|
1
|
+
import { a as __decorate, c as defineHybridPropAlias, l as defineHybridPropAliases, s as booleanStringConverter } from "./hydration-flush-BaE9gN3C.js";
|
|
2
2
|
import { n as detachEventHandlers, t as applyProps } from "./element-props-xvw0EB7H.js";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
|
4
4
|
|