@mono-lit/helper 0.0.8 → 0.0.10

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.
Files changed (161) hide show
  1. package/dist/accordion-core-DaNyPWRr.js +277 -0
  2. package/dist/alert-core-DWtHbX_-.js +134 -0
  3. package/dist/breadcrumb-list-core-Dh68T8Cf.js +747 -0
  4. package/dist/{mono-button-CLkHg3WW.js → button-core-DerXg84Q.js} +3 -276
  5. package/dist/button-dropdown-core-DKYEOyjy.js +654 -0
  6. package/dist/button-utils-D5-66M02.js +63 -0
  7. package/dist/card-utils-l80qAmrN.js +312 -0
  8. package/dist/chart-core-DV7hD3ZY.js +801 -0
  9. package/dist/checkbox-utils-DKdrhAzF.js +337 -0
  10. package/dist/chip-utils-DpRrd7Zj.js +403 -0
  11. package/dist/{data-source-controller-C6C4ej_M.js → data-source-controller-DS_JLrmS.js} +1 -1
  12. package/dist/{data-source-options-fxT5QIX4.js → data-source-options-DJUNU26C.js} +6 -6
  13. package/dist/{data-source-read-BL266IW0.js → data-source-read-uKJpRAzx.js} +2 -2
  14. package/dist/date-core-CyuSyvvG.js +734 -0
  15. package/dist/drawer-core-DbFWvNln.js +759 -0
  16. package/dist/dropdown-core-BCH1pK14.js +511 -0
  17. package/dist/dropdown-table-core-SfHUJVFq.js +1342 -0
  18. package/dist/export.js +1 -1
  19. package/dist/{field-path-BabiMrrA.js → field-path-DK2VBWHl.js} +1 -1
  20. package/dist/field-tooltip.css_raw-DVblekCl.js +5 -0
  21. package/dist/{field-validation.css_raw-Cx6SGrfP.js → field-validation.css_raw-BU7C6173.js} +1 -170
  22. package/dist/file-upload-core-Cz_dBQMx.js +624 -0
  23. package/dist/filter-builder-core-DyWjbBP7.js +381 -0
  24. package/dist/{filter-builder-B6Y2mmbM.js → filter-builder-vbqIuPhX.js} +1 -1
  25. package/dist/{filter-eval-ChDSaAUH.js → filter-eval-CqeBnMYh.js} +1 -1
  26. package/dist/{filter-odata-Bi27XUpQ.js → filter-odata-GsczYKNC.js} +1 -1
  27. package/dist/{hydration-flush-BaE9gN3C.js → hydration-flush-Volt9X7Q.js} +2 -1071
  28. package/dist/index.js +11 -11
  29. package/dist/{index.node-CLqE8F8P.js → index.node-Csy9zrr1.js} +4 -4
  30. package/dist/index.node.js +11 -11
  31. package/dist/input-utils-BglY-k0H.js +1145 -0
  32. package/dist/menu-core-DkAYuCZ2.js +831 -0
  33. package/dist/modal-core-CSBSPN_m.js +844 -0
  34. package/dist/mono-button-DVvZ03P-.js +280 -0
  35. package/dist/{mono-button.shadow-DqZMpcqY.js → mono-button.shadow-BANxMGln.js} +6 -594
  36. package/dist/{mono-data-chart-NKPdAgVq.js → mono-data-chart-ChF4J9RT.js} +6 -6
  37. package/dist/{mono-data-dropdown-DUXo_jxd.js → mono-data-dropdown-Bgj2PDfm.js} +1 -1
  38. package/dist/{mono-data-grid-Bb00QM72.js → mono-data-grid-DJkp96N-.js} +346 -51
  39. package/dist/{mono-event-BPku9HpS.js → mono-event-CAZf0F_k.js} +14 -9
  40. package/dist/{mono-form-controller-BrA10erm.js → mono-form-controller-DxZLvyg6.js} +2 -1
  41. package/dist/mono-table-checkbox-core-BKOMx8R5.js +5288 -0
  42. package/dist/nav-core-B5qU2dzn.js +225 -0
  43. package/dist/{normalize-error-D93O4q8g.js → normalize-error-BEcd1tmS.js} +2 -2
  44. package/dist/otp-core-DXg3vFLh.js +758 -0
  45. package/dist/radio-utils-Dk9Tl1jz.js +319 -0
  46. package/dist/rich-text-editor-core-Ddd_QaLn.js +1280 -0
  47. package/dist/select-utils-BgArYHk8.js +2140 -0
  48. package/dist/sidebar-core-CD6txDo3.js +583 -0
  49. package/dist/slider-core-vcWr321-.js +1014 -0
  50. package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +2 -2
  51. package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +1 -1
  52. package/dist/src/components/dropdown-table/index.d.ts +1 -1
  53. package/dist/src/components/dropdown-table/index.shadow.d.ts +1 -1
  54. package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +1 -1
  55. package/dist/src/components/form/form-types.d.ts +9 -3
  56. package/dist/src/components/input/input-core.d.ts +1 -1
  57. package/dist/src/components/input/input-types.d.ts +1 -1
  58. package/dist/src/components/otp/otp-core.d.ts +1 -1
  59. package/dist/src/components/select/select-core.d.ts +1 -1
  60. package/dist/src/components/select/select-types.d.ts +1 -1
  61. package/dist/src/components/slider/slider-core.d.ts +1 -1
  62. package/dist/src/components/slider/slider-types.d.ts +1 -1
  63. package/dist/src/components/table/filter-suggestion.d.ts +171 -0
  64. package/dist/src/components/table/index.d.ts +5 -4
  65. package/dist/src/components/table/index.shadow.d.ts +5 -4
  66. package/dist/src/components/table/mono-data-grid.d.ts +58 -3
  67. package/dist/src/components/table/mono-table-empty-core.d.ts +37 -0
  68. package/dist/src/components/table/mono-table-search-core.d.ts +22 -3
  69. package/dist/src/components/table/table-types.d.ts +74 -4
  70. package/dist/src/components/tag-input/tag-input-core.d.ts +1 -1
  71. package/dist/src/components/tag-input/tag-input-types.d.ts +1 -1
  72. package/dist/src/components/textarea/textarea-core.d.ts +1 -1
  73. package/dist/src/composables/mono-event.d.ts +7 -1
  74. package/dist/src/entries/index.d.ts +8 -6
  75. package/dist/src/entries/index.node.d.ts +8 -6
  76. package/dist/src/search/index.d.ts +1 -1
  77. package/dist/src/utils/group-count.d.ts +36 -0
  78. package/dist/switch-utils-CTZ4id2V.js +338 -0
  79. package/dist/tabs-core-r5-B8k_N.js +317 -0
  80. package/dist/tag-input-utils-D2JA90DQ.js +3060 -0
  81. package/dist/textarea-utils-VU1KeXm8.js +821 -0
  82. package/dist/ui/accordion.js +2 -274
  83. package/dist/ui/alert.js +2 -131
  84. package/dist/ui/breadcrumb.js +4 -745
  85. package/dist/ui/button-dropdown.js +4 -652
  86. package/dist/ui/button.js +2 -63
  87. package/dist/ui/card.js +2 -310
  88. package/dist/ui/chart.js +4 -800
  89. package/dist/ui/checkbox.js +4 -335
  90. package/dist/ui/chip.js +4 -402
  91. package/dist/ui/date.js +3 -732
  92. package/dist/ui/drawer.js +3 -757
  93. package/dist/ui/dropdown-table.js +5 -1341
  94. package/dist/ui/dropdown.js +4 -509
  95. package/dist/ui/file-upload.js +3 -622
  96. package/dist/ui/filter.js +5 -380
  97. package/dist/ui/form.js +1 -1
  98. package/dist/ui/index.css +130 -5
  99. package/dist/ui/input.js +3 -1141
  100. package/dist/ui/menu.js +4 -828
  101. package/dist/ui/modal.js +4 -843
  102. package/dist/ui/nav.js +4 -223
  103. package/dist/ui/otp.js +4 -756
  104. package/dist/ui/radio.js +4 -317
  105. package/dist/ui/rich-text-editor.js +4 -1278
  106. package/dist/ui/select.js +5 -2138
  107. package/dist/ui/shadow/accordion.js +4 -273
  108. package/dist/ui/shadow/alert.js +4 -130
  109. package/dist/ui/shadow/breadcrumb.js +5 -744
  110. package/dist/ui/shadow/button-dropdown.js +6 -652
  111. package/dist/ui/shadow/button.js +3 -63
  112. package/dist/ui/shadow/card.js +4 -309
  113. package/dist/ui/shadow/chart.js +6 -1576
  114. package/dist/ui/shadow/checkbox.js +4 -334
  115. package/dist/ui/shadow/chip.js +4 -396
  116. package/dist/ui/shadow/date.js +7 -731
  117. package/dist/ui/shadow/drawer.js +4 -756
  118. package/dist/ui/shadow/dropdown-table.js +8 -1762
  119. package/dist/ui/shadow/dropdown.js +4 -508
  120. package/dist/ui/shadow/file-upload.js +4 -620
  121. package/dist/ui/shadow/filter.js +7 -379
  122. package/dist/ui/shadow/input.js +6 -1140
  123. package/dist/ui/shadow/menu.js +5 -828
  124. package/dist/ui/shadow/modal.js +6 -1063
  125. package/dist/ui/shadow/nav.js +5 -223
  126. package/dist/ui/shadow/otp.js +6 -754
  127. package/dist/ui/shadow/radio.js +4 -316
  128. package/dist/ui/shadow/rich-text-editor.js +4 -1276
  129. package/dist/ui/shadow/select.js +6 -2136
  130. package/dist/ui/shadow/sidebar.js +5 -581
  131. package/dist/ui/shadow/slider.js +5 -1010
  132. package/dist/ui/shadow/switch.js +4 -335
  133. package/dist/ui/shadow/table.js +10 -4501
  134. package/dist/ui/shadow/tabs.js +6 -315
  135. package/dist/ui/shadow/tag-input.js +7 -3057
  136. package/dist/ui/shadow/textarea.js +6 -817
  137. package/dist/ui/sidebar.js +3 -581
  138. package/dist/ui/slider.js +4 -1012
  139. package/dist/ui/switch.js +4 -336
  140. package/dist/ui/table.js +9 -4502
  141. package/dist/ui/tabs.js +4 -315
  142. package/dist/ui/tag-input.js +5 -3058
  143. package/dist/ui/textarea.js +4 -819
  144. package/dist/vue.d.ts +3 -2
  145. package/package.json +3 -3
  146. package/dist/chip-strip-bNfLn52Z.js +0 -215
  147. package/dist/data-source-controller-Dx6IQ2CN.js +0 -243
  148. package/dist/data-source-options-BM4r4PRw.js +0 -558
  149. package/dist/data-source-read-HyBCRg1t.js +0 -242
  150. package/dist/excel-BXzr3uI1.js +0 -784
  151. package/dist/export-ixRdCS2y.js +0 -2388
  152. package/dist/field-tooltip-addon-CWCp19mJ.js +0 -702
  153. package/dist/field-tooltip.css_raw-U5UeTa2d.js +0 -269
  154. package/dist/filter-builder-C0T3pMx2.js +0 -208
  155. package/dist/form-control-core-BbiACMtL.js +0 -226
  156. package/dist/icon-ClxnYhBG.js +0 -19
  157. package/dist/import-Dc4eXC02.js +0 -612
  158. package/dist/light-slots-_no0r2Z-.js +0 -246
  159. package/dist/markdown-uGlE_OfJ.js +0 -20191
  160. package/dist/mono-data-grid-Bkr-e1-i.js +0 -4043
  161. package/dist/normalize-error-BmLbgANw.js +0 -1048
