@nanahoshi/mona-ui 0.36.1 → 0.38.0

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 (91) hide show
  1. package/docs/api/common.md +1 -1
  2. package/docs/api/dropdown-list.md +2 -0
  3. package/docs/api/dropdown-tree.md +81 -0
  4. package/docs/api/dropdowns.md +34 -8
  5. package/docs/api/editor.md +67 -0
  6. package/docs/api/file-upload.md +1 -1
  7. package/docs/api/i18n.md +49 -4
  8. package/docs/api/list.md +1 -1
  9. package/docs/api/locales.md +14 -14
  10. package/docs/api/multi-select-tree.md +75 -0
  11. package/docs/api/multi-select.md +3 -1
  12. package/docs/api/popup.md +1 -1
  13. package/docs/api/tree-view.md +2 -2
  14. package/docs/auto-complete.md +2 -0
  15. package/docs/combo-box.md +2 -0
  16. package/docs/dropdown-list.md +52 -0
  17. package/docs/dropdown-tree.md +427 -0
  18. package/docs/editor.md +238 -9
  19. package/docs/multi-select-tree.md +353 -0
  20. package/docs/multi-select.md +6 -0
  21. package/dropdown-tree/package.json +4 -0
  22. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +40 -5
  23. package/fesm2022/nanahoshi-mona-ui-dropdown-tree.mjs +1061 -0
  24. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -60
  25. package/fesm2022/nanahoshi-mona-ui-editor.mjs +1356 -192
  26. package/fesm2022/nanahoshi-mona-ui-file-upload.mjs +28 -94
  27. package/fesm2022/nanahoshi-mona-ui-filter.mjs +2 -0
  28. package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
  29. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +63 -1
  30. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +80 -37
  31. package/fesm2022/nanahoshi-mona-ui-internal.mjs +83 -2
  32. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +66 -1
  33. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +30 -1
  34. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +42 -1
  35. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +42 -1
  36. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +24 -1
  37. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +42 -1
  38. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +24 -1
  39. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +24 -1
  40. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +64 -1
  41. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +42 -1
  42. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +64 -1
  43. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +24 -1
  44. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +24 -1
  45. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +24 -1
  46. package/fesm2022/nanahoshi-mona-ui-multi-select-tree.mjs +1179 -0
  47. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +42 -7
  48. package/fesm2022/nanahoshi-mona-ui-pager.mjs +3 -1
  49. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -1
  50. package/i18n/catalogs/en-US.messages.json +26 -1
  51. package/llms.txt +7 -3
  52. package/locales/ar-sa/ar-sa.messages.json +26 -1
  53. package/locales/de-de/de-de.messages.json +26 -1
  54. package/locales/es-es/es-es.messages.json +26 -1
  55. package/locales/fr-fr/fr-fr.messages.json +26 -1
  56. package/locales/id-id/id-id.messages.json +26 -1
  57. package/locales/it-it/it-it.messages.json +26 -1
  58. package/locales/ja-jp/ja-jp.messages.json +26 -1
  59. package/locales/ko-kr/ko-kr.messages.json +26 -1
  60. package/locales/pl-pl/pl-pl.messages.json +26 -1
  61. package/locales/pt-br/pt-br.messages.json +26 -1
  62. package/locales/ru-ru/ru-ru.messages.json +26 -1
  63. package/locales/tr-tr/tr-tr.messages.json +26 -1
  64. package/locales/zh-cn/zh-cn.messages.json +26 -1
  65. package/locales/zh-tw/zh-tw.messages.json +26 -1
  66. package/multi-select-tree/package.json +4 -0
  67. package/package.json +9 -1
  68. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +33 -5
  69. package/types/nanahoshi-mona-ui-dropdown-tree.d.ts +414 -0
  70. package/types/nanahoshi-mona-ui-dropdowns.d.ts +198 -8
  71. package/types/nanahoshi-mona-ui-editor.d.ts +124 -2
  72. package/types/nanahoshi-mona-ui-file-upload.d.ts +1 -0
  73. package/types/nanahoshi-mona-ui-i18n.d.ts +44 -0
  74. package/types/nanahoshi-mona-ui-internal-tree.d.ts +36 -0
  75. package/types/nanahoshi-mona-ui-internal.d.ts +37 -0
  76. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +25 -0
  77. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +25 -0
  78. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +25 -0
  79. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +25 -0
  80. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +25 -0
  81. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +25 -0
  82. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +25 -0
  83. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +25 -0
  84. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +25 -0
  85. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +25 -0
  86. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +25 -0
  87. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +25 -0
  88. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +25 -0
  89. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +25 -0
  90. package/types/nanahoshi-mona-ui-multi-select-tree.d.ts +456 -0
  91. package/types/nanahoshi-mona-ui-multi-select.d.ts +43 -7
