@mono-lit/helper 0.0.9 → 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-DTqDBca7.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-B2iRpJuI.js → mono-data-dropdown-Bgj2PDfm.js} +1 -1
  38. package/dist/{mono-data-grid-llJCX9MC.js → mono-data-grid-DJkp96N-.js} +144 -46
  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 +22 -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 +118 -1
  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-e9ZVBlNN.js +0 -4240
  161. package/dist/normalize-error-BmLbgANw.js +0 -1048
package/dist/ui/filter.js CHANGED
@@ -1,385 +1,10 @@
1
- import { c as splitMulti, d as OPERATOR_ARITY, l as treeToArray, m as operatorsFor, n as arrayToTree, s as odataStringToArray, t as arrayToODataString, u as DEFAULT_TEXTS } from "../filter-odata-Bi27XUpQ.js";
2
- import { t as monoFilterBuilder } from "../filter-builder-C0T3pMx2.js";
3
- import { d as buildSizeStyle } from "../mono-ui-kvLVIf1V.js";
4
- import { n as detachEventHandlers, t as applyProps } from "../element-props-xvw0EB7H.js";
1
+ import { d as OPERATOR_ARITY, l as treeToArray, m as operatorsFor, n as arrayToTree, s as odataStringToArray, t as arrayToODataString, u as DEFAULT_TEXTS } from "../filter-odata-GsczYKNC.js";
2
+ import { t as monoFilterBuilder } from "../filter-builder-vbqIuPhX.js";
5
3
  import { t as customElement } from "../mono-element-CKcT0rwv.js";
6
- import { a as defineHybridPropAliases, i as defineHybridPropAlias, t as __decorate } from "../decorate-DbYFpi8R.js";
7
- import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
8
- import { LitElement, html, isServer, nothing } from "lit";
9
- import { property, state } from "lit/decorators.js";
10
- import { styleMap } from "lit/directives/style-map.js";
4
+ import { t as __decorate } from "../decorate-DbYFpi8R.js";
5
+ import { t as MonoFilterBuilderCore } from "../filter-builder-core-DyWjbBP7.js";
6
+ import { LitElement, html } from "lit";
11
7
 