@@ -1,226 +0,0 @@
1
- import { a as __decorate, c as defineHybridPropAlias, l as defineHybridPropAliases, s as booleanStringConverter } from "./hydration-flush-BaE9gN3C.js";
2
- import { n as detachEventHandlers, t as applyProps } from "./element-props-xvw0EB7H.js";
3
- import { property } from "lit/decorators.js";
4
-
5
- //#region src/composables/visibility.ts
6
- /**
7
- * The property this module last set on a given host, so showing again clears
8
- * only our own declaration.
9
- *
10
- * Reading the value back instead would be wrong: a consumer who writes
11
- * `style="display: none"` themselves and leaves `visible` alone would have their
12
- * declaration removed on our first update.
13
- */
14
- const OWNED = /* @__PURE__ */ new WeakMap();
15
- const HIDE_VALUE = {
16
- display: "none",
17
- visibility: "hidden"
18
- };
19
- /**
20
- * Write (or clear) the hide style on a HOST element.
21
- *
22
- * Applied to the host, not to the rendered root: light builds render into `this`,
23
- * so hiding the inner root would leave the `<mono-*>` host itself as a flex/grid
24
- * item still occupying its cell. Targeting the host also means one code path
25
- * covers the light build, the shadow build and whatever layout wraps them.
26
- *
27
- * Only ever touches the single property it owns, and only via `removeProperty` —
28
- * never a blanket `cssText` reset — so an inline style the consumer put on the
29
- * host survives a hide/show round trip.
30
- */
31
- function applyVisibility(host, visible, type) {
32
- const style = host.style;
33
- if (!style) return;
34
- const wanted = visible ? null : type === "invisible" ? "visibility" : "display";
35
- const owned = OWNED.get(host);
36
- if (owned && owned !== wanted) {
37
- style.removeProperty(owned);
38
- OWNED.delete(host);
39
- }
40
- if (!wanted) return;
41
- if (style.getPropertyValue(wanted) !== HIDE_VALUE[wanted]) style.setProperty(wanted, HIDE_VALUE[wanted]);
42
- OWNED.set(host, wanted);
43
- }
44
-
45
- //#endregion
46
- //#region src/components/form/form-control-core.ts
47
- /**
48
- * `MonoFormControlCore` — the element half of {@link monoForm}.
49
- *
50
- * Mirrors `table/table-controller-core.ts`: a `.prop`-bound controller
51
- * (`attribute: false`), hybrid aliases so `:data-form` / `:dataForm` /
52
- * `dataform` all land, and a subscribe lifecycle that re-syncs on notify. On top
53
- * of that it does three things the table base doesn't need:
54
- *
55
- * 1. **Reports changes.** Listens to its own `mno-input` / `mno-change` and
56
- * pushes them into the controller with the matching timing (`live` /
57
- * `change`), which is what drives the rules.
58
- * 2. **Applies state.** On every notify it writes the form's value, validation
59
- * and merged props onto itself — assigning ONLY when the value differs, so an
60
- * element updating itself can't feed back into another notify.
61
- * 3. **Lets the form win.** The controller owns the value, so it overwrites a
62
- * local `:model-value`; `inputs[key].props` is merged last by the controller and so
63
- * beats both the `setProp()` method and anything the template set.
64
- *
65
- * SSR-safe: `dataForm` can't cross Declarative Shadow DOM, so on the server this
66
- * is inert and the element renders its normal shell.
67
- */
68
- const MonoFormControlCore = (superClass) => {
69
- class MonoFormControlCoreClass extends superClass {
70
- constructor(...args) {
71
- super(...args);
72
- this.visible = true;
73
- this.visibleType = "none";
74
- this._applying = false;
75
- this._onFormInput = (e) => {
76
- if (this._applying) return;
77
- const form = this.dataForm;
78
- const key = this.keyForm;
79
- if (!form || !key) return;
80
- form._report(key, this._valueOf(e), "live", e);
81
- };
82
- this._onFormChange = (e) => {
83
- if (this._applying) return;
84
- const form = this.dataForm;
85
- const key = this.keyForm;
86
- if (!form || !key) return;
87
- form._report(key, this._valueOf(e), "change", e);
88
- };
89
- defineHybridPropAliases(this, [
90
- "dataForm",
91
- "keyForm",
92
- "visibleType"
93
- ]);
94
- defineHybridPropAlias(this, "controlForm", "dataForm");
95
- }
96
- connectedCallback() {
97
- super.connectedCallback();
98
- this._bindForm();
99
- this.addEventListener("mno-input", this._onFormInput);
100
- this.addEventListener("mno-change", this._onFormChange);
101
- }
102
- disconnectedCallback() {
103
- this.removeEventListener("mno-input", this._onFormInput);
104
- this.removeEventListener("mno-change", this._onFormChange);
105
- this._unbindForm();
106
- super.disconnectedCallback();
107
- }
108
- /**
109
- * Re-bind when the controller or key arrives — Vue assigns `.prop` bindings
110
- * after construction, so `connectedCallback` alone is too early.
111
- *
112
- * This hooks `update()`, NOT `willUpdate()`: most component cores override
113
- * `willUpdate` without chaining `super`, so a `willUpdate` here would
114
- * silently never run. `updated()` is out for the same reason — `date-core`
115
- * overrides it without calling `super.updated()`. Of the ten form controls
116
- * only `dropdown-table-core` overrides `update()`, and it does chain `super`.
117
- */
118
- update(changed) {
119
- if (changed.has("dataForm") || changed.has("keyForm")) this._bindForm();
120
- this._applyVisibility();
121
- super.update(changed);
122
- }
123
- /**
124
- * Push `visible` / `visibleType` onto the host's inline style.
125
- *
126
- * Runs on every update, not just when the two props change: the style lives
127
- * on the host, which nothing else here owns, so re-asserting it is cheap and
128
- * survives anything that resets it.
129
- */
130
- _applyVisibility() {
131
- const visible = typeof this.visible === "string" ? booleanStringConverter.fromAttribute(this.visible) : this.visible !== false;
132
- const type = this.visibleType === "invisible" ? "invisible" : "none";
133
- applyVisibility(this, visible, type);
134
- }
135
- _bindForm() {
136
- this._unbindForm();
137
- const form = this.dataForm;
138
- const key = this.keyForm;
139
- if (!form || !key) return;
140
- this._formUnregister = form._register(key, this);
141
- this._formOff = form.subscribe(() => this._syncFromForm());
142
- if (typeof queueMicrotask === "function") queueMicrotask(() => this._syncFromForm());
143
- else this._syncFromForm();
144
- }
145
- _unbindForm() {
146
- this._formOff?.();
147
- this._formOff = void 0;
148
- this._formUnregister?.();
149
- this._formUnregister = void 0;
150
- detachEventHandlers(this);
151
- }
152
- /**
153
- * Publish this control's RESOLVED options onto `form.items()[key].list`, so a `slot="list"`
154
- * can loop them.
155
- *
156
- * A list component calls this from its render path, so it fires on every render — the
157
- * controller's identity guard is what stops that becoming a notify loop, and it is why the
158
- * caller must hand over a NEW array only when the rows actually moved.
159
- *
160
- * A control with no list never calls it, and its `list` stays `[]`.
161
- */
162
- _publishList(entries) {
163
- const form = this.dataForm;
164
- const key = this.keyForm;
165
- if (!form?._reportList || !key) return;
166
- form._reportList(key, entries);
167
- }
168
- _valueOf(e) {
169
- const detail = e.detail;
170
- if (detail && typeof detail === "object") {
171
- if ("modelValue" in detail) return detail.modelValue;
172
- if ("value" in detail) return detail.value;
173
- }
174
- return this.modelValue;
175
- }
176
- /**
177
- * Pull value + validation + props from the controller onto this element.
178
- * Every write is guarded by an equality check so a sync can't trigger a
179
- * further update cycle.
180
- */
181
- _syncFromForm() {
182
- const form = this.dataForm;
183
- const key = this.keyForm;
184
- if (!form || !key) return;
185
- const item = form.items()[key];
186
- if (!item) return;
187
- const self = this;
188
- let changed = false;
189
- this._applying = true;
190
- try {
191
- if (!Object.is(self.modelValue, item.currentValue)) {
192
- self.modelValue = item.currentValue;
193
- changed = true;
194
- }
195
- if ("validationState" in self) {
196
- const nextState = item.validate.success ? "default" : "invalid";
197
- if (self.validationState !== nextState) {
198
- self.validationState = nextState;
199
- changed = true;
200
- }
201
- const nextMessage = item.validate.success ? "" : item.validate.message;
202
- if (self.validationMessage !== nextMessage) {
203
- self.validationMessage = nextMessage;
204
- changed = true;
205
- }
206
- }
207
- if (applyProps(this, form._propsFor(key))) changed = true;
208
- } finally {
209
- this._applying = false;
210
- }
211
- if (changed) this.requestUpdate();
212
- }
213
- }
214
- __decorate([property({ attribute: false })], MonoFormControlCoreClass.prototype, "dataForm", void 0);
215
- __decorate([property({
216
- type: String,
217
- attribute: "key-form",
218
- reflect: true
219
- })], MonoFormControlCoreClass.prototype, "keyForm", void 0);
220
- __decorate([property({ converter: booleanStringConverter })], MonoFormControlCoreClass.prototype, "visible", void 0);
221
- __decorate([property({ attribute: "visible-type" })], MonoFormControlCoreClass.prototype, "visibleType", void 0);
222
- return MonoFormControlCoreClass;
223
- };
224
-
225
- //#endregion
226
- export { MonoFormControlCore as t };
@@ -1,19 +0,0 @@
1
- import { html } from "lit";
2
- import "lit/directives/unsafe-svg.js";
3
-
4
- //#region src/composables/icon.ts
5
- /**
6
- * Detect whether an icon string is an iconify utility class — e.g.
7
- * `i-mdi-close`, `i-tabler-upload`. UnoCSS's preset-icons resolves these to a
8
- * background/mask, so components render them as an empty `<span class="i-...">`.
9
- *
10
- * Single source of truth — components re-export this from their own
11
- * `*-utils.ts` so their public API stays stable.
12
- */
13
- function isIconifyClass(icon) {
14
- if (!icon || typeof icon !== "string") return false;
15
- return /^i-[a-z0-9]+(?:-[a-z0-9]+)+$/i.test(icon.trim());
16
- }
17
-
18
- //#endregion
19
- export { isIconifyClass as t };