@@ -210,7 +210,11 @@
210
210
  "dropdownList": {
211
211
  "clear": "清除"
212
212
  },
213
+ "dropdownTree": {
214
+ "clear": "清除"
215
+ },
213
216
  "dropdowns": {
217
+ "close": "关闭",
214
218
  "itemPosition": "{text},第 {position} 项(共 {total} 项)",
215
219
  "noResultsFound": "未找到结果",
216
220
  "resultsAvailable": "有 {count} 条可用结果"
@@ -232,6 +236,10 @@
232
236
  "backgroundColor": "背景颜色",
233
237
  "bold": "粗体",
234
238
  "cancel": "取消",
239
+ "characterCount": "{count} 个字符",
240
+ "characterLimitHint": "最多可输入 {limit} 个字符。",
241
+ "charactersLeft": "还可输入 {count} 个字符",
242
+ "charactersOver": "超出 {count} 个字符",
235
243
  "codeBlock": "代码块",
236
244
  "color": "颜色",
237
245
  "contentLabel": "富文本编辑器",
@@ -239,6 +247,7 @@
239
247
  "deleteColumn": "删除列",
240
248
  "deleteRow": "删除行",
241
249
  "deleteTable": "删除表格",
250
+ "editImage": "编辑图片",
242
251
  "editLink": "编辑链接",
243
252
  "enterUrl": "输入 URL",
244
253
  "fontSize": "字号",
@@ -246,6 +255,11 @@
246
255
  "heading": "标题 {level}",
247
256
  "heightPx": "高度 (px)",
248
257
  "historyGroup": "历史记录",
258
+ "imageFile": "图片文件",
259
+ "imageInserted": "已插入 {name}。",
260
+ "imageTooLarge": "未添加 {name}。文件大于 {size}。",
261
+ "imageUploadFailed": "无法上传 {name}。",
262
+ "imageUploading": "正在上传 {name}",
249
263
  "imageUrl": "图片 URL",
250
264
  "indent": "增加缩进",
251
265
  "indentGroup": "缩进",
@@ -261,12 +275,17 @@
261
275
  "justify": "两端对齐",
262
276
  "linkGroup": "链接",
263
277
  "listGroup": "列表",
278
+ "mentionNoResults": "没有匹配项",
279
+ "mentionResults": "{count} 条建议",
280
+ "mentionSearching": "正在搜索…",
281
+ "mentionSuggestions": "建议",
264
282
  "mergeCells": "合并所选单元格",
265
283
  "outdent": "减少缩进",
266
284
  "paragraph": "段落",
267
285
  "quotation": "引用",
268
286
  "redo": "重做",
269
287
  "removeLink": "移除链接",
288
+ "save": "保存",
270
289
  "selectFontFamily": "选择字体",
271
290
  "selectFontSize": "选择字号",
272
291
  "splitCell": "拆分单元格",
@@ -280,7 +299,8 @@
280
299
  "toolbar": "格式",
281
300
  "underline": "下划线",
282
301
  "undo": "撤销",
283
- "widthPx": "宽度 (px)"
302
+ "widthPx": "宽度 (px)",
303
+ "wordCount": "{count} 个词"
284
304
  },
