@nanahoshi/mona-ui 0.24.5 → 0.24.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.
Files changed (78) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -137
  3. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +14 -4
  4. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +164 -3
  5. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +124 -140
  6. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +205 -202
  7. package/fesm2022/nanahoshi-mona-ui-filter.mjs +233 -231
  8. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BMCM0W8s.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs} +24 -12
  9. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DDgNmgE0.mjs +208 -0
  10. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-Dzf6Vbs_.mjs +1100 -0
  11. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-C2kf5MwO.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-DAPNqnWV.mjs} +34 -21
  12. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Dh42tUui.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs} +2564 -927
  13. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  14. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +39 -8
  15. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +1 -1
  16. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +3 -6
  17. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +33 -8
  18. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -8
  19. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -8
  20. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +33 -8
  21. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +33 -8
  22. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -8
  23. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +33 -8
  24. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +33 -8
  25. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -8
  26. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +33 -8
  27. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +33 -8
  28. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +33 -8
  29. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +33 -8
  30. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +195 -122
  31. package/fesm2022/nanahoshi-mona-ui-pager.mjs +367 -463
  32. package/fesm2022/nanahoshi-mona-ui-query.mjs +317 -122
  33. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +149 -167
  34. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +182 -137
  35. package/i18n/catalogs/en-US.messages.json +36 -11
  36. package/locales/ar-sa/ar-sa.messages.json +33 -8
  37. package/locales/de-de/de-de.messages.json +33 -8
  38. package/locales/es-es/es-es.messages.json +33 -8
  39. package/locales/fr-fr/fr-fr.messages.json +33 -8
  40. package/locales/id-id/id-id.messages.json +33 -8
  41. package/locales/it-it/it-it.messages.json +33 -8
  42. package/locales/ja-jp/ja-jp.messages.json +33 -8
  43. package/locales/ko-kr/ko-kr.messages.json +33 -8
  44. package/locales/pt-br/pt-br.messages.json +33 -8
  45. package/locales/ru-ru/ru-ru.messages.json +33 -8
  46. package/locales/tr-tr/tr-tr.messages.json +33 -8
  47. package/locales/zh-cn/zh-cn.messages.json +33 -8
  48. package/locales/zh-tw/zh-tw.messages.json +33 -8
  49. package/package.json +2 -2
  50. package/types/nanahoshi-mona-ui-calendar.d.ts +30 -11
  51. package/types/nanahoshi-mona-ui-check-box.d.ts +11 -1
  52. package/types/nanahoshi-mona-ui-date-input.d.ts +74 -3
  53. package/types/nanahoshi-mona-ui-date-picker.d.ts +61 -33
  54. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +79 -38
  55. package/types/nanahoshi-mona-ui-filter.d.ts +54 -32
  56. package/types/nanahoshi-mona-ui-grid.d.ts +359 -110
  57. package/types/nanahoshi-mona-ui-i18n.d.ts +47 -6
  58. package/types/nanahoshi-mona-ui-list-view.d.ts +1 -2
  59. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +31 -6
  60. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +31 -6
  61. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +31 -6
  62. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +31 -6
  63. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +31 -6
  64. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +31 -6
  65. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +31 -6
  66. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +31 -6
  67. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +31 -6
  68. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +31 -6
  69. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +31 -6
  70. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +31 -6
  71. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +31 -6
  72. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +57 -16
  73. package/types/nanahoshi-mona-ui-pager.d.ts +159 -76
  74. package/types/nanahoshi-mona-ui-query.d.ts +45 -14
  75. package/types/nanahoshi-mona-ui-time-picker.d.ts +72 -42
  76. package/types/nanahoshi-mona-ui-time-selector.d.ts +78 -46
  77. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-BSlV8Sua.mjs +0 -176
  78. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-CTOdnH29.mjs +0 -946
@@ -192,34 +192,51 @@ declare const MONA_ZH_TW_LOCALE: {
192
192
  isNull: string;
193
193
  isNullOrEmpty: string;
194
194
  isTrue: string;
195
+ logic: string;
196
+ operator: string;
195
197
  or: string;
198
+ secondOperator: string;
199
+ secondValue: string;
196
200
  startsWith: string;
201
+ value: string;
197
202
  };