12
- //#region src/components/filter/filter-builder-core.ts
13
- const GROUP_OPS = [
14
- "and",
15
- "or",
16
- "notAnd",
17
- "notOr"
18
- ];
19
- /**
20
- * `MonoFilterBuilderCore` — render-mode-agnostic logic for `mono-filter-builder`.
21
- *
22
- * Renders the controller's node tree as nested inline rows:
23
- *
24
- * ```
25
- * Match [any ▾] of the following rules:
26
- * | field ▾ | operator ▾ | value | ⑃ | 🗑 |
27
- * ```
28
- *
29
- * Per repo convention it renders **native** `<select>` / `<input>` carrying
30
- * its OWN control classes — no component here embeds another `mono-*`
31
- * element (`mono-table-search` set that precedent), so the controls match the rest
32
- * of the library without a cross-element dependency.
33
- */
34
- const MonoFilterBuilderCore = (superClass) => {
35
- class MonoFilterBuilderCoreClass extends superClass {
36
- constructor(...args) {
37
- super(...args);
38
- this.size = "sm";
39
- this._tick = 0;
40
- this._applyQueued = false;
41
- defineHybridPropAliases(this, [
42
- "dataFilter",
43
- "minWidth",
44
- "maxWidth",
45
- "minHeight",
46
- "maxHeight"
47
- ]);
48
- defineHybridPropAlias(this, "controlFilterBuilder", "dataFilter");
49
- }
50
- connectedCallback() {
51
- super.connectedCallback();
52
- this._subscribe();
53
- }
54
- disconnectedCallback() {
55
- this._off?.();
56
- this._off = void 0;
57
- super.disconnectedCallback();
58
- }
59
- willUpdate(changed) {
60
- if (changed.has("dataFilter")) this._subscribe();
61
- super.willUpdate?.(changed);
62
- }
63
- /**
64
- * Drive the apply from `update()` as well as `_subscribe()` — every render
65
- * reaches here, so a controller that arrives late (or a `setProps` that
66
- * lands between subscriptions) can't be missed. This is the lesson
67
- * `table-controller-core` records: hanging the apply off `_subscribe` alone
68
- * silently skips anything that overrides it.
69
- */
70
- update(changed) {
71
- this._scheduleApplyProps();
72
- super.update(changed);
73
- }
74
- _subscribe() {
75
- if (isServer) return;
76
- this._off?.();
77
- detachEventHandlers(this);
78
- this._off = this.dataFilter?.subscribe(() => {
79
- this._tick += 1;
80
- this._scheduleApplyProps();
81
- this._emitChange();
82
- });
83
- this._scheduleApplyProps();
84
- }
85
- /**
86
- * Deferred + de-duplicated: the apply writes reactive props, and doing that
87
- * inside the update cycle would trip Lit's change-in-update warning.
88
- */
89
- _scheduleApplyProps() {
90
- if (isServer) return;
91
- if (this._applyQueued) return;
92
- if (typeof queueMicrotask !== "function") {
93
- this._applyControllerProps();
94
- return;
95
- }
96
- this._applyQueued = true;
97
- queueMicrotask(() => {
98
- this._applyQueued = false;
99
- this._applyControllerProps();
100
- });
101
- }
102
- /**
103
- * Pull `controlMonoFilterBuilder({ props })` onto this element, so the
104
- * template needs nothing but the controller binding.
105
- *
106
- * The CONTROLLER WINS for keys it declares (matching `monoDataGrid` and
107
- * `monoForm`); keys it doesn't mention are left to whatever the template set.
108
- * `applyProps` supplies the skip-undefined, read-only and equality guards, so
109
- * a sync can neither throw nor schedule another update cycle.
110
- *
111
- * `?.props` is optional-called on purpose: a controller built before this
112
- * option existed simply contributes nothing.
113
- */
114
- _applyControllerProps() {
115
- applyProps(this, this.dataFilter?.props?.());
116
- }
117
- _emitChange() {
118
- const ctrl = this.dataFilter;
119
- if (!ctrl) return;
120
- dispatchMonoEvent(this, "change", {
121
- filter: ctrl.changed(),
122
- array: ctrl.changed({ type: "array" }),
123
- string: ctrl.changed({ type: "string" })
124
- });
125
- }
126
- /** Internal icon — light: UnoCSS classes; shadow: inline SVG. */
127
- renderIcon(_name) {
128
- return html``;
129
- }
130
- get _texts() {
131
- return this.dataFilter?.texts;
132
- }
133
- _dataType(field) {
134
- return this.dataFilter?.fields.find((f) => f.field === field)?.dataType ?? "string";
135
- }
136
- /**
137
- * One `<option>` whose selection is bound as a **property**.
138
- *
139
- * Binding `.value` on the `<select>` instead is unreliable here: an operator
140
- * list changes in the SAME render as the value it should show (picking a number
141
- * field swaps the whole option set), and the assignment lands before the new
142
- * options exist — leaving the browser on a stale `selectedIndex`. Setting
143
- * `.selected` per option moves `selectedIndex` after the options are in place.
144
- */
145
- _option(value, label, current) {
146
- return html`<option value=${value} .selected=${value === current}>${label}</option>`;
147
- }
148
- /**
149
- * The value editor for a rule. Arity decides the shape: `0` disables the cell
150
- * (the blank checks need no operand), `2` renders a from/to pair, `many` takes
151
- * comma-separated entry, and a field with `values` renders a select.
152
- */
153
- _renderValue(rule) {
154
- const t = this._texts;
155
- const arity = OPERATOR_ARITY[rule.operator];
156
- const dt = this._dataType(rule.field);
157
- const def = this.dataFilter?.fields.find((f) => f.field === rule.field);
158
- const nativeType = dt === "number" ? "number" : dt === "date" ? "date" : dt === "datetime" ? "datetime-local" : "text";
159
- const cls = "mono-filter-control mono-filter-value";
160
- if (arity === 0) return html`<input class=${cls} mono-filter-control mono-filter-value disabled placeholder="—" aria-label="No value needed" />`;
161
- if (def?.values?.length) return html`
162
- <select
163
- class=${cls} mono-filter-control mono-filter-value
164
- @change=${(e) => this.dataFilter?.updateRule(rule.id, { value: e.target.value })}
165
- >
166
- ${this._option("", t?.valuePlaceholder ?? "", String(rule.value ?? ""))}
167
- ${def.values.map((v) => this._option(String(v.value), v.label ?? String(v.value), String(rule.value ?? "")))}
168
- </select>
169
- `;
170
- if (dt === "boolean") return html`
171
- <select
172
- class=${cls} mono-filter-control mono-filter-value
173
- @change=${(e) => this.dataFilter?.updateRule(rule.id, { value: e.target.value })}
174
- >
175
- ${this._option("", t?.valuePlaceholder ?? "", String(rule.value ?? ""))}
176
- ${this._option("true", "true", String(rule.value ?? ""))}
177
- ${this._option("false", "false", String(rule.value ?? ""))}
178
- </select>
179
- `;
180
- if (arity === 2) {
181
- const pair = Array.isArray(rule.value) ? rule.value : ["", ""];
182
- const setAt = (idx, v) => {
183
- const next = [pair[0] ?? "", pair[1] ?? ""];
184
- next[idx] = v;
185
- this.dataFilter?.updateRule(rule.id, { value: next });
186
- };
187
- return html`
188
- <span class="mono-filter-range" mono-filter-range>
189
- <input
190
- class=${cls} mono-filter-control mono-filter-value
191
- type=${nativeType}
192
- .value=${String(pair[0] ?? "")}
193
- @input=${(e) => setAt(0, e.target.value)}
194
- />
195
- <input
196
- class=${cls} mono-filter-control mono-filter-value
197
- type=${nativeType}
198
- .value=${String(pair[1] ?? "")}
199
- @input=${(e) => setAt(1, e.target.value)}
200
- />
201
- </span>
202
- `;
203
- }
204
- const shown = Array.isArray(rule.value) ? rule.value.join(", ") : String(rule.value ?? "");
205
- return html`
206
- <input
207
- class=${cls} mono-filter-control mono-filter-value
208
- type=${arity === "many" ? "text" : nativeType}
209
- .value=${shown}
210
- placeholder=${arity === "many" ? t?.multiValuePlaceholder ?? "" : t?.valuePlaceholder ?? ""}
211
- @input=${(e) => {
212
- const raw = e.target.value;
213
- this.dataFilter?.updateRule(rule.id, { value: arity === "many" ? splitMulti(raw) : raw });
214
- }}
215
- />
216
- `;
217
- }
218
- _renderRule(rule) {
219
- const ctrl = this.dataFilter;
220
- const t = this._texts;
221
- const ops = operatorsFor(this._dataType(rule.field));
222
- return html`
223
- <div class="mono-filter-row" mono-filter-row data-rule=${rule.id}>
224
- <select
225
- class="mono-filter-control mono-filter-field" mono-filter-control mono-filter-field
226
- @change=${(e) => ctrl?.updateRule(rule.id, { field: e.target.value })}
227
- >
228
- ${ctrl?.fields.map((f) => this._option(f.field, f.caption ?? f.field, rule.field))}
229
- </select>
230
-
231
- <select
232
- class="mono-filter-control mono-filter-op" mono-filter-control mono-filter-op
233
- @change=${(e) => ctrl?.updateRule(rule.id, { operator: e.target.value })}
234
- >
235
- ${ops.map((op) => this._option(op, t?.[op] ?? op, rule.operator))}
236
- </select>
237
-
238
- <span class="mono-filter-value-cell" mono-filter-value-cell>${this._renderValue(rule)}</span>
239
-
240
- <button
241
- type="button"
242
- class="mono-filter-icon-btn" mono-filter-icon-btn
243
- title=${t?.addNested ?? ""}
244
- aria-label=${t?.addNested ?? ""}
245
- @click=${() => ctrl?.nest(rule.id)}
246
- >
247
- ${this.renderIcon("nested")}
248
- </button>
249
- <button
250
- type="button"
251
- class="mono-filter-icon-btn danger" mono-filter-icon-btn mono-danger
252
- title=${t?.remove ?? ""}
253
- aria-label=${t?.remove ?? ""}
254
- @click=${() => ctrl?.remove(rule.id)}
255
- >
256
- ${this.renderIcon("trash")}
257
- </button>
258
- </div>
259
- `;
260
- }
261
- _renderGroup(group, level) {
262
- const ctrl = this.dataFilter;
263
- const t = this._texts;
264
- const isRoot = level === 0;
265
- return html`
266
- <div class="mono-filter-group" mono-filter-group data-group=${group.id} style=${`--_mono-filter-level:${level}`}>
267
- <div class="mono-filter-group-head" mono-filter-group-head>
268
- <span class="mono-filter-match" mono-filter-match>${t?.matchPrefix}</span>
269
- <select
270
- class="mono-filter-control mono-filter-group-op" mono-filter-control mono-filter-group-op
271
- @change=${(e) => ctrl?.setGroupOperator(group.id, e.target.value)}
272
- >
273
- ${GROUP_OPS.map((op) => this._option(op, t?.[op] ?? op, group.operator))}
274
- </select>
275
- <span class="mono-filter-match" mono-filter-match>${t?.matchSuffix}</span>
276
- ${isRoot ? nothing : html`
277
- <span class="mono-filter-group-actions" mono-filter-group-actions>
278
- <button
279
- type="button"
280
- class="mono-filter-icon-btn" mono-filter-icon-btn
281
- title=${t?.addRule ?? ""}
282
- @click=${() => ctrl?.addRule(group.id)}
283
- >
284
- ${this.renderIcon("plus")}
285
- </button>
286
- <button
287
- type="button"
288
- class="mono-filter-icon-btn danger" mono-filter-icon-btn mono-danger
289
- title=${t?.remove ?? ""}
290
- @click=${() => ctrl?.remove(group.id)}
291
- >
292
- ${this.renderIcon("trash")}
293
- </button>
294
- </span>
295
- `}
296
- </div>
297
-
298
- <div class="mono-filter-children" mono-filter-children>
299
- ${group.children.map((child) => this._renderNode(child, level + 1))}
300
- ${isRoot && !group.children.length ? html`<div class="mono-filter-empty" mono-filter-empty>${t?.emptyHint}</div>` : nothing}
301
- </div>
302
- </div>
303
- `;
304
- }
305
- _renderNode(node, level) {
306
- return node.kind === "group" ? this._renderGroup(node, level) : this._renderRule(node);
307
- }
308
- render() {
309
- const ctrl = this.dataFilter;
310
- if (!ctrl) return html``;
311
- const t = ctrl.texts;
312
- this._tick;
313
- return html`
314
- <div
315
- class="mono-filter ${this.size}"
316
- mono-filter-builder
317
- mono-size=${this.size === "sm" ? nothing : this.size}
318
- style=${styleMap(buildSizeStyle(this))}
319
- >
320
- ${ctrl.actions ? html`
321
- <div class="mono-filter-actions" mono-filter-actions>
322
- <button
323
- type="button"
324
- class="mono-filter-btn primary" mono-filter-btn
325
- @click=${() => dispatchMonoEvent(this, "apply", {
326
- filter: ctrl.changed(),
327
- array: ctrl.changed({ type: "array" }),
328
- string: ctrl.changed({ type: "string" })
329
- })}
330
- >
331
- ${t.apply}
332
- </button>
333
- <button
334
- type="button"
335
- class="mono-filter-btn ghost" mono-filter-btn mono-variant="ghost"
336
- @click=${() => {
337
- ctrl.clear();
338
- dispatchMonoEvent(this, "clear", { filter: null });
339
- }}
340
- >
341
- ${t.clear}
342
- </button>
343
- </div>
344
- ` : nothing}
345
- ${this._renderGroup(ctrl.tree, 0)}
346
- <div class="mono-filter-add" mono-filter-add>
347
- <button type="button" class="mono-filter-link" mono-filter-link @click=${() => ctrl.addRule()}>
348
- ${t.addRule}
349
- </button>
350
- <button type="button" class="mono-filter-link" mono-filter-link @click=${() => ctrl.addGroup()}>
351
- ${t.addGroup}
352
- </button>
353
- </div>
354
- </div>
355
- `;
356
- }
357
- }
358
- __decorate([property({ attribute: false })], MonoFilterBuilderCoreClass.prototype, "dataFilter", void 0);
359
- __decorate([property({ type: String })], MonoFilterBuilderCoreClass.prototype, "size", void 0);
360
- __decorate([property({ type: String })], MonoFilterBuilderCoreClass.prototype, "width", void 0);
361
- __decorate([property({ type: String })], MonoFilterBuilderCoreClass.prototype, "height", void 0);
362
- __decorate([property({
363
- attribute: "min-width",
364
- type: String
365
- })], MonoFilterBuilderCoreClass.prototype, "minWidth", void 0);
366
- __decorate([property({
367
- attribute: "max-width",
368
- type: String
369
- })], MonoFilterBuilderCoreClass.prototype, "maxWidth", void 0);
370
- __decorate([property({
371
- attribute: "min-height",
372
- type: String
373
- })], MonoFilterBuilderCoreClass.prototype, "minHeight", void 0);
374
- __decorate([property({
375
- attribute: "max-height",
376
- type: String
377
- })], MonoFilterBuilderCoreClass.prototype, "maxHeight", void 0);
378
- __decorate([state()], MonoFilterBuilderCoreClass.prototype, "_tick", void 0);
379
- return MonoFilterBuilderCoreClass;
380
- };
381
-
382
- //#endregion
383
8
  //#region src/components/filter/mono-filter-builder.ts
384
9
  let MonoFilterBuilder = class MonoFilterBuilder extends MonoFilterBuilderCore(LitElement) {
385
10
  createRenderRoot() {
package/dist/ui/form.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as runRules, n as isBlank, r as runRule, t as monoForm } from "../mono-form-controller-BrA10erm.js";
1
+ import { i as runRules, n as isBlank, r as runRule, t as monoForm } from "../mono-form-controller-DxZLvyg6.js";
2
2
  import { t as MonoFormControlCore } from "../form-control-core-CRZPZ1ru.js";
3
3
 
4
4
  export { MonoFormControlCore, monoForm as controlMonoForm, monoForm, isBlank, runRule, runRules };