285
305
  "fileUpload": {
286
306
  "browse": "浏览文件",
@@ -459,6 +479,11 @@
459
479
  "removeMoreItems": "删除其余 {count} 项",
460
480
  "selectAll": "全选"
461
481
  },
482
+ "multiSelectTree": {
483
+ "clear": "清除",
484
+ "itemsCount": "+ {count} 项",
485
+ "removeMoreItems": "删除其余 {count} 项"
486
+ },
462
487
  "notification": {
463
488
  "close": "关闭",
464
489
  "error": "错误",
@@ -210,7 +210,11 @@
210
210
  "dropdownList": {
211
211
  "clear": "清除"
212
212
  },
213
+ "dropdownTree": {
214
+ "clear": "清除"
215
+ },
213
216
  "dropdowns": {
217
+ "close": "關閉",
214
218
  "itemPosition": "{text},第 {position} 項(共 {total} 項)",
215
219
  "noResultsFound": "找不到結果",
216
220
  "resultsAvailable": "有 {count} 個可用結果"
@@ -232,6 +236,10 @@
232
236
  "backgroundColor": "背景顏色",
233
237
  "bold": "粗體",
234
238
  "cancel": "取消",
239
+ "characterCount": "{count} 個字元",
240
+ "characterLimitHint": "最多可輸入 {limit} 個字元。",
241
+ "charactersLeft": "還可輸入 {count} 個字元",
242
+ "charactersOver": "超出 {count} 個字元",
235
243
  "codeBlock": "程式碼區塊",
236
244
  "color": "顏色",
237
245
  "contentLabel": "富文字編輯器",
@@ -239,6 +247,7 @@
239
247
  "deleteColumn": "刪除欄",
240
248
  "deleteRow": "刪除列",
241
249
  "deleteTable": "刪除表格",
250
+ "editImage": "編輯圖片",
242
251
  "editLink": "編輯連結",
243
252
  "enterUrl": "輸入 URL",
244
253
  "fontSize": "字型大小",
@@ -246,6 +255,11 @@
246
255
  "heading": "標題 {level}",
247
256
  "heightPx": "高度 (px)",
248
257
  "historyGroup": "歷程記錄",
258
+ "imageFile": "圖片檔案",
259
+ "imageInserted": "已插入 {name}。",
260
+ "imageTooLarge": "未新增 {name}。檔案大於 {size}。",
261
+ "imageUploadFailed": "無法上傳 {name}。",
262
+ "imageUploading": "正在上傳 {name}",
249
263
  "imageUrl": "圖片 URL",
250
264
  "indent": "增加縮排",
251
265
  "indentGroup": "縮排",
@@ -261,12 +275,17 @@
261
275
  "justify": "左右對齊",
262
276
  "linkGroup": "連結",
263
277
  "listGroup": "清單",
278
+ "mentionNoResults": "沒有相符的項目",
279
+ "mentionResults": "{count} 個建議",
280
+ "mentionSearching": "正在搜尋…",
281
+ "mentionSuggestions": "建議",
264
282
  "mergeCells": "合併選取的儲存格",
265
283
  "outdent": "減少縮排",
266
284
  "paragraph": "段落",
267
285
  "quotation": "引用",
268
286
  "redo": "重做",
269
287
  "removeLink": "移除連結",
288
+ "save": "儲存",
270
289
  "selectFontFamily": "選取字型",
271
290
  "selectFontSize": "選取字型大小",
272
291
  "splitCell": "分割儲存格",
@@ -280,7 +299,8 @@
280
299
  "toolbar": "格式設定",
281
300
  "underline": "底線",
282
301
  "undo": "復原",
283
- "widthPx": "寬度 (px)"
302
+ "widthPx": "寬度 (px)",
303
+ "wordCount": "{count} 個字詞"
284
304
  },
285
305
  "fileUpload": {
286
306
  "browse": "瀏覽檔案",
@@ -459,6 +479,11 @@
459
479
  "removeMoreItems": "移除其餘 {count} 項",
460
480
  "selectAll": "全選"
461
481
  },
482
+ "multiSelectTree": {
483
+ "clear": "清除",
484
+ "itemsCount": "+ {count} 項",
485
+ "removeMoreItems": "移除其餘 {count} 項"
486
+ },
462
487
  "notification": {
463
488
  "close": "關閉",
464
489
  "error": "錯誤",
@@ -0,0 +1,4 @@
1
+ {
2
+ "module": "../fesm2022/nanahoshi-mona-ui-multi-select-tree.mjs",
3
+ "typings": "../types/nanahoshi-mona-ui-multi-select-tree.d.ts"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanahoshi/mona-ui",
3
- "version": "0.36.1",
3
+ "version": "0.38.0",
4
4
  "description": "A very light Angular UI framework",
5
5
  "author": "Nanahoshi",
6
6
  "repository": {
@@ -130,6 +130,10 @@
130
130
  "types": "./types/nanahoshi-mona-ui-dropdown-list.d.ts",
131
131
  "default": "./fesm2022/nanahoshi-mona-ui-dropdown-list.mjs"
132
132
  },
133
+ "./dropdown-tree": {
134
+ "types": "./types/nanahoshi-mona-ui-dropdown-tree.d.ts",
135
+ "default": "./fesm2022/nanahoshi-mona-ui-dropdown-tree.mjs"
136
+ },
133
137
  "./dropdowns": {
134
138
  "types": "./types/nanahoshi-mona-ui-dropdowns.d.ts",
135
139
  "default": "./fesm2022/nanahoshi-mona-ui-dropdowns.mjs"
@@ -286,6 +290,10 @@
286
290
  "types": "./types/nanahoshi-mona-ui-multi-select.d.ts",
287
291
  "default": "./fesm2022/nanahoshi-mona-ui-multi-select.mjs"
288
292
  },
293
+ "./multi-select-tree": {
294
+ "types": "./types/nanahoshi-mona-ui-multi-select-tree.d.ts",
295
+ "default": "./fesm2022/nanahoshi-mona-ui-multi-select-tree.mjs"
296
+ },
289
297
  "./notification": {
290
298
  "types": "./types/nanahoshi-mona-ui-notification.d.ts",
291
299
  "default": "./fesm2022/nanahoshi-mona-ui-notification.mjs"
@@ -3,13 +3,14 @@ import { TemplateRef } from "@angular/core";
3
3
  import { FormValueControl } from "@angular/forms/signals";
4
4
  import { PreventableEvent } from "@nanahoshi/mona-ui/common";
5
5
  import * as i1 from "@nanahoshi/mona-ui/dropdowns";
6
- import { DropdownDataInput, DropdownFieldPredicateType, DropdownFieldSelectorType, DropdownPopupInput } from "@nanahoshi/mona-ui/dropdowns";
6
+ import { AdaptiveMode, DropdownDataInput, DropdownFieldPredicateType, DropdownFieldSelectorType, DropdownPopupInput } from "@nanahoshi/mona-ui/dropdowns";
7
7
  import { ListSizeInputType, SelectableOptions, SelectionChangeEvent } from "@nanahoshi/mona-ui/internal/list";
8
8
  import { PopupCloseEvent } from "@nanahoshi/mona-ui/popup";
9
9
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
10
10
  import { VariantProps } from "class-variance-authority";
11
11
  import { MonaDropdownListMessages } from "@nanahoshi/mona-ui/i18n";
12
- declare const dropdownListInputThemeVariants: (props?: ({
12
+ /** @hidden Shared with the dropdown tree, which looks the same. */
13
+ export declare const dropdownListInputThemeVariants: (props?: ({
13
14
  disabled?: boolean | null | undefined;
14
15
  expanded?: boolean | null | undefined;
15
16
  hasPrefix?: boolean | null | undefined;
@@ -17,10 +18,12 @@ declare const dropdownListInputThemeVariants: (props?: ({
17
18
  rounded?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
18
19
  size?: "small" | "medium" | "large" | null | undefined;
19
20
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
20
- declare const dropdownListValueContainerThemeVariants: (props?: ({
21
+ /** @hidden Shared with the dropdown tree, which looks the same. */
22
+ export declare const dropdownListValueContainerThemeVariants: (props?: ({
21
23
  hasTemplate?: boolean | null | undefined;
22
24
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
23
- declare const dropdownListAffixContainerThemeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
25
+ /** @hidden Shared with the dropdown tree, which looks the same. */
26
+ export declare const dropdownListAffixContainerThemeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
24
27
  type DropdownListInputVariantProps = VariantProps<typeof dropdownListInputThemeVariants>;
25
28
  type DropdownListInputVariantInput = VariantInputs<DropdownListInputVariantProps>;
26
29
  type DropdownListAffixContainerVariantProps = VariantProps<typeof dropdownListAffixContainerThemeVariants>;
@@ -48,6 +51,8 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
48
51
  protected readonly labelledBy: import("@angular/core").Signal<string | null>;
49
52
  protected readonly listId: string;
50
53
  protected readonly listPopupClass: import("@angular/core").Signal<string>;
54
+ /** The list's size: large in a bottom sheet, for touch. */
55
+ protected readonly listSize: import("@angular/core").Signal<"small" | "medium" | "large" | null | undefined>;
51
56
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDropdownListMessages>;
52
57
  protected readonly noDataTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
53
58
  protected readonly popupTemplate: import("@angular/core").Signal<TemplateRef<unknown>>;
@@ -55,9 +60,22 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
55
60
  protected readonly selectableOptions: SelectableOptions;
56
61
  protected readonly selectedDataItem: import("@angular/core").Signal<NonNullable<TData> | null>;
57
62
  protected readonly selectedListItem: import("@angular/core").Signal<import("@nanahoshi/mona-ui/internal/list").ListItem<TData> | null>;
63
+ protected readonly sheet: import("@angular/core").Signal<boolean>;
58
64
  protected readonly valueContainerClass: import("@angular/core").Signal<string>;
59
65
  protected readonly valueTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
60
66
  protected readonly valueText: import("@angular/core").Signal<string>;
67
+ /**
68
+ * @description Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640
69
+ * pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field.
70
+ * @default "none"
71
+ */
72
+ readonly adaptiveMode: import("@angular/core").InputSignal<AdaptiveMode>;
73
+ /**
74
+ * @description Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet
75
+ * shows the field's name.
76
+ * @default ""
77
+ */
78
+ readonly adaptiveTitle: import("@angular/core").InputSignal<string>;
61
79
  /**
62
80
  * @description ID of an element that describes the dropdown list, such as help text or an error message.
63
81
  * @default ""
@@ -239,6 +257,16 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
239
257
  private updateValue;
240
258
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownListComponent<any, any>, never>;
241
259
  static ɵcmp: i0.ɵɵComponentDeclaration<DropdownListComponent<any, any>, "mona-dropdown-list", never, {
260
+ "adaptiveMode": {
261
+ "alias": "adaptiveMode";
262
+ "required": false;
263
+ "isSignal": true;
264
+ };
265
+ "adaptiveTitle": {
266
+ "alias": "adaptiveTitle";
267
+ "required": false;
268
+ "isSignal": true;
269
+ };
242
270
  "ariaDescribedBy": {
243
271
  "alias": "aria-describedby";
244
272
  "required": false;
@@ -380,4 +408,4 @@ export declare class DropdownListValueTemplateDirective {
380
408
  static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownListValueTemplateDirective, "ng-template[monaDropDownListValueTemplate]", never, {}, {}, never, never, true, never>;
381
409
  }
382
410
  export declare const DROPDOWN_LIST_DEFAULT_MESSAGES: MonaDropdownListMessages;
383
- export type { DropDownListVariantProps };
411
+ export type { DropDownListVariantInput, DropDownListVariantProps };