198
203
  grid: {
199
204
  all: string;
200
205
  apply: string;
201
206
  cancel: string;
202
- cancelRowEdit: string;
207
+ cancelNewRow: string;
208
+ cancelRowEdit: (rowNumber: number) => string;
209
+ clearFilter: (column: string) => string;
210
+ collapseDetail: (rowNumber: number) => string;
211
+ columnGrouped: (column: string) => string;
212
+ columnMoved: (column: string, position: number) => string;
203
213
  columns: string;
204
214
  columnsSelected: (count: number) => string;
215
+ commandColumnTitle: string;
205
216
  delete: string;
206
- deleteRowConfirmation: string;
217
+ deleteRowConfirmation: (rowNumber: number) => string;
207
218
  deleteRowTitle: string;
219
+ details: string;
208
220
  dragColumnHeaderToGroup: string;
209
221
  edit: string;
210
- editRow: string;
222
+ editRow: (rowNumber: number) => string;
223
+ expandDetail: (rowNumber: number) => string;
211
224
  fieldValidationError: string;
212
225
  filterByColumn: (column: string) => string;
226
+ filterByColumnFiltered: (column: string) => string;
227
+ filterOperator: (column: string, operator: string) => string;
213
228
  filterPlaceholder: string;
229
+ group: string;
230
+ loading: string;
214
231
  modified: string;
215
232
  moveAsNext: string;
216
233
  moveAsPrevious: string;
217
234
  moveRow: string;
218
235
  noData: string;
219
236
  remove: string;
220
- removeRow: string;
237
+ removeRow: (rowNumber: number) => string;
221
238
  reorderRow: (rowNumber: number) => string;
222
- resizeColumn: string;
239
+ resizeColumn: (column: string) => string;
223
240
  rowReorder: string;
224
241
  rowReorderDisabled: string;
225
242
  rowReorderDisabledEditing: string;
@@ -234,9 +251,12 @@ declare const MONA_ZH_TW_LOCALE: {
234
251
  rowReorderMoved: (fromRowNumber: number, toPosition: number) => string;
235
252
  rowValidationError: string;
236
253
  save: string;
237
- saveRow: string;
254
+ saveNewRow: string;
255
+ saveRow: (rowNumber: number) => string;
238
256
  selectAllRows: string;
239
257
  selectRow: (rowNumber: number) => string;
258
+ sortOrder: (position: number) => string;
259
+ toolbar: string;
240
260
  };
241
261
  list: {
242
262
  filterList: string;
@@ -273,15 +293,20 @@ declare const MONA_ZH_TW_LOCALE: {
273
293
  };
274
294
  pager: {
275
295
  firstPageLabel: string;
296
+ itemsPerPageLabel: string;
276
297
  jumpBackwardLabel: (pages: number) => string;
277
298
  jumpForwardLabel: (pages: number) => string;
278
299
  lastPageLabel: string;
279
300
  nextPageLabel: string;
280
301
  ofText: string;
302
+ pageInputPrefix: (_totalPages: number) => string;
303
+ pageInputSuffix: (totalPages: number) => string;
281
304
  pageLabel: (page: number) => string;
305
+ pageSelectLabel: string;
282
306
  pageSizeLabel: (pageSize: number) => string;
283
307
  pageStatus: (page: number, totalPages: number) => string;
284
308
  pageText: string;
309
+ pagerLabel: string;
285
310
  previousPageLabel: string;
286
311
  rangeStatus: (start: number, end: number, total: number) => string;
287
312
  };
@@ -37,6 +37,8 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
37
37
  protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaNumericTextBoxMessages>;
38
38
  protected readonly prefixTemplateList: Signal<readonly TemplateRef<any>[]>;
39
39
  protected readonly rawInputValue: _angular_core.WritableSignal<string>;
40
+ /** Spin buttons on a read-only field would look usable but do nothing, so they are hidden there. */
41
+ protected readonly showSpinners: Signal<boolean>;
40
42
  protected readonly spin$: Subject<NumericTextBoxStepDirection>;
41
43
  protected readonly spinButtonClasses: Signal<string>;
42
44
  protected readonly spinButtonIconSize: Signal<20 | 16 | 14>;
@@ -45,9 +47,21 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
45
47
  protected readonly valueTextBoxRef: Signal<ElementRef<HTMLInputElement>>;
46
48
  protected readonly wheel$: Subject<WheelEvent>;
47
49
  /**
48
- * @description ARIA label for the input.
50
+ * @description ID of an element that provides an extended description for the input, such as a hint or an
51
+ * error message.
52
+ * @default ""
53
+ */
54
+ readonly ariaDescribedBy: _angular_core.InputSignal<string>;
55
+ /**
56
+ * @description Accessible name for the input. Prefer a visible label, linked through {@link inputId} or
57
+ * {@link ariaLabelledBy}.
49
58
  */
50
59
  readonly ariaLabel: _angular_core.InputSignal<string | null>;
60
+ /**
61
+ * @description ID of an external element that provides the accessible name for the input.
62
+ * @default ""
63
+ */
64
+ readonly ariaLabelledBy: _angular_core.InputSignal<string>;
51
65
  /**
52
66
  * @description Number of fractional decimal places to display and accept. Values are truncated to an integer
53
67
  * and clamped to the range 0–20. Non-finite and negative values normalize to 0.
@@ -57,9 +71,10 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
57
71
  /**
58
72
  * @description Sets whether the input is disabled.
59
73
  */
60
- readonly disabled: _angular_core.InputSignal<boolean>;
74
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
61
75
  /**
62
- * @description Emits when the inner input element is blurred.
76
+ * @description Emits when focus leaves the component, after the value has been clamped to the bounds. Moving
77
+ * focus between the input and elements inside the component (such as a prefix template) doesn't count.
63
78
  */
64
79
  readonly inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
65
80
  /**
@@ -70,24 +85,36 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
70
85
  * @description Emits when the inner input element loses focus.
71
86
  */
72
87
  readonly inputFocusOut: _angular_core.OutputEmitterRef<FocusEvent>;
88
+ /**
89
+ * @description ID of the inner input, so a `<label for>` or `<mona-label for>` can point at it.
90
+ * @default a generated ID
91
+ */
92
+ readonly inputId: _angular_core.InputSignal<string>;
73
93
  /**
74
94
  * @description Marks the text box as invalid. When bound to a signal form field via `[formField]`,
75
95
  * this is written by the `FormField` directive.
76
96
  * @default false
77
97
  */
78
- readonly invalid: _angular_core.InputSignal<boolean>;
98
+ readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
99
+ /**
100
+ * @description Sets whether the input can be empty. When `false`, leaving an empty field sets it to the
101
+ * minimum, or to zero when there is no minimum (clamped to the maximum).
102
+ */
103
+ readonly nullable: _angular_core.InputSignalWithTransform<boolean, unknown>;
79
104
  /**
80
- * @description Sets whether the input can be empty.
105
+ * @description Text shown in the input while it is empty. It isn't a label: it disappears once there is a
106
+ * value.
107
+ * @default ""
81
108
  */
82
- readonly nullable: _angular_core.InputSignal<boolean>;
109
+ readonly placeholder: _angular_core.InputSignal<string>;
83
110
  /**
84
- * @description Sets whether the input is readonly.
111
+ * @description Sets whether the input is readonly. The spin buttons are hidden while it is.
85
112
  */
86
- readonly readonly: _angular_core.InputSignal<boolean>;
113
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
87
114
  /**
88
115
  * @description Sets whether the input is required.
89
116
  */
90
- readonly required: _angular_core.InputSignal<boolean>;
117
+ readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
91
118
  /**
92
119
  * @description Sets the border radius of the input.
93
120
  */
@@ -99,14 +126,14 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
99
126
  /**
100
127
  * @description Sets whether the spin buttons are visible.
101
128
  */
102
- readonly spinners: _angular_core.InputSignal<boolean>;
129
+ readonly spinners: _angular_core.InputSignalWithTransform<boolean, unknown>;
103
130
  /**
104
131
  * @description Tab index of the input.
105
132
  */
106
133
  readonly tabindex: _angular_core.InputSignal<number>;
107
134
  /**
108
- * @description Emitted when the text box is interacted with on blur, value change, or spinner update.
109
- * The `FormField` directive listens to this to mark the field as touched.
135
+ * @description Emitted when focus leaves the component, as a native input is touched on blur. Typing and
136
+ * spinning don't count. The `FormField` directive listens to this to mark the field as touched.
110
137
  */
111
138
  readonly touch: _angular_core.OutputEmitterRef<void>;
112
139
  /**
@@ -114,7 +141,7 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
114
141
  * this is written by the `FormField` directive.
115
142
  * @default false
116
143
  */
117
- readonly touched: _angular_core.InputSignal<boolean>;
144
+ readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
118
145
  /**
119
146
  * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
120
147
  * @default ""
@@ -129,12 +156,22 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
129
156
  abstract readonly minValue: Signal<TValue | null>;
130
157
  abstract readonly value: ModelSignal<TValue | null>;
131
158
  constructor();
159
+ /** Steps the value down by `step` and moves focus to the input. */
132
160
  decrease(): void;
133
- focus(): void;
161
+ /**
162
+ * Moves focus to the input, with the caret at the end.
163
+ * @param options passed to the native `focus()` call, for example `{ preventScroll: true }`.
164
+ */
165
+ focus(options?: FocusOptions): void;
166
+ /** Steps the value up by `step` and moves focus to the input. */
134
167
  increase(): void;
168
+ /** Runs when focus leaves an element inside the component: clamps the value and marks the field touched. */
135
169
  onBlur(event: FocusEvent): void;
136
170
  protected applyRawValue(text: string): void;
137
171
  protected onPaste(event: ClipboardEvent): void;
172
+ protected onSpinPointerDown(event: PointerEvent, direction: NumericTextBoxStepDirection): void;
173
+ /** Limits a value to the min and max bounds. */
174
+ private clampValue;
138
175
  private commitValue;
139
176
  private correctValue;
140
177
  private formatEditValue;
@@ -146,12 +183,13 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
146
183
  private insertLocaleDecimal;
147
184
  private parseValue;
148
185
  private setBeforeInputSubscription;
149
- private setInputFocusSubscription;
150
186
  private setKeydownSubscription;
187
+ private setOwnValue;
151
188
  private setSpinSubscription;
152
189
  private setSubscriptions;
153
190
  private setValueChangeSubscription;
154
191
  private setWheelSubscription;
192
+ private spinToBound;
155
193
  private spinValue;
156
194
  /** Negative when `a < b`, zero when equal, positive when `a > b`. */
157
195
  protected abstract compareValues(a: TValue, b: TValue): number;
@@ -162,7 +200,7 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
162
200
  /** The value one step up or down from `value`. */
163
201
  protected abstract stepValue(value: TValue, direction: NumericTextBoxStepDirection): TValue;
164
202
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NumericTextBoxBaseComponent<any>, never>;
165
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NumericTextBoxBaseComponent<any>, never, never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "decimals": { "alias": "decimals"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "nullable": { "alias": "nullable"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "spinners": { "alias": "spinners"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; "inputFocusOut": "inputFocusOut"; "touch": "touch"; }, ["prefixTemplateList"], never, true, never>;
203
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NumericTextBoxBaseComponent<any>, never, never, { "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "decimals": { "alias": "decimals"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "nullable": { "alias": "nullable"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "spinners": { "alias": "spinners"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; "inputFocusOut": "inputFocusOut"; "touch": "touch"; }, ["prefixTemplateList"], never, true, never>;
166
204
  }
167
205
 
168
206
  /**
@@ -230,7 +268,10 @@ declare class NumericTextBoxComponent extends NumericTextBoxBaseComponent<number
230
268
  */
231
269
  readonly value: _angular_core.ModelSignal<number | null>;
232
270
  private static calculate;
271
+ /** The number of fraction digits, including those of exponent forms such as `1e-7`. */
233
272
  private static getPrecision;
273
+ /** -0 reads and shows as "-0"; the field treats it as zero. */
274
+ private static withoutNegativeZero;
234
275
  protected compareValues(a: number, b: number): number;
235
276
  protected readEditText(text: string, localeId: string, decimals: number): NumericTextBoxTextResult<number>;
236
277
  protected readLocaleText(text: string, localeId: string, decimals: number): NumericTextBoxTextResult<number>;