m3ui-mcp 0.3.0 → 0.4.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.
- package/README.md +22 -3
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/data/components.json +5716 -3529
- package/data/examples.json +307 -207
- package/data/guidelines.json +202 -202
- package/data/icons.json +2224 -2224
- package/data/locale.json +367 -5
- package/data/manifest.json +26 -26
- package/data/nuxt.json +93 -93
- package/data/recipes.json +437 -338
- package/data/search-index.json +577 -0
- package/data/specs.json +89 -89
- package/data/types.json +168 -1
- package/data/values.json +2442 -1587
- package/dist/categories.js +1 -0
- package/dist/dynamic-slots.js +2 -2
- package/dist/tools/check-template.js +7 -1
- package/package.json +5 -3
package/data/recipes.json
CHANGED
|
@@ -84,47 +84,47 @@
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"ref": "pkg:src/components/MNavigationSuite.vue:2-13",
|
|
87
|
-
"url": "https://github.com/
|
|
87
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationSuite.vue#L2-L13"
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
"ref": "pkg:src/components/MNavigationSuite.vue:20-48",
|
|
91
|
-
"url": "https://github.com/
|
|
91
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationSuite.vue#L20-L48"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"ref": "pkg:src/components/MNavigationSuite.vue:59-69",
|
|
95
|
-
"url": "https://github.com/
|
|
95
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationSuite.vue#L59-L69"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"ref": "pkg:src/components/MNavigationSuite.vue:72-106",
|
|
99
|
-
"url": "https://github.com/
|
|
99
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationSuite.vue#L72-L106"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"ref": "pkg:src/components/MNavigationDrawer.vue:45-50",
|
|
103
|
-
"url": "https://github.com/
|
|
103
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationDrawer.vue#L45-L50"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"ref": "pkg:src/components/MNavigationDrawer.vue:155-165",
|
|
107
|
-
"url": "https://github.com/
|
|
107
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationDrawer.vue#L155-L165"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"ref": "pkg:src/components/MNavigationDrawer.vue:649-665",
|
|
111
|
-
"url": "https://github.com/
|
|
111
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationDrawer.vue#L649-L665"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"ref": "pkg:src/components/MAppLayout.vue:2-12",
|
|
115
|
-
"url": "https://github.com/
|
|
115
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MAppLayout.vue#L2-L12"
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"ref": "pkg:src/composables/_useItemLink.ts:1-19",
|
|
119
|
-
"url": "https://github.com/
|
|
119
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_useItemLink.ts#L1-L19"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"ref": "pkg:src/__tests__/adaptiveLayouts.test.ts",
|
|
123
|
-
"url": "https://github.com/
|
|
123
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/__tests__/adaptiveLayouts.test.ts"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"ref": "pkg:src/components/MNavigationRail.vue:108-116",
|
|
127
|
-
"url": "https://github.com/
|
|
127
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationRail.vue#L108-L116"
|
|
128
128
|
}
|
|
129
129
|
],
|
|
130
130
|
"verified": {
|
|
@@ -194,39 +194,39 @@
|
|
|
194
194
|
"sources": [
|
|
195
195
|
{
|
|
196
196
|
"ref": "pkg:src/components/MDatePicker.vue:2-6",
|
|
197
|
-
"url": "https://github.com/
|
|
197
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDatePicker.vue#L2-L6"
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
"ref": "pkg:src/components/MDatePicker.vue:29-32",
|
|
201
|
-
"url": "https://github.com/
|
|
201
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDatePicker.vue#L29-L32"
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
"ref": "pkg:src/components/MDatePicker.vue:59-63",
|
|
205
|
-
"url": "https://github.com/
|
|
205
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDatePicker.vue#L59-L63"
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
"ref": "pkg:src/components/MDatePickerModal.vue:2-7",
|
|
209
|
-
"url": "https://github.com/
|
|
209
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDatePickerModal.vue#L2-L7"
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
212
|
"ref": "pkg:src/components/MDatePickerModal.vue:21-22",
|
|
213
|
-
"url": "https://github.com/
|
|
213
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDatePickerModal.vue#L21-L22"
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
"ref": "pkg:src/composables/_useCalendarMonth.ts:44-48",
|
|
217
|
-
"url": "https://github.com/
|
|
217
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_useCalendarMonth.ts#L44-L48"
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
220
|
"ref": "pkg:src/components/MChip.vue:124",
|
|
221
|
-
"url": "https://github.com/
|
|
221
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L124"
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
224
|
"ref": "pkg:src/components/MChip.vue:210",
|
|
225
|
-
"url": "https://github.com/
|
|
225
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L210"
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
"ref": "pkg:src/components/MForm.vue:2-37",
|
|
229
|
-
"url": "https://github.com/
|
|
229
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MForm.vue#L2-L37"
|
|
230
230
|
}
|
|
231
231
|
],
|
|
232
232
|
"verified": {
|
|
@@ -321,35 +321,35 @@
|
|
|
321
321
|
},
|
|
322
322
|
{
|
|
323
323
|
"ref": "pkg:src/components/MBottomSheet.vue:2-12",
|
|
324
|
-
"url": "https://github.com/
|
|
324
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L2-L12"
|
|
325
325
|
},
|
|
326
326
|
{
|
|
327
327
|
"ref": "pkg:src/components/MBottomSheet.vue:23-53",
|
|
328
|
-
"url": "https://github.com/
|
|
328
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L23-L53"
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
331
|
"ref": "pkg:src/components/MBottomSheet.vue:222-297",
|
|
332
|
-
"url": "https://github.com/
|
|
332
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L222-L297"
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
"ref": "pkg:src/components/MListItem.vue:46-54",
|
|
336
|
-
"url": "https://github.com/
|
|
336
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L46-L54"
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
339
|
"ref": "pkg:src/components/MListItem.vue:208-211",
|
|
340
|
-
"url": "https://github.com/
|
|
340
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L208-L211"
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
343
|
"ref": "pkg:src/components/MDialog.vue:161-166",
|
|
344
|
-
"url": "https://github.com/
|
|
344
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L161-L166"
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
347
|
"ref": "pkg:src/components/MSnackbar.vue:24",
|
|
348
|
-
"url": "https://github.com/
|
|
348
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L24"
|
|
349
349
|
},
|
|
350
350
|
{
|
|
351
351
|
"ref": "pkg:src/composables/_useFocusTrap.ts",
|
|
352
|
-
"url": "https://github.com/
|
|
352
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_useFocusTrap.ts"
|
|
353
353
|
}
|
|
354
354
|
],
|
|
355
355
|
"verified": {
|
|
@@ -412,19 +412,19 @@
|
|
|
412
412
|
"sources": [
|
|
413
413
|
{
|
|
414
414
|
"ref": "pkg:src/components/MChart.vue:24",
|
|
415
|
-
"url": "https://github.com/
|
|
415
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChart.vue#L24"
|
|
416
416
|
},
|
|
417
417
|
{
|
|
418
418
|
"ref": "pkg:src/components/MChart.vue:99-131",
|
|
419
|
-
"url": "https://github.com/
|
|
419
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChart.vue#L99-L131"
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
422
|
"ref": "pkg:src/components/MChart.vue:215-222",
|
|
423
|
-
"url": "https://github.com/
|
|
423
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChart.vue#L215-L222"
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
"ref": "pkg:src/components/MSegmentedButton.vue:2-7",
|
|
427
|
-
"url": "https://github.com/
|
|
427
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSegmentedButton.vue#L2-L7"
|
|
428
428
|
},
|
|
429
429
|
{
|
|
430
430
|
"ref": "nuxt:dist/module.mjs:52-62",
|
|
@@ -492,31 +492,31 @@
|
|
|
492
492
|
"sources": [
|
|
493
493
|
{
|
|
494
494
|
"ref": "pkg:src/components/MChatBubble.vue:1-8",
|
|
495
|
-
"url": "https://github.com/
|
|
495
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChatBubble.vue#L1-L8"
|
|
496
496
|
},
|
|
497
497
|
{
|
|
498
498
|
"ref": "pkg:src/components/MChatBubble.vue:14-42",
|
|
499
|
-
"url": "https://github.com/
|
|
499
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChatBubble.vue#L14-L42"
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
502
|
"ref": "pkg:src/components/MRelativeTime.vue:1-6",
|
|
503
|
-
"url": "https://github.com/
|
|
503
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MRelativeTime.vue#L1-L6"
|
|
504
504
|
},
|
|
505
505
|
{
|
|
506
506
|
"ref": "pkg:src/components/MRelativeTime.vue:24",
|
|
507
|
-
"url": "https://github.com/
|
|
507
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MRelativeTime.vue#L24"
|
|
508
508
|
},
|
|
509
509
|
{
|
|
510
510
|
"ref": "pkg:src/components/MRelativeTime.vue:73",
|
|
511
|
-
"url": "https://github.com/
|
|
511
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MRelativeTime.vue#L73"
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"ref": "pkg:src/components/MEmojiSelector.vue:117",
|
|
515
|
-
"url": "https://github.com/
|
|
515
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MEmojiSelector.vue#L117"
|
|
516
516
|
},
|
|
517
517
|
{
|
|
518
518
|
"ref": "pkg:src/components/MTextField.vue:23-76",
|
|
519
|
-
"url": "https://github.com/
|
|
519
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L23-L76"
|
|
520
520
|
}
|
|
521
521
|
],
|
|
522
522
|
"verified": {
|
|
@@ -600,59 +600,59 @@
|
|
|
600
600
|
},
|
|
601
601
|
{
|
|
602
602
|
"ref": "pkg:src/components/MConfirmDialog.vue:6-8",
|
|
603
|
-
"url": "https://github.com/
|
|
603
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MConfirmDialog.vue#L6-L8"
|
|
604
604
|
},
|
|
605
605
|
{
|
|
606
606
|
"ref": "pkg:src/components/MConfirmDialog.vue:14-38",
|
|
607
|
-
"url": "https://github.com/
|
|
607
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MConfirmDialog.vue#L14-L38"
|
|
608
608
|
},
|
|
609
609
|
{
|
|
610
610
|
"ref": "pkg:src/components/MConfirmDialog.vue:46-62",
|
|
611
|
-
"url": "https://github.com/
|
|
611
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MConfirmDialog.vue#L46-L62"
|
|
612
612
|
},
|
|
613
613
|
{
|
|
614
614
|
"ref": "pkg:src/components/MDialog.vue:41-42",
|
|
615
|
-
"url": "https://github.com/
|
|
615
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L41-L42"
|
|
616
616
|
},
|
|
617
617
|
{
|
|
618
618
|
"ref": "pkg:src/components/MDialog.vue:91-94",
|
|
619
|
-
"url": "https://github.com/
|
|
619
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L91-L94"
|
|
620
620
|
},
|
|
621
621
|
{
|
|
622
622
|
"ref": "pkg:src/components/MDialog.vue:111-113",
|
|
623
|
-
"url": "https://github.com/
|
|
623
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L111-L113"
|
|
624
624
|
},
|
|
625
625
|
{
|
|
626
626
|
"ref": "pkg:src/components/MDialog.vue:157-177",
|
|
627
|
-
"url": "https://github.com/
|
|
627
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L157-L177"
|
|
628
628
|
},
|
|
629
629
|
{
|
|
630
630
|
"ref": "pkg:src/components/MDialog.vue:202-204",
|
|
631
|
-
"url": "https://github.com/
|
|
631
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L202-L204"
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
"ref": "pkg:src/composables/useToast.ts:59-92",
|
|
635
|
-
"url": "https://github.com/
|
|
635
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L59-L92"
|
|
636
636
|
},
|
|
637
637
|
{
|
|
638
638
|
"ref": "pkg:src/composables/useConfirm.ts:1-116",
|
|
639
|
-
"url": "https://github.com/
|
|
639
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useConfirm.ts#L1-L116"
|
|
640
640
|
},
|
|
641
641
|
{
|
|
642
642
|
"ref": "pkg:src/composables/_useFocusTrap.ts",
|
|
643
|
-
"url": "https://github.com/
|
|
643
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_useFocusTrap.ts"
|
|
644
644
|
},
|
|
645
645
|
{
|
|
646
646
|
"ref": "pkg:src/components/MBottomSheet.vue:1-6",
|
|
647
|
-
"url": "https://github.com/
|
|
647
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L1-L6"
|
|
648
648
|
},
|
|
649
649
|
{
|
|
650
650
|
"ref": "pkg:src/components/MBottomSheet.vue:225",
|
|
651
|
-
"url": "https://github.com/
|
|
651
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L225"
|
|
652
652
|
},
|
|
653
653
|
{
|
|
654
654
|
"ref": "pkg:src/components/MButton.vue",
|
|
655
|
-
"url": "https://github.com/
|
|
655
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButton.vue"
|
|
656
656
|
}
|
|
657
657
|
],
|
|
658
658
|
"verified": {
|
|
@@ -718,11 +718,11 @@
|
|
|
718
718
|
},
|
|
719
719
|
{
|
|
720
720
|
"ref": "pkg:src/components/MStatCard.vue:11-70",
|
|
721
|
-
"url": "https://github.com/
|
|
721
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MStatCard.vue#L11-L70"
|
|
722
722
|
},
|
|
723
723
|
{
|
|
724
724
|
"ref": "pkg:src/components/MSparkline.vue:1-41",
|
|
725
|
-
"url": "https://github.com/
|
|
725
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSparkline.vue#L1-L41"
|
|
726
726
|
},
|
|
727
727
|
{
|
|
728
728
|
"ref": "pkg:dist/api.json",
|
|
@@ -730,7 +730,7 @@
|
|
|
730
730
|
},
|
|
731
731
|
{
|
|
732
732
|
"ref": "pkg:src/styles/theme.css:58",
|
|
733
|
-
"url": "https://github.com/
|
|
733
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/styles/theme.css#L58"
|
|
734
734
|
}
|
|
735
735
|
],
|
|
736
736
|
"verified": {
|
|
@@ -774,12 +774,12 @@
|
|
|
774
774
|
],
|
|
775
775
|
"sections": {
|
|
776
776
|
"when": "Use it for admin or back-office lists with many rows and several comparable columns: orders, products, history, users. A table pays off when people compare values across rows or sort by a column. On a phone, or when a row is mostly one title plus a status, a list of cards or `MListItem` rows reads better: the recipe shows both and switches by width.\n\nFor a thousand rows or more use `MVirtualTable` instead; for hierarchical rows `MTreeTable` (check `search` for both). This recipe is about `MDataTable`.",
|
|
777
|
-
"components": "- `MDataTable`: `columns` (`{ key, label, sortable, width, align, pinned, hidden }`), `rows` (objects), `rowKey` (default `id`, or a function of the row), `rowClass`, `caption`, `selectable` with `v-model` (an array of selected rows), `v-model:sort`, `v-model:expanded` and `v-model:hidden-columns` (since 1.11.0), `perPage` (default 10), `searchable` (default `true`), `loading`, `emptyText`, `dense`, `striped`, `stickyHeader`, `serverSide` with `total`, `v-model:page` and the `fetch` event. Slots: `toolbar`, `empty`, `row-actions`, `row-expand`, and `cell-<columnKey>` per column with `{ row, value, col }` (source: pkg:src/components/MDataTable.vue:2-19; pkg:src/components/MDataTable.vue:
|
|
778
|
-
"guideline": "M3 has no data table component; the closest guidance is the list pattern and the adaptive layout rules: show the structure that fits the width, and keep a tap or click target per row (source: https://m3.material.io/components/lists/overview; https://m3.material.io/foundations/layout/applying-layout/window-size-classes). `MDataTable` is a library component beyond M3. It uses theme surfaces (`bg-surface-container-high` header, `border-outline-variant`) and primary tints for selection, so it follows the palette and dark mode (source: pkg:src/components/MDataTable.vue:
|
|
777
|
+
"components": "- `MDataTable`: `columns` (`{ key, label, sortable, width, align, pinned, hidden }`), `rows` (objects), `rowKey` (default `id`, or a function of the row), `rowClass`, `caption`, `selectable` with `v-model` (an array of selected rows), `v-model:sort`, `v-model:expanded` and `v-model:hidden-columns` (since 1.11.0), `perPage` (default 10), `searchable` (default `true`), `loading`, `emptyText`, `dense`, `striped`, `stickyHeader`, `serverSide` with `total`, `v-model:page` and the `fetch` event. Slots: `toolbar`, `empty`, `row-actions`, `row-expand`, and `cell-<columnKey>` per column with `{ row, value, col }` (source: pkg:src/components/MDataTable.vue:2-19; pkg:src/components/MDataTable.vue:29-42; pkg:src/components/MDataTable.vue:584-618).\n- `DataTableColumn`, `DataTableFetchParams` and `DataTableSort` (and `TableColumn` for `MTable`) are exported types (source: pkg:src/index.ts:374; pkg:src/index.ts:395). The examples use small local interfaces with the same shape; importing the types works as well.\n- `MChip`: a status cell. `MIconButton`: a row action. `MPagination`: built into the table footer; you do not place it.\n- `MList` and `MListItem`: the compact-width replacement.\n- `useWindowSizeClass()` (Nuxt: `useM3WindowSizeClass`): chooses table or list.",
|
|
778
|
+
"guideline": "M3 has no data table component; the closest guidance is the list pattern and the adaptive layout rules: show the structure that fits the width, and keep a tap or click target per row (source: https://m3.material.io/components/lists/overview; https://m3.material.io/foundations/layout/applying-layout/window-size-classes). `MDataTable` is a library component beyond M3. It uses theme surfaces (`bg-surface-container-high` header, `border-outline-variant`) and primary tints for selection, so it follows the palette and dark mode (source: pkg:src/components/MDataTable.vue:461-509).",
|
|
779
779
|
"code": "### Orders table: sort, search, paging, selection, bulk bar (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\n// Local column type: structurally compatible with the exported DataTableColumn.\ninterface Column { key: string, label: string, sortable?: boolean, width?: string, align?: 'left' | 'center' | 'right', pinned?: 'left' | 'right' }\ninterface OrderRow { id: string, number: string, status: string, items: number, created: string }\n\nconst { data: orders, status } = await useFetch<OrderRow[]>('/api/orders', { lazy: true, default: () => [] })\nconst selected = ref<OrderRow[]>([])\nconst toast = useM3Toast()\n\nconst columns: Column[] = [\n { key: 'number', label: 'Numer', sortable: true, width: '9rem' },\n { key: 'status', label: 'Status', sortable: true },\n { key: 'items', label: 'Pozycje', sortable: true, align: 'right' },\n // Date as ISO (YYYY-MM-DD): string sort gives the correct chronological order.\n { key: 'created', label: 'Utworzone', sortable: true }\n]\n\nfunction open(row: Record<string, any>) {\n void navigateTo(`/admin/orders/${row.id}`)\n}\n\nasync function archiveSelected() {\n const ids = selected.value.map(row => row.id)\n await $fetch('/api/orders/archive', { method: 'POST', body: { ids } })\n toast.success(`Zarchiwizowano zamówień: ${ids.length}`)\n selected.value = []\n}\n</script>\n\n<template>\n <MDataTable\n v-model=\"selected\"\n :columns=\"columns\"\n :rows=\"orders\"\n :loading=\"status === 'pending'\"\n selectable\n sticky-header\n :per-page=\"25\"\n search-placeholder=\"Szukaj w tabeli\"\n empty-text=\"Brak zamówień\"\n @row-click=\"open\"\n >\n <template #toolbar>\n <MButton v-if=\"selected.length\" variant=\"tonal\" icon=\"archive\" @click=\"archiveSelected\">\n Archiwizuj ({{ selected.length }})\n </MButton>\n </template>\n\n <template #cell-status=\"{ value }\">\n <MChip :tone=\"value === 'Anulowane' ? 'error' : 'neutral'\">{{ value }}</MChip>\n </template>\n\n <template #row-actions=\"{ row }\">\n <MIconButton icon=\"open_in_new\" label=\"Otwórz zamówienie\" :to=\"`/admin/orders/${row.id}`\" />\n </template>\n </MDataTable>\n</template>\n```\n\n### Server-side paging and sorting (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\n// Local types: structurally compatible with DataTableColumn and DataTableFetchParams.\ninterface Column { key: string, label: string, sortable?: boolean, width?: string, align?: 'left' | 'center' | 'right', pinned?: 'left' | 'right' }\ninterface FetchParams { page: number, perPage: number, search: string, sortKey: string, sortDir: 'asc' | 'desc' | '' }\ninterface ProductRow { id: string, sku: string, name: string, stock: number }\n\nconst columns: Column[] = [\n { key: 'sku', label: 'SKU', sortable: true },\n { key: 'name', label: 'Nazwa', sortable: true },\n { key: 'stock', label: 'Stan', sortable: true, align: 'right' }\n]\n\nconst rows = ref<ProductRow[]>([])\nconst total = ref(0)\nconst page = ref(1)\nconst loading = ref(false)\n\n// The table fires fetch on mount and again after a page, sort or search change.\nasync function load(params: FetchParams) {\n loading.value = true\n try {\n const result = await $fetch<{ rows: ProductRow[], total: number }>('/api/products', {\n query: {\n page: params.page,\n perPage: params.perPage,\n q: params.search || undefined,\n sort: params.sortKey || undefined,\n dir: params.sortDir || undefined\n }\n })\n rows.value = result.rows\n total.value = result.total\n }\n finally {\n loading.value = false\n }\n}\n</script>\n\n<template>\n <MDataTable\n v-model:page=\"page\"\n :columns=\"columns\"\n :rows=\"rows\"\n :total=\"total\"\n :loading=\"loading\"\n :per-page=\"20\"\n server-side\n @fetch=\"load\"\n />\n</template>\n```\n\n### Table on a wide window, list on a phone (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\n// Local column type, same as above.\ninterface Column { key: string, label: string, sortable?: boolean, width?: string, align?: 'left' | 'center' | 'right', pinned?: 'left' | 'right' }\ninterface Row { id: string, number: string, status: string, items: number }\ndefineProps<{ rows: Row[] }>()\n\nconst { widthClass } = useM3WindowSizeClass()\n// compact and medium (below 840 px): list; expanded and above: table.\nconst asTable = computed(() => widthClass.value !== 'compact' && widthClass.value !== 'medium')\n\nconst columns: Column[] = [\n { key: 'number', label: 'Numer', sortable: true },\n { key: 'status', label: 'Status', sortable: true },\n { key: 'items', label: 'Pozycje', sortable: true, align: 'right' }\n]\n</script>\n\n<template>\n <MDataTable v-if=\"asTable\" :columns=\"columns\" :rows=\"rows\" @row-click=\"row => navigateTo(`/orders/${row.id}`)\" />\n <MList v-else :dividers=\"true\" :lines=\"2\">\n <MListItem\n v-for=\"row in rows\"\n :key=\"row.id\"\n :title=\"row.number\"\n :subtitle=\"`${row.items} pozycji`\"\n :trailing-text=\"row.status\"\n :to=\"`/orders/${row.id}`\"\n />\n </MList>\n</template>\n```",
|
|
780
|
-
"phone": "Do not render `MDataTable` below 840 px: the table scrolls horizontally inside its box (`overflow-x-auto`, source: pkg:src/components/MDataTable.vue:
|
|
781
|
-
"wide": "Use the table from 840 px up. Pin the identifying column with `pinned: 'left'` when there are more than five columns, set `stickyHeader` inside a scrolling container with a height, and use `dense` (36 px rows) only for expert views; the default rows are 48 px. Put bulk actions in the `toolbar` slot: the table itself shows \"N zaznaczone\" next to them (source: pkg:src/components/MDataTable.vue:
|
|
782
|
-
"pitfalls": "- Sorting is internal unless you bind `v-model:sort` (since 1.11.0, `{ key, dir }` or `null`): bind it to keep the sort in the URL or on the device, and `v-model:hidden-columns` for the column menu. Local sorting cycles ascending, descending, none, and compares `String(value)` with `localeCompare` and numeric collation, which is correct for numbers and ISO dates but not for formatted dates (\"12.03.2026\") (source: pkg:src/components/MDataTable.vue:
|
|
780
|
+
"phone": "Do not render `MDataTable` below 840 px: the table scrolls horizontally inside its box (`overflow-x-auto`, source: pkg:src/components/MDataTable.vue:501) but a row of four columns is hard to hit with a thumb and header sort targets are small. Use the list of the third example: one line of title, one of supporting text, status as trailing text. Move sorting and filtering to a `MBottomSheet` or chips (see the `filter-chips` recipe). Selection on a phone is better as a long press that turns the list into a selection mode; M3UI has `v-long-press` for it.",
|
|
781
|
+
"wide": "Use the table from 840 px up. Pin the identifying column with `pinned: 'left'` when there are more than five columns, set `stickyHeader` inside a scrolling container with a height, and use `dense` (36 px rows) only for expert views; the default rows are 48 px. Put bulk actions in the `toolbar` slot: the table itself shows \"N zaznaczone\" next to them (source: pkg:src/components/MDataTable.vue:461-509). For row details keep a click on the row (`rowClick`) and open a side sheet or a page.",
|
|
782
|
+
"pitfalls": "- Sorting is internal unless you bind `v-model:sort` (since 1.11.0, `{ key, dir }` or `null`): bind it to keep the sort in the URL or on the device, and `v-model:hidden-columns` for the column menu. Local sorting cycles ascending, descending, none, and compares `String(value)` with `localeCompare` and numeric collation, which is correct for numbers and ISO dates but not for formatted dates (\"12.03.2026\") (source: pkg:src/components/MDataTable.vue:67-80; pkg:src/components/MDataTable.vue:201-232; pkg:src/components/MDataTable.vue:240-259). With `serverSide` the sort also arrives in `fetch` as `sortKey` / `sortDir` (source: pkg:src/components/MDataTable.vue:281-307).\n- `searchable` is on by default and filters only the visible, non-hidden columns by substring of `String(value)`. If you have your own filter bar, set `:searchable=\"false\"`.\n- Since 1.11.1 the footer counter and the selected-count pill use the locale's plural forms (\"25 rekordów\", \"Zaznaczono: 3\" with `plLocale`). `records-text` and `selected-text` take a template with `{count}` (plural blocks allowed); a bare word is shown after the number unchanged, so \"pozycje\" would read \"1 pozycje\" (source: pkg:src/components/MDataTable.vue:479; pkg:src/components/MDataTable.vue:636; pkg:src/composables/_countLabel.ts:8-10).\n- Selection compares rows by `rowKey` (default `id`), so it survives a refetch that returns new objects with the same ids; the selected array still holds the old objects, so read fresh data by id (source: pkg:src/components/MDataTable.vue:313-333). \"Select all\" selects only the rows on the current page.\n- A click on a row emits `rowClick` only when `selectOnRowClick` is off, and rows have no `tabindex` or key handler; sortable headers are clickable cells without `aria-sort` or keyboard handling (inferred from source: pkg:src/components/MDataTable.vue:584-618). Always add a real link or button in a cell or in `row-actions` for keyboard users.\n- The `row-actions` slot adds the trailing column only when it is passed; do not wrap it in `v-if` on the `<template>` unless the condition is stable (source: pkg:src/components/MDataTable.vue:186-199).\n- The `exportable` prop adds a CSV export button (off by default); leave it disabled unless your screen explicitly requires client-side CSV export.\n- Cells render `row[key] ?? '—'` when no `cell-<key>` slot is given; format dates and numbers in the data or in a slot, not in the table."
|
|
783
783
|
},
|
|
784
784
|
"examples": [
|
|
785
785
|
{
|
|
@@ -802,6 +802,10 @@
|
|
|
802
802
|
}
|
|
803
803
|
],
|
|
804
804
|
"sources": [
|
|
805
|
+
{
|
|
806
|
+
"ref": "pkg:src/composables/_countLabel.ts:1-10",
|
|
807
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_countLabel.ts#L1-L10"
|
|
808
|
+
},
|
|
805
809
|
{
|
|
806
810
|
"ref": "https://m3.material.io/foundations/layout/applying-layout/window-size-classes",
|
|
807
811
|
"url": "https://m3.material.io/foundations/layout/applying-layout/window-size-classes"
|
|
@@ -812,56 +816,56 @@
|
|
|
812
816
|
},
|
|
813
817
|
{
|
|
814
818
|
"ref": "pkg:src/components/MDataTable.vue:2-19",
|
|
815
|
-
"url": "https://github.com/
|
|
819
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L2-L19"
|
|
816
820
|
},
|
|
817
821
|
{
|
|
818
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
819
|
-
"url": "https://github.com/
|
|
822
|
+
"ref": "pkg:src/components/MDataTable.vue:29-42",
|
|
823
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L29-L42"
|
|
820
824
|
},
|
|
821
825
|
{
|
|
822
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
823
|
-
"url": "https://github.com/
|
|
826
|
+
"ref": "pkg:src/components/MDataTable.vue:212-225",
|
|
827
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L212-L225"
|
|
824
828
|
},
|
|
825
829
|
{
|
|
826
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
827
|
-
"url": "https://github.com/
|
|
830
|
+
"ref": "pkg:src/components/MDataTable.vue:240-259",
|
|
831
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L240-L259"
|
|
828
832
|
},
|
|
829
833
|
{
|
|
830
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
831
|
-
"url": "https://github.com/
|
|
834
|
+
"ref": "pkg:src/components/MDataTable.vue:281-307",
|
|
835
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L281-L307"
|
|
832
836
|
},
|
|
833
837
|
{
|
|
834
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
835
|
-
"url": "https://github.com/
|
|
838
|
+
"ref": "pkg:src/components/MDataTable.vue:313-333",
|
|
839
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L313-L333"
|
|
836
840
|
},
|
|
837
841
|
{
|
|
838
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
839
|
-
"url": "https://github.com/
|
|
842
|
+
"ref": "pkg:src/components/MDataTable.vue:461-509",
|
|
843
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L461-L509"
|
|
840
844
|
},
|
|
841
845
|
{
|
|
842
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
843
|
-
"url": "https://github.com/
|
|
846
|
+
"ref": "pkg:src/components/MDataTable.vue:584-618",
|
|
847
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L584-L618"
|
|
844
848
|
},
|
|
845
849
|
{
|
|
846
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
847
|
-
"url": "https://github.com/
|
|
850
|
+
"ref": "pkg:src/components/MDataTable.vue:501",
|
|
851
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L501"
|
|
848
852
|
},
|
|
849
853
|
{
|
|
850
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
851
|
-
"url": "https://github.com/
|
|
854
|
+
"ref": "pkg:src/components/MDataTable.vue:186-199",
|
|
855
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L186-L199"
|
|
852
856
|
},
|
|
853
857
|
{
|
|
854
|
-
"ref": "pkg:src/components/MDataTable.vue:
|
|
855
|
-
"url": "https://github.com/
|
|
858
|
+
"ref": "pkg:src/components/MDataTable.vue:633-639",
|
|
859
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue#L633-L639"
|
|
856
860
|
},
|
|
857
861
|
{
|
|
858
|
-
"ref": "pkg:src/index.ts:
|
|
859
|
-
"url": "https://github.com/
|
|
862
|
+
"ref": "pkg:src/index.ts:341",
|
|
863
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/index.ts#L341"
|
|
860
864
|
}
|
|
861
865
|
],
|
|
862
866
|
"verified": {
|
|
863
|
-
"by": "update-1.
|
|
864
|
-
"at": "2026-12-
|
|
867
|
+
"by": "update-1.13.0",
|
|
868
|
+
"at": "2026-12-05",
|
|
865
869
|
"method": "source-read"
|
|
866
870
|
}
|
|
867
871
|
},
|
|
@@ -920,15 +924,15 @@
|
|
|
920
924
|
"sources": [
|
|
921
925
|
{
|
|
922
926
|
"ref": "pkg:src/components/MTabs.vue:13-18",
|
|
923
|
-
"url": "https://github.com/
|
|
927
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTabs.vue#L13-L18"
|
|
924
928
|
},
|
|
925
929
|
{
|
|
926
930
|
"ref": "pkg:src/components/MTabs.vue:254-322",
|
|
927
|
-
"url": "https://github.com/
|
|
931
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTabs.vue#L254-L322"
|
|
928
932
|
},
|
|
929
933
|
{
|
|
930
934
|
"ref": "pkg:src/components/MTabs.vue:260",
|
|
931
|
-
"url": "https://github.com/
|
|
935
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTabs.vue#L260"
|
|
932
936
|
},
|
|
933
937
|
{
|
|
934
938
|
"ref": "https://m3.material.io/components/tabs/guidelines",
|
|
@@ -997,43 +1001,43 @@
|
|
|
997
1001
|
"sources": [
|
|
998
1002
|
{
|
|
999
1003
|
"ref": "pkg:src/components/MToolbar.vue:21",
|
|
1000
|
-
"url": "https://github.com/
|
|
1004
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MToolbar.vue#L21"
|
|
1001
1005
|
},
|
|
1002
1006
|
{
|
|
1003
1007
|
"ref": "pkg:src/components/MIconButton.vue:17-18",
|
|
1004
|
-
"url": "https://github.com/
|
|
1008
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L17-L18"
|
|
1005
1009
|
},
|
|
1006
1010
|
{
|
|
1007
1011
|
"ref": "pkg:src/components/MIconButton.vue:57",
|
|
1008
|
-
"url": "https://github.com/
|
|
1012
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L57"
|
|
1009
1013
|
},
|
|
1010
1014
|
{
|
|
1011
1015
|
"ref": "pkg:src/components/MIconButton.vue:257",
|
|
1012
|
-
"url": "https://github.com/
|
|
1016
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L257"
|
|
1013
1017
|
},
|
|
1014
1018
|
{
|
|
1015
1019
|
"ref": "pkg:src/components/MTooltip.vue:70-77",
|
|
1016
|
-
"url": "https://github.com/
|
|
1020
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTooltip.vue#L70-L77"
|
|
1017
1021
|
},
|
|
1018
1022
|
{
|
|
1019
1023
|
"ref": "pkg:src/components/MTooltip.vue:88-96",
|
|
1020
|
-
"url": "https://github.com/
|
|
1024
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTooltip.vue#L88-L96"
|
|
1021
1025
|
},
|
|
1022
1026
|
{
|
|
1023
1027
|
"ref": "pkg:src/components/MMenu.vue:386-387",
|
|
1024
|
-
"url": "https://github.com/
|
|
1028
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMenu.vue#L386-L387"
|
|
1025
1029
|
},
|
|
1026
1030
|
{
|
|
1027
1031
|
"ref": "pkg:src/components/MButtonGroup.vue:2-7",
|
|
1028
|
-
"url": "https://github.com/
|
|
1032
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButtonGroup.vue#L2-L7"
|
|
1029
1033
|
},
|
|
1030
1034
|
{
|
|
1031
1035
|
"ref": "pkg:src/components/MHotkeys.vue:9-16",
|
|
1032
|
-
"url": "https://github.com/
|
|
1036
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MHotkeys.vue#L9-L16"
|
|
1033
1037
|
},
|
|
1034
1038
|
{
|
|
1035
1039
|
"ref": "pkg:src/components/MHotkeys.vue:79-105",
|
|
1036
|
-
"url": "https://github.com/
|
|
1040
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MHotkeys.vue#L79-L105"
|
|
1037
1041
|
}
|
|
1038
1042
|
],
|
|
1039
1043
|
"verified": {
|
|
@@ -1042,6 +1046,97 @@
|
|
|
1042
1046
|
"method": "source-read"
|
|
1043
1047
|
}
|
|
1044
1048
|
},
|
|
1049
|
+
{
|
|
1050
|
+
"id": "electron-desktop-app",
|
|
1051
|
+
"title": "Electron desktop app: M3 title bar, menus and window state (@m3ui-vue/electron)",
|
|
1052
|
+
"devices": [
|
|
1053
|
+
"desktop"
|
|
1054
|
+
],
|
|
1055
|
+
"components": [
|
|
1056
|
+
"MMenuBar",
|
|
1057
|
+
"MIconButton",
|
|
1058
|
+
"MSegmentedButton"
|
|
1059
|
+
],
|
|
1060
|
+
"composables": [
|
|
1061
|
+
"useTheme",
|
|
1062
|
+
"useColorPalette"
|
|
1063
|
+
],
|
|
1064
|
+
"guidelines": [
|
|
1065
|
+
"layout-adaptive",
|
|
1066
|
+
"dark-mode-and-contrast"
|
|
1067
|
+
],
|
|
1068
|
+
"keywords": [
|
|
1069
|
+
"electron",
|
|
1070
|
+
"desktop app",
|
|
1071
|
+
"title bar",
|
|
1072
|
+
"titlebar",
|
|
1073
|
+
"window controls",
|
|
1074
|
+
"frameless window",
|
|
1075
|
+
"menu bar",
|
|
1076
|
+
"mtitlebar",
|
|
1077
|
+
"useelectronwindow",
|
|
1078
|
+
"m3ui-vue/electron",
|
|
1079
|
+
"taskbar progress",
|
|
1080
|
+
"badge",
|
|
1081
|
+
"accent color",
|
|
1082
|
+
"aplikacja desktopowa",
|
|
1083
|
+
"pasek tytułu"
|
|
1084
|
+
],
|
|
1085
|
+
"sections": {
|
|
1086
|
+
"when": "Use it for a desktop app built with Electron that should look native: an M3 title bar with the app icon, menus (File, Edit, View…) and the window buttons, in the colors of your theme. The title bar and the window composable are not in `@m3ui-vue/m3ui-vue`: they come from the separate package `@m3ui-vue/electron` (MIT, repository m3ui-vue/m3ui-vue-electron, 0.2.0 at the time of writing), which needs Electron 33 or later and `@m3ui-vue/m3ui-vue` 1.13.0 (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:111-114). This knowledge base does not hold that package's API: `get_api` and `check_template` know only the library, so the props below come from its documentation pages.\n\nThe same Vue app keeps working in a browser: without the Electron bridge the window composable reports `isElectron: false` and its actions do nothing (source: docs@a6729cf:src/pages/integrations/electron/useElectronWindow.vue:84).",
|
|
1087
|
+
"components": "- The package has three entries, all needed: `@m3ui-vue/electron/main` (main process: `m3WindowOptions()` for the `BrowserWindow` options and `setupM3Window(win, options)`, given the same options), `@m3ui-vue/electron/preload` (`exposeM3UI()`, or `createM3Bridge()` inside a bridge of your own) and `@m3ui-vue/electron` (the renderer: the title bar component and `useElectronWindow()`), plus the stylesheet `@m3ui-vue/electron/styles` (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:9-63).\n- Window options: `controls` (`'native'`, default: the system's buttons recolored from the theme, snap layouts on Windows, real traffic lights on macOS; or `'custom'`: drawn by the bar), `titleBarHeight` (default 40), `overlay` (native button colors before the page loads), `rememberBounds` (reopen with the last size, position and maximized state), `externalLinks` (default `true`: http(s) and mailto links that would open a window go to the system browser) (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:76-82; docs@a6729cf:src/pages/integrations/ElectronPage.vue:136-138).\n- Title bar props (documentation of the package): `title`, `icon` (an image or a Material Symbol), `menus` (`MenuBarMenu[]`, rendered by `MMenuBar`), `menusPosition` (`'inline'` or `'below'`), `menusVisibility` (`'visible'`, `'compact'`, `'toggle'` on Alt, `'hidden'`), `color` (an M3 role or CSS color, default `'surface'`), `titleAlign`, `syncNativeTheme` (default `true`), and for custom controls `buttons`, `side`, `look`. Event `menu-select(item, menuIndex)`; slots `default`, `icon`, `start`, `end` and `controls` (source: docs@a6729cf:src/pages/integrations/electron/MTitleBar.vue:120-142).\n- `useElectronWindow()`: `isElectron`, `ready`, `controls`, `platform`, `isMac`, `titleBarHeight`, `maximized`, `fullscreen`, `focused`, `accentColor` (refs), and `minimize()`, `toggleMaximize()`, `close()`, `setProgress(0–1 | 'indeterminate' | null)`, `setBadge(count)`, `requestAttention()`, `setTheme()`, `setOverlay()` (source: docs@a6729cf:src/pages/integrations/electron/useElectronWindow.vue:83-100).\n- `MMenuBar` (in the library since 1.13.0) is what the bar renders for `menus`; use it on its own for a bar of your own (source: pkg:src/components/MMenuBar.vue:37-45; lib@ed784d6:CHANGELOG.md:11).",
|
|
1088
|
+
"guideline": "M3 has no desktop title bar or menu bar. The package builds them from M3 roles (the bar takes a surface or container role, the native buttons follow it) and keeps Electron's native theme (dialogs, context menus, scrollbars) on the app's light or dark choice, so the window follows the same dark-mode rules as the rest of the app (source: docs@a6729cf:src/pages/integrations/electron/MTitleBar.vue:126-128).",
|
|
1089
|
+
"code": "The blocks below use `@m3ui-vue/electron`, which this knowledge base does not contain, so they are marked pseudo: neither type-checked nor validated by `check_template`.\n\n### Main process and preload (electron-vite folders)\n\n```ts\n// pseudo: needs electron and @m3ui-vue/electron\n// src/main/index.ts\nimport { join } from 'node:path'\nimport { app, BrowserWindow } from 'electron'\nimport { m3WindowOptions, setupM3Window, type M3WindowOptions } from '@m3ui-vue/electron/main'\n\nconst m3: M3WindowOptions = { controls: 'native', rememberBounds: true }\n\napp.whenReady().then(() => {\n const win = new BrowserWindow({\n width: 1100,\n height: 720,\n show: false,\n ...m3WindowOptions(m3), // after width/height\n webPreferences: { preload: join(import.meta.dirname, '../preload/index.mjs') },\n })\n setupM3Window(win, m3)\n win.once('ready-to-show', () => win.show())\n})\n\n// src/preload/index.ts\n// import { exposeM3UI } from '@m3ui-vue/electron/preload'\n// exposeM3UI()\n```\n\n### Renderer: the app's root component\n\n```vue\n<!-- pseudo: needs @m3ui-vue/electron -->\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { MIconButton, useTheme, type MenuBarMenu } from '@m3ui-vue/m3ui-vue'\nimport { MTitleBar, useElectronWindow } from '@m3ui-vue/electron'\nimport icon from './assets/icon.png'\n\nconst { isDark, cycle } = useTheme()\nconst win = useElectronWindow()\nconst wrap = ref(true)\n\nconst menus = computed<MenuBarMenu[]>(() => [\n { label: 'Plik', items: [{ label: 'Nowy', icon: 'add', shortcut: 'Ctrl+N', id: 'new' }, { divider: true }, { label: 'Zakończ', icon: 'logout', danger: true, onSelect: () => win.close() }] },\n { label: 'Widok', items: [{ label: 'Zawijaj wiersze', checked: wrap.value, onSelect: () => (wrap.value = !wrap.value) }] },\n])\n</script>\n\n<template>\n <div class=\"flex h-full flex-col bg-surface text-on-surface\">\n <MTitleBar title=\"Notatki\" :icon=\"icon\" color=\"surface-container\" :menus=\"menus\">\n <template #end>\n <MIconButton :icon=\"isDark ? 'light_mode' : 'dark_mode'\" label=\"Motyw\" @click=\"cycle()\" />\n </template>\n </MTitleBar>\n <main class=\"min-h-0 flex-1 overflow-auto\">…</main>\n </div>\n</template>\n```\n\nAdd `@import '@m3ui-vue/electron/styles'` (or `import '@m3ui-vue/electron/styles'` in `main.ts`) next to the library's styles, and `html, body, #app { height: 100%; margin: 0; overflow: hidden; }` so the bar stays on top (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:51-63).",
|
|
1090
|
+
"phone": "Not applicable: Electron runs on Windows, macOS and Linux. If the same Vue app is also served on the web, `isElectron` is `false` there; render the title bar only when it is `true` and use the usual adaptive navigation otherwise.",
|
|
1091
|
+
"wide": "- Prefer `controls: 'native'` on Windows and macOS (snap layouts, real traffic lights); `'custom'` gives the same M3 buttons on every system and lets you pick the buttons and their side (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:136-138).\n- Many menus in a narrow window: `menus-visibility=\"compact\"` puts them behind one ☰ button (source: docs@a6729cf:src/pages/integrations/electron/MTitleBar.vue:125).\n- Long jobs: `setProgress()` on the taskbar button or dock icon, `requestAttention()` when it ends while the user is elsewhere (source: docs@a6729cf:src/pages/integrations/electron/useElectronWindow.vue:95-97).",
|
|
1092
|
+
"pitfalls": "- All three entries are needed: without the preload bridge the bar renders, but nothing reaches the window (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:120-125).\n- With `sandbox: true` (Electron's default for preloads) a preload cannot import packages: bundle it, or set `sandbox: false` (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:145-147).\n- Spread `m3WindowOptions()` after `width` and `height`, and pass the same options to `setupM3Window()` (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:12-35).\n- `accentColor` is only exposed, never applied: call `useColorPalette().setSeed(accentColor)` yourself if the app should take the system color (source: docs@a6729cf:src/pages/integrations/electron/useElectronWindow.vue:91).\n- The badge works on macOS and Linux Unity launchers only, and the accent color is `null` on Linux (source: docs@a6729cf:src/pages/integrations/ElectronPage.vue:89-96).\n- `check_template` does not validate the package's components: it skips names imported from `@m3ui-vue/electron`, so typos in its props are not caught."
|
|
1093
|
+
},
|
|
1094
|
+
"examples": [
|
|
1095
|
+
{
|
|
1096
|
+
"title": "Main process and preload (electron-vite folders)",
|
|
1097
|
+
"lang": "ts",
|
|
1098
|
+
"nuxt": false,
|
|
1099
|
+
"code": "// pseudo: needs electron and @m3ui-vue/electron\n// src/main/index.ts\nimport { join } from 'node:path'\nimport { app, BrowserWindow } from 'electron'\nimport { m3WindowOptions, setupM3Window, type M3WindowOptions } from '@m3ui-vue/electron/main'\n\nconst m3: M3WindowOptions = { controls: 'native', rememberBounds: true }\n\napp.whenReady().then(() => {\n const win = new BrowserWindow({\n width: 1100,\n height: 720,\n show: false,\n ...m3WindowOptions(m3), // after width/height\n webPreferences: { preload: join(import.meta.dirname, '../preload/index.mjs') },\n })\n setupM3Window(win, m3)\n win.once('ready-to-show', () => win.show())\n})\n\n// src/preload/index.ts\n// import { exposeM3UI } from '@m3ui-vue/electron/preload'\n// exposeM3UI()"
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"title": "Renderer: the app's root component",
|
|
1103
|
+
"lang": "vue",
|
|
1104
|
+
"nuxt": false,
|
|
1105
|
+
"code": "<!-- pseudo: needs @m3ui-vue/electron -->\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { MIconButton, useTheme, type MenuBarMenu } from '@m3ui-vue/m3ui-vue'\nimport { MTitleBar, useElectronWindow } from '@m3ui-vue/electron'\nimport icon from './assets/icon.png'\n\nconst { isDark, cycle } = useTheme()\nconst win = useElectronWindow()\nconst wrap = ref(true)\n\nconst menus = computed<MenuBarMenu[]>(() => [\n { label: 'Plik', items: [{ label: 'Nowy', icon: 'add', shortcut: 'Ctrl+N', id: 'new' }, { divider: true }, { label: 'Zakończ', icon: 'logout', danger: true, onSelect: () => win.close() }] },\n { label: 'Widok', items: [{ label: 'Zawijaj wiersze', checked: wrap.value, onSelect: () => (wrap.value = !wrap.value) }] },\n])\n</script>\n\n<template>\n <div class=\"flex h-full flex-col bg-surface text-on-surface\">\n <MTitleBar title=\"Notatki\" :icon=\"icon\" color=\"surface-container\" :menus=\"menus\">\n <template #end>\n <MIconButton :icon=\"isDark ? 'light_mode' : 'dark_mode'\" label=\"Motyw\" @click=\"cycle()\" />\n </template>\n </MTitleBar>\n <main class=\"min-h-0 flex-1 overflow-auto\">…</main>\n </div>\n</template>"
|
|
1106
|
+
}
|
|
1107
|
+
],
|
|
1108
|
+
"sources": [
|
|
1109
|
+
{
|
|
1110
|
+
"ref": "docs@a6729cf:src/pages/integrations/ElectronPage.vue:9-96",
|
|
1111
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue-docs/blob/a6729cff7fbc593f6aa7b004e353adb0e874ac86/src/pages/integrations/ElectronPage.vue#L9-L96"
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
"ref": "docs@a6729cf:src/pages/integrations/ElectronPage.vue:111-147",
|
|
1115
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue-docs/blob/a6729cff7fbc593f6aa7b004e353adb0e874ac86/src/pages/integrations/ElectronPage.vue#L111-L147"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
"ref": "docs@a6729cf:src/pages/integrations/electron/MTitleBar.vue:120-142",
|
|
1119
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue-docs/blob/a6729cff7fbc593f6aa7b004e353adb0e874ac86/src/pages/integrations/electron/MTitleBar.vue#L120-L142"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"ref": "docs@a6729cf:src/pages/integrations/electron/useElectronWindow.vue:83-100",
|
|
1123
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue-docs/blob/a6729cff7fbc593f6aa7b004e353adb0e874ac86/src/pages/integrations/electron/useElectronWindow.vue#L83-L100"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"ref": "pkg:src/components/MMenuBar.vue:37-45",
|
|
1127
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMenuBar.vue#L37-L45"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"ref": "lib@ed784d6:CHANGELOG.md:11",
|
|
1131
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/CHANGELOG.md#L11"
|
|
1132
|
+
}
|
|
1133
|
+
],
|
|
1134
|
+
"verified": {
|
|
1135
|
+
"by": "update-1.13.0",
|
|
1136
|
+
"at": "2026-12-05",
|
|
1137
|
+
"method": "demo-read"
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1045
1140
|
{
|
|
1046
1141
|
"id": "fab-and-fab-menu",
|
|
1047
1142
|
"title": "FAB and FAB menu",
|
|
@@ -1124,31 +1219,31 @@
|
|
|
1124
1219
|
},
|
|
1125
1220
|
{
|
|
1126
1221
|
"ref": "pkg:src/components/MFab.vue:2-9",
|
|
1127
|
-
"url": "https://github.com/
|
|
1222
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MFab.vue#L2-L9"
|
|
1128
1223
|
},
|
|
1129
1224
|
{
|
|
1130
1225
|
"ref": "pkg:src/components/MFab.vue:24-60",
|
|
1131
|
-
"url": "https://github.com/
|
|
1226
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MFab.vue#L24-L60"
|
|
1132
1227
|
},
|
|
1133
1228
|
{
|
|
1134
1229
|
"ref": "pkg:src/components/MFab.vue:114-126",
|
|
1135
|
-
"url": "https://github.com/
|
|
1230
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MFab.vue#L114-L126"
|
|
1136
1231
|
},
|
|
1137
1232
|
{
|
|
1138
1233
|
"ref": "pkg:src/components/MFab.vue:334-352",
|
|
1139
|
-
"url": "https://github.com/
|
|
1234
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MFab.vue#L334-L352"
|
|
1140
1235
|
},
|
|
1141
1236
|
{
|
|
1142
1237
|
"ref": "pkg:src/components/MFab.vue:365-396",
|
|
1143
|
-
"url": "https://github.com/
|
|
1238
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MFab.vue#L365-L396"
|
|
1144
1239
|
},
|
|
1145
1240
|
{
|
|
1146
1241
|
"ref": "pkg:src/components/MFabMenu.vue:2-50",
|
|
1147
|
-
"url": "https://github.com/
|
|
1242
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MFabMenu.vue#L2-L50"
|
|
1148
1243
|
},
|
|
1149
1244
|
{
|
|
1150
1245
|
"ref": "pkg:src/components/MNavigationSuite.vue:72-106",
|
|
1151
|
-
"url": "https://github.com/
|
|
1246
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNavigationSuite.vue#L72-L106"
|
|
1152
1247
|
}
|
|
1153
1248
|
],
|
|
1154
1249
|
"verified": {
|
|
@@ -1217,11 +1312,11 @@
|
|
|
1217
1312
|
},
|
|
1218
1313
|
{
|
|
1219
1314
|
"ref": "pkg:src/components/MChip.vue:1-71",
|
|
1220
|
-
"url": "https://github.com/
|
|
1315
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L1-L71"
|
|
1221
1316
|
},
|
|
1222
1317
|
{
|
|
1223
1318
|
"ref": "pkg:src/components/MChip.vue:73-193",
|
|
1224
|
-
"url": "https://github.com/
|
|
1319
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L73-L193"
|
|
1225
1320
|
},
|
|
1226
1321
|
{
|
|
1227
1322
|
"ref": "pkg:dist/api.json",
|
|
@@ -1307,39 +1402,39 @@
|
|
|
1307
1402
|
},
|
|
1308
1403
|
{
|
|
1309
1404
|
"ref": "pkg:src/components/MTextField.vue:45-65",
|
|
1310
|
-
"url": "https://github.com/
|
|
1405
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L45-L65"
|
|
1311
1406
|
},
|
|
1312
1407
|
{
|
|
1313
1408
|
"ref": "pkg:src/components/MTextField.vue:208-227",
|
|
1314
|
-
"url": "https://github.com/
|
|
1409
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L208-L227"
|
|
1315
1410
|
},
|
|
1316
1411
|
{
|
|
1317
1412
|
"ref": "pkg:src/components/MForm.vue:2-37",
|
|
1318
|
-
"url": "https://github.com/
|
|
1413
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MForm.vue#L2-L37"
|
|
1319
1414
|
},
|
|
1320
1415
|
{
|
|
1321
1416
|
"ref": "pkg:src/components/MTextField.vue:307-308",
|
|
1322
|
-
"url": "https://github.com/
|
|
1417
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L307-L308"
|
|
1323
1418
|
},
|
|
1324
1419
|
{
|
|
1325
1420
|
"ref": "pkg:src/components/MSelect.vue:270-275",
|
|
1326
|
-
"url": "https://github.com/
|
|
1421
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSelect.vue#L270-L275"
|
|
1327
1422
|
},
|
|
1328
1423
|
{
|
|
1329
1424
|
"ref": "pkg:src/components/MButton.vue:207-210",
|
|
1330
|
-
"url": "https://github.com/
|
|
1425
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButton.vue#L207-L210"
|
|
1331
1426
|
},
|
|
1332
1427
|
{
|
|
1333
1428
|
"ref": "pkg:src/components/MAlert.vue:58-70",
|
|
1334
|
-
"url": "https://github.com/
|
|
1429
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MAlert.vue#L58-L70"
|
|
1335
1430
|
},
|
|
1336
1431
|
{
|
|
1337
1432
|
"ref": "pkg:src/components/MCheckbox.vue:37-45",
|
|
1338
|
-
"url": "https://github.com/
|
|
1433
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCheckbox.vue#L37-L45"
|
|
1339
1434
|
},
|
|
1340
1435
|
{
|
|
1341
1436
|
"ref": "pkg:src/components/MSwitch.vue:278-279",
|
|
1342
|
-
"url": "https://github.com/
|
|
1437
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSwitch.vue#L278-L279"
|
|
1343
1438
|
}
|
|
1344
1439
|
],
|
|
1345
1440
|
"verified": {
|
|
@@ -1404,27 +1499,27 @@
|
|
|
1404
1499
|
"sources": [
|
|
1405
1500
|
{
|
|
1406
1501
|
"ref": "pkg:src/components/MNumberField.vue:2-10",
|
|
1407
|
-
"url": "https://github.com/
|
|
1502
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNumberField.vue#L2-L10"
|
|
1408
1503
|
},
|
|
1409
1504
|
{
|
|
1410
1505
|
"ref": "pkg:src/components/MNumberField.vue:127-140",
|
|
1411
|
-
"url": "https://github.com/
|
|
1506
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNumberField.vue#L127-L140"
|
|
1412
1507
|
},
|
|
1413
1508
|
{
|
|
1414
1509
|
"ref": "pkg:src/components/MNumberField.vue:247",
|
|
1415
|
-
"url": "https://github.com/
|
|
1510
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MNumberField.vue#L247"
|
|
1416
1511
|
},
|
|
1417
1512
|
{
|
|
1418
1513
|
"ref": "pkg:src/components/MTextField.vue:208-227",
|
|
1419
|
-
"url": "https://github.com/
|
|
1514
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L208-L227"
|
|
1420
1515
|
},
|
|
1421
1516
|
{
|
|
1422
1517
|
"ref": "pkg:src/components/MIconButton.vue:17-18",
|
|
1423
|
-
"url": "https://github.com/
|
|
1518
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L17-L18"
|
|
1424
1519
|
},
|
|
1425
1520
|
{
|
|
1426
1521
|
"ref": "pkg:src/components/MForm.vue:2-37",
|
|
1427
|
-
"url": "https://github.com/
|
|
1522
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MForm.vue#L2-L37"
|
|
1428
1523
|
}
|
|
1429
1524
|
],
|
|
1430
1525
|
"verified": {
|
|
@@ -1468,7 +1563,7 @@
|
|
|
1468
1563
|
],
|
|
1469
1564
|
"sections": {
|
|
1470
1565
|
"when": "Use a board when work moves through a few fixed stages (to do, in progress, done; or received, picking, packed) and people move items between them by hand. Each column is a stage and each card an item.\n\nDo not use it for a long list that is only sorted or filtered (use a list or `MDataTable`), or for stages that change by themselves: a board invites dragging, so every move must be allowed.",
|
|
1471
|
-
"components": "- `MKanban`: `v-model` with the columns (`KanbanColumn[]`: `id`, `title`, `cards`, optional `color` and `limit`); each card needs an `id` and may carry any other fields (`KanbanCard`). Both types are exported: `import type { KanbanColumn, KanbanCard } from '@m3ui-vue/m3ui-vue'` (source: pkg:src/components/MKanban.vue:23-35; pkg:src/index.ts:
|
|
1566
|
+
"components": "- `MKanban`: `v-model` with the columns (`KanbanColumn[]`: `id`, `title`, `cards`, optional `color` and `limit`); each card needs an `id` and may carry any other fields (`KanbanCard`). Both types are exported: `import type { KanbanColumn, KanbanCard } from '@m3ui-vue/m3ui-vue'` (source: pkg:src/components/MKanban.vue:23-35; pkg:src/index.ts:383).\n- Slots: `#card` (`{ card, column, dragging }`), `#column-header` (`{ column, count }`), `#column-footer` (`{ column }`), e.g. an \"Add card\" button. Events: `cardMove` (`{ cardId, fromColumn, toColumn, toIndex }`) after a move, `cardClick` (`{ card, columnId }`) on a click or Enter (source: pkg:src/components/MKanban.vue:46-56).\n- `limit` on a column shows `count/limit` in its header and turns it error-colored when exceeded; it does not block the move (source: pkg:src/components/MKanban.vue:28-35).\n- `MDialog` with `MTextField` and `MSelect` to add a card.",
|
|
1472
1567
|
"guideline": "Cards on the board follow the elevated card: 12 dp corners, level 1 at rest, level 2 on hover and level 4 while dragged; the other cards make room with a spring and a dashed slot shows where the card will land (source: pkg:src/components/MKanban.vue:1-17). Every drag must have a keyboard and a non-drag alternative: the board itself supports the keyboard, and a \"Move to\" action on the card (menu or dialog) helps people who cannot drag.",
|
|
1473
1568
|
"code": "### Board with an \"Add card\" dialog and a WIP limit\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { MButton, MDialog, MKanban, MSelect, MTextField } from '@m3ui-vue/m3ui-vue'\nimport type { KanbanColumn } from '@m3ui-vue/m3ui-vue'\n\ninterface Task { id: string, title: string, note: string }\n\nconst columns = ref<KanbanColumn[]>([\n { id: 'todo', title: 'Do zrobienia', color: 'secondary', cards: [\n { id: 't1', title: 'Etykiety do zamówień z poniedziałku', note: '' },\n { id: 't2', title: 'Inwentaryzacja regału B', note: 'Strefa chłodna' },\n ] },\n { id: 'doing', title: 'W toku', color: 'primary', limit: 3, cards: [\n { id: 't3', title: 'Pakowanie zamówienia 1042', note: '4 pozycje' },\n ] },\n { id: 'done', title: 'Gotowe', color: 'success', cards: [] },\n])\n\nconst open = ref(false)\nconst title = ref('')\nconst note = ref('')\nconst target = ref<string | number>('todo')\nconst titleError = ref<string | false>(false)\nconst columnOptions = computed(() => columns.value.map((c) => ({ label: c.title, value: c.id })))\n\nfunction startAdding(columnId: string | number) {\n title.value = ''\n note.value = ''\n titleError.value = false\n target.value = columnId\n open.value = true\n}\n\nfunction add() {\n if (!title.value.trim()) {\n titleError.value = 'Podaj tytuł'\n return\n }\n const card: Task = { id: crypto.randomUUID(), title: title.value.trim(), note: note.value.trim() }\n columns.value.find((c) => c.id === target.value)?.cards.push(card)\n open.value = false\n}\n\nfunction onMove(move: { cardId: string | number, fromColumn: string | number, toColumn: string | number, toIndex: number }) {\n // Save the new stage on the server here; v-model already holds the new order\n console.info('przeniesiono', move)\n}\n</script>\n\n<template>\n <MKanban v-model=\"columns\" empty-text=\"Brak zadań\" @card-move=\"onMove\">\n <template #card=\"{ card }\">\n <div class=\"flex flex-col gap-1\">\n <span class=\"text-title-small text-on-surface\">{{ card.title }}</span>\n <span v-if=\"card.note\" class=\"text-body-small text-on-surface-variant\">{{ card.note }}</span>\n </div>\n </template>\n <template #column-footer=\"{ column }\">\n <MButton variant=\"text\" icon=\"add\" @click=\"startAdding(column.id)\">Dodaj zadanie</MButton>\n </template>\n </MKanban>\n\n <MDialog v-model=\"open\" title=\"Nowe zadanie\" max-width=\"480px\">\n <div class=\"flex flex-col gap-4\">\n <MTextField v-model=\"title\" label=\"Tytuł\" :error=\"titleError\" @update:model-value=\"titleError = false\" />\n <MTextField v-model=\"note\" label=\"Notatka\" multiline auto-grow :rows=\"2\" :max-rows=\"5\" />\n <MSelect v-model=\"target\" :options=\"columnOptions\" label=\"Kolumna\" />\n </div>\n <template #actions>\n <MButton variant=\"text\" @click=\"open = false\">Anuluj</MButton>\n <MButton @click=\"add\">Dodaj</MButton>\n </template>\n </MDialog>\n</template>\n```",
|
|
1474
1569
|
"phone": "Columns are a fixed 288 px (`w-72`) and the board scrolls sideways with snap, so a phone shows one column and a bit of the next (source: pkg:src/components/MKanban.vue:723). A finger starts a drag with a long press (350 ms), so a plain swipe still scrolls the board (source: pkg:src/components/MKanban.vue:245). For more than three stages on a phone, consider a list with a stage filter (`filter-chips` recipe) and a \"Move to\" action instead.",
|
|
@@ -1486,35 +1581,35 @@
|
|
|
1486
1581
|
"sources": [
|
|
1487
1582
|
{
|
|
1488
1583
|
"ref": "pkg:src/components/MKanban.vue:1-17",
|
|
1489
|
-
"url": "https://github.com/
|
|
1584
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L1-L17"
|
|
1490
1585
|
},
|
|
1491
1586
|
{
|
|
1492
1587
|
"ref": "pkg:src/components/MKanban.vue:23-35",
|
|
1493
|
-
"url": "https://github.com/
|
|
1588
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L23-L35"
|
|
1494
1589
|
},
|
|
1495
1590
|
{
|
|
1496
1591
|
"ref": "pkg:src/components/MKanban.vue:46-56",
|
|
1497
|
-
"url": "https://github.com/
|
|
1592
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L46-L56"
|
|
1498
1593
|
},
|
|
1499
1594
|
{
|
|
1500
1595
|
"ref": "pkg:src/components/MKanban.vue:245",
|
|
1501
|
-
"url": "https://github.com/
|
|
1596
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L245"
|
|
1502
1597
|
},
|
|
1503
1598
|
{
|
|
1504
1599
|
"ref": "pkg:src/components/MKanban.vue:583-640",
|
|
1505
|
-
"url": "https://github.com/
|
|
1600
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L583-L640"
|
|
1506
1601
|
},
|
|
1507
1602
|
{
|
|
1508
1603
|
"ref": "pkg:src/components/MKanban.vue:723",
|
|
1509
|
-
"url": "https://github.com/
|
|
1604
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L723"
|
|
1510
1605
|
},
|
|
1511
1606
|
{
|
|
1512
1607
|
"ref": "pkg:src/components/MKanban.vue:813",
|
|
1513
|
-
"url": "https://github.com/
|
|
1608
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MKanban.vue#L813"
|
|
1514
1609
|
},
|
|
1515
1610
|
{
|
|
1516
|
-
"ref": "pkg:src/index.ts:
|
|
1517
|
-
"url": "https://github.com/
|
|
1611
|
+
"ref": "pkg:src/index.ts:383",
|
|
1612
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/index.ts#L383"
|
|
1518
1613
|
}
|
|
1519
1614
|
],
|
|
1520
1615
|
"verified": {
|
|
@@ -1589,43 +1684,43 @@
|
|
|
1589
1684
|
},
|
|
1590
1685
|
{
|
|
1591
1686
|
"ref": "pkg:src/components/MListDetail.vue:2-16",
|
|
1592
|
-
"url": "https://github.com/
|
|
1687
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListDetail.vue#L2-L16"
|
|
1593
1688
|
},
|
|
1594
1689
|
{
|
|
1595
1690
|
"ref": "pkg:src/components/MListDetail.vue:30-102",
|
|
1596
|
-
"url": "https://github.com/
|
|
1691
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListDetail.vue#L30-L102"
|
|
1597
1692
|
},
|
|
1598
1693
|
{
|
|
1599
1694
|
"ref": "pkg:src/components/MListDetail.vue:58-62",
|
|
1600
|
-
"url": "https://github.com/
|
|
1695
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListDetail.vue#L58-L62"
|
|
1601
1696
|
},
|
|
1602
1697
|
{
|
|
1603
1698
|
"ref": "pkg:src/components/MListDetail.vue:99-142",
|
|
1604
|
-
"url": "https://github.com/
|
|
1699
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListDetail.vue#L99-L142"
|
|
1605
1700
|
},
|
|
1606
1701
|
{
|
|
1607
1702
|
"ref": "pkg:src/components/MListDetail.vue:105-159",
|
|
1608
|
-
"url": "https://github.com/
|
|
1703
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListDetail.vue#L105-L159"
|
|
1609
1704
|
},
|
|
1610
1705
|
{
|
|
1611
1706
|
"ref": "pkg:src/components/MListDetail.vue:161-193",
|
|
1612
|
-
"url": "https://github.com/
|
|
1707
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListDetail.vue#L161-L193"
|
|
1613
1708
|
},
|
|
1614
1709
|
{
|
|
1615
1710
|
"ref": "pkg:src/components/MList.vue:58-219",
|
|
1616
|
-
"url": "https://github.com/
|
|
1711
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MList.vue#L58-L219"
|
|
1617
1712
|
},
|
|
1618
1713
|
{
|
|
1619
1714
|
"ref": "pkg:src/components/MListItem.vue:337-353",
|
|
1620
|
-
"url": "https://github.com/
|
|
1715
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L337-L353"
|
|
1621
1716
|
},
|
|
1622
1717
|
{
|
|
1623
1718
|
"ref": "pkg:src/components/MTopAppBar.vue:34-40",
|
|
1624
|
-
"url": "https://github.com/
|
|
1719
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTopAppBar.vue#L34-L40"
|
|
1625
1720
|
},
|
|
1626
1721
|
{
|
|
1627
1722
|
"ref": "pkg:src/__tests__/adaptiveLayouts.test.ts",
|
|
1628
|
-
"url": "https://github.com/
|
|
1723
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/__tests__/adaptiveLayouts.test.ts"
|
|
1629
1724
|
}
|
|
1630
1725
|
],
|
|
1631
1726
|
"verified": {
|
|
@@ -1707,39 +1802,39 @@
|
|
|
1707
1802
|
},
|
|
1708
1803
|
{
|
|
1709
1804
|
"ref": "pkg:src/components/MSearchField.vue:2-14",
|
|
1710
|
-
"url": "https://github.com/
|
|
1805
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchField.vue#L2-L14"
|
|
1711
1806
|
},
|
|
1712
1807
|
{
|
|
1713
1808
|
"ref": "pkg:src/components/MSearchField.vue:27-44",
|
|
1714
|
-
"url": "https://github.com/
|
|
1809
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchField.vue#L27-L44"
|
|
1715
1810
|
},
|
|
1716
1811
|
{
|
|
1717
1812
|
"ref": "pkg:src/components/MSearchField.vue:139-141",
|
|
1718
|
-
"url": "https://github.com/
|
|
1813
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchField.vue#L139-L141"
|
|
1719
1814
|
},
|
|
1720
1815
|
{
|
|
1721
1816
|
"ref": "pkg:src/components/MList.vue:15-42",
|
|
1722
|
-
"url": "https://github.com/
|
|
1817
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MList.vue#L15-L42"
|
|
1723
1818
|
},
|
|
1724
1819
|
{
|
|
1725
1820
|
"ref": "pkg:src/components/MListItem.vue:208-211",
|
|
1726
|
-
"url": "https://github.com/
|
|
1821
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L208-L211"
|
|
1727
1822
|
},
|
|
1728
1823
|
{
|
|
1729
1824
|
"ref": "pkg:src/components/MEmptyState.vue:8-20",
|
|
1730
|
-
"url": "https://github.com/
|
|
1825
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MEmptyState.vue#L8-L20"
|
|
1731
1826
|
},
|
|
1732
1827
|
{
|
|
1733
1828
|
"ref": "pkg:src/components/MSkeleton.vue:7-23",
|
|
1734
|
-
"url": "https://github.com/
|
|
1829
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSkeleton.vue#L7-L23"
|
|
1735
1830
|
},
|
|
1736
1831
|
{
|
|
1737
1832
|
"ref": "pkg:src/composables/useDebounce.ts:3-24",
|
|
1738
|
-
"url": "https://github.com/
|
|
1833
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useDebounce.ts#L3-L24"
|
|
1739
1834
|
},
|
|
1740
1835
|
{
|
|
1741
1836
|
"ref": "pkg:src/composables/_splitAttrs.ts",
|
|
1742
|
-
"url": "https://github.com/
|
|
1837
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_splitAttrs.ts"
|
|
1743
1838
|
}
|
|
1744
1839
|
],
|
|
1745
1840
|
"verified": {
|
|
@@ -1809,27 +1904,27 @@
|
|
|
1809
1904
|
"sources": [
|
|
1810
1905
|
{
|
|
1811
1906
|
"ref": "pkg:src/components/MLoadingIndicator.vue:190",
|
|
1812
|
-
"url": "https://github.com/
|
|
1907
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MLoadingIndicator.vue#L190"
|
|
1813
1908
|
},
|
|
1814
1909
|
{
|
|
1815
1910
|
"ref": "pkg:src/components/MLoadingIndicator.vue:193-194",
|
|
1816
|
-
"url": "https://github.com/
|
|
1911
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MLoadingIndicator.vue#L193-L194"
|
|
1817
1912
|
},
|
|
1818
1913
|
{
|
|
1819
1914
|
"ref": "pkg:src/components/MResult.vue:7-8",
|
|
1820
|
-
"url": "https://github.com/
|
|
1915
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MResult.vue#L7-L8"
|
|
1821
1916
|
},
|
|
1822
1917
|
{
|
|
1823
1918
|
"ref": "pkg:src/components/MResult.vue:29-35",
|
|
1824
|
-
"url": "https://github.com/
|
|
1919
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MResult.vue#L29-L35"
|
|
1825
1920
|
},
|
|
1826
1921
|
{
|
|
1827
1922
|
"ref": "pkg:src/components/MResult.vue:62-70",
|
|
1828
|
-
"url": "https://github.com/
|
|
1923
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MResult.vue#L62-L70"
|
|
1829
1924
|
},
|
|
1830
1925
|
{
|
|
1831
1926
|
"ref": "pkg:src/components/MEmptyState.vue:16",
|
|
1832
|
-
"url": "https://github.com/
|
|
1927
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MEmptyState.vue#L16"
|
|
1833
1928
|
}
|
|
1834
1929
|
],
|
|
1835
1930
|
"verified": {
|
|
@@ -1927,47 +2022,47 @@
|
|
|
1927
2022
|
},
|
|
1928
2023
|
{
|
|
1929
2024
|
"ref": "pkg:src/components/MLoadingIndicator.vue:21-27",
|
|
1930
|
-
"url": "https://github.com/
|
|
2025
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MLoadingIndicator.vue#L21-L27"
|
|
1931
2026
|
},
|
|
1932
2027
|
{
|
|
1933
2028
|
"ref": "pkg:src/components/MLoadingIndicator.vue:141-183",
|
|
1934
|
-
"url": "https://github.com/
|
|
2029
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MLoadingIndicator.vue#L141-L183"
|
|
1935
2030
|
},
|
|
1936
2031
|
{
|
|
1937
2032
|
"ref": "pkg:src/components/MLoadingIndicator.vue:189-195",
|
|
1938
|
-
"url": "https://github.com/
|
|
2033
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MLoadingIndicator.vue#L189-L195"
|
|
1939
2034
|
},
|
|
1940
2035
|
{
|
|
1941
2036
|
"ref": "pkg:src/components/MProgressBar.vue:364-405",
|
|
1942
|
-
"url": "https://github.com/
|
|
2037
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MProgressBar.vue#L364-L405"
|
|
1943
2038
|
},
|
|
1944
2039
|
{
|
|
1945
2040
|
"ref": "pkg:src/components/MCircleProgressBar.vue:305-316",
|
|
1946
|
-
"url": "https://github.com/
|
|
2041
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCircleProgressBar.vue#L305-L316"
|
|
1947
2042
|
},
|
|
1948
2043
|
{
|
|
1949
2044
|
"ref": "pkg:src/components/MSkeleton.vue:7-23",
|
|
1950
|
-
"url": "https://github.com/
|
|
2045
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSkeleton.vue#L7-L23"
|
|
1951
2046
|
},
|
|
1952
2047
|
{
|
|
1953
2048
|
"ref": "pkg:src/components/MLoadingOverlay.vue:2-25",
|
|
1954
|
-
"url": "https://github.com/
|
|
2049
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MLoadingOverlay.vue#L2-L25"
|
|
1955
2050
|
},
|
|
1956
2051
|
{
|
|
1957
2052
|
"ref": "pkg:src/components/MPullToRefresh.vue:2-37",
|
|
1958
|
-
"url": "https://github.com/
|
|
2053
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPullToRefresh.vue#L2-L37"
|
|
1959
2054
|
},
|
|
1960
2055
|
{
|
|
1961
2056
|
"ref": "pkg:src/components/MPageProgress.vue:50-62",
|
|
1962
|
-
"url": "https://github.com/
|
|
2057
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPageProgress.vue#L50-L62"
|
|
1963
2058
|
},
|
|
1964
2059
|
{
|
|
1965
2060
|
"ref": "pkg:src/components/MButton.vue:207-219",
|
|
1966
|
-
"url": "https://github.com/
|
|
2061
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButton.vue#L207-L219"
|
|
1967
2062
|
},
|
|
1968
2063
|
{
|
|
1969
2064
|
"ref": "pkg:src/composables/usePageProgress.ts:3-23",
|
|
1970
|
-
"url": "https://github.com/
|
|
2065
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/usePageProgress.ts#L3-L23"
|
|
1971
2066
|
}
|
|
1972
2067
|
],
|
|
1973
2068
|
"verified": {
|
|
@@ -2036,47 +2131,47 @@
|
|
|
2036
2131
|
"sources": [
|
|
2037
2132
|
{
|
|
2038
2133
|
"ref": "pkg:src/components/MTextField.vue:2-14",
|
|
2039
|
-
"url": "https://github.com/
|
|
2134
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L2-L14"
|
|
2040
2135
|
},
|
|
2041
2136
|
{
|
|
2042
2137
|
"ref": "pkg:src/components/MTextField.vue:38-39",
|
|
2043
|
-
"url": "https://github.com/
|
|
2138
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L38-L39"
|
|
2044
2139
|
},
|
|
2045
2140
|
{
|
|
2046
2141
|
"ref": "pkg:src/components/MTextField.vue:273",
|
|
2047
|
-
"url": "https://github.com/
|
|
2142
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L273"
|
|
2048
2143
|
},
|
|
2049
2144
|
{
|
|
2050
2145
|
"ref": "pkg:src/components/MTextField.vue:293-294",
|
|
2051
|
-
"url": "https://github.com/
|
|
2146
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L293-L294"
|
|
2052
2147
|
},
|
|
2053
2148
|
{
|
|
2054
2149
|
"ref": "pkg:src/components/MIconButton.vue:4-6",
|
|
2055
|
-
"url": "https://github.com/
|
|
2150
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L4-L6"
|
|
2056
2151
|
},
|
|
2057
2152
|
{
|
|
2058
2153
|
"ref": "pkg:src/components/MIconButton.vue:17-18",
|
|
2059
|
-
"url": "https://github.com/
|
|
2154
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L17-L18"
|
|
2060
2155
|
},
|
|
2061
2156
|
{
|
|
2062
2157
|
"ref": "pkg:src/components/MIconButton.vue:256-257",
|
|
2063
|
-
"url": "https://github.com/
|
|
2158
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIconButton.vue#L256-L257"
|
|
2064
2159
|
},
|
|
2065
2160
|
{
|
|
2066
2161
|
"ref": "pkg:src/components/MForm.vue:2-37",
|
|
2067
|
-
"url": "https://github.com/
|
|
2162
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MForm.vue#L2-L37"
|
|
2068
2163
|
},
|
|
2069
2164
|
{
|
|
2070
2165
|
"ref": "pkg:src/components/MButton.vue:207-218",
|
|
2071
|
-
"url": "https://github.com/
|
|
2166
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButton.vue#L207-L218"
|
|
2072
2167
|
},
|
|
2073
2168
|
{
|
|
2074
2169
|
"ref": "pkg:src/components/MPasswordMeter.vue:2-6",
|
|
2075
|
-
"url": "https://github.com/
|
|
2170
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPasswordMeter.vue#L2-L6"
|
|
2076
2171
|
},
|
|
2077
2172
|
{
|
|
2078
2173
|
"ref": "pkg:src/components/MPasswordMeter.vue:50-61",
|
|
2079
|
-
"url": "https://github.com/
|
|
2174
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPasswordMeter.vue#L50-L61"
|
|
2080
2175
|
}
|
|
2081
2176
|
],
|
|
2082
2177
|
"verified": {
|
|
@@ -2127,11 +2222,11 @@
|
|
|
2127
2222
|
"sections": {
|
|
2128
2223
|
"when": "Use it for every step where a picker or packer confirms a thing by reading its code: a product at a location, a basket label, a parcel. The screen has one job, shows what to scan next, takes the code from a hardware reader, from the camera or typed by hand, and answers within a glance: right, wrong, already done.\n\nDo not use it as a general list screen. If the person must also browse many items, keep the list on its own screen (`list-search-empty-state`) and open this one for the confirmation.",
|
|
2129
2224
|
"components": "- `MTopAppBar` (`variant: 'small'`): the title and a back arrow; set `navigation-label` (source: pkg:src/components/MTopAppBar.vue:34-60).\n- `MCard` (`variant: 'filled'`): the \"scan this now\" block; a plain `div` with container tokens for the result block.\n- `MIcon`: result icons; decorative by default, so the text carries the meaning (source: pkg:src/components/MIcon.vue:1-55).\n- `MProgressBar` (`value`, `label`): \"3 of 12\"; it renders `role=\"progressbar\"` with `aria-valuenow` (source: pkg:src/components/MProgressBar.vue:370-378).\n- `MTextField`: the field a hardware reader types into and the manual fallback. Its element and `focus()` are exposed (`inputEl`, `focus`, `select`) (source: pkg:src/components/MTextField.vue:208-227).\n- `MButton` with `size=\"md\"` (56 px, `text-title-medium`): the only large action; the sizes are `xs` 32, `sm` 40, `md` 56, `lg` 96, `xl` 136 px, and the default `sm` is below a 44 px glove target (source: pkg:src/components/MButton.vue:38-49; pkg:src/components/MButton.vue:149-159).\n- `MBottomSheet` with `max-height=\"92vh\"`: hosts the camera view; `fullHeight` is deprecated in favour of `max-height` (source: pkg:src/components/MBottomSheet.vue:25-33).\n- `MList` and `MListItem`: the last few scans.\n- `MQRScanner` reads codes with the camera: QR and barcodes (`formats`), with the browser's `BarcodeDetector` or your own `detector` (jsQR, ZXing) where there is none (Firefox, Safari on desktop). It emits each code once (`detect` with `{ rawValue, format }`, and the v-model), ignores the same code for 2 seconds, and `once` stops the camera after the first read; it needs https or localhost (source: pkg:src/components/MQRScanner.vue:2-7; pkg:src/components/MQRScanner.vue:33-48). It has no torch (flashlight) control. `MQRCode` and `MBarcode` only draw codes. A hardware reader needs no component: it types the digits and Enter into the focused `MTextField`.",
|
|
2130
|
-
"guideline": "One screen, one primary action, placed where the thumb is, with the status shown by more than color: an icon and a sentence as well. M3 asks for touch targets of at least 48 dp and for feedback on every action; it recommends the primary action be visually dominant and the rest quieter (source: https://m3.material.io/foundations/accessible-design/accessibility-basics; https://m3.material.io/components/buttons/guidelines). M3UI offers the 56 px button and the container color roles (`success-container`, `error-container`) that carry the result; since 1.11.0 also `warning-container`, so \"already scanned\" uses the warning role, and each state also has its own icon and wording (source: pkg:src/styles/theme.css:58-68; lib@
|
|
2225
|
+
"guideline": "One screen, one primary action, placed where the thumb is, with the status shown by more than color: an icon and a sentence as well. M3 asks for touch targets of at least 48 dp and for feedback on every action; it recommends the primary action be visually dominant and the rest quieter (source: https://m3.material.io/foundations/accessible-design/accessibility-basics; https://m3.material.io/components/buttons/guidelines). M3UI offers the 56 px button and the container color roles (`success-container`, `error-container`) that carry the result; since 1.11.0 also `warning-container`, so \"already scanned\" uses the warning role, and each state also has its own icon and wording (source: pkg:src/styles/theme.css:58-68; lib@ed784d6:CHANGELOG.md:40).",
|
|
2131
2226
|
"code": "### Scan screen with a reader field, camera and last scans (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\n// app/components/ScanStep.vue\ninterface Line { id: string, ean: string, name: string, location: string, needed: number, scanned: number }\ntype Outcome\n = | { kind: 'idle' }\n | { kind: 'ok' | 'wrong' | 'duplicate', message: string }\n\nconst props = defineProps<{ lines: Line[], blocked?: boolean }>()\nconst emit = defineEmits<{ scan: [line: Line], close: [] }>()\n\nconst field = useTemplateRef<{ focus: () => void }>('field')\nconst code = ref('')\nconst cameraOpen = ref(false)\nconst outcome = ref<Outcome>({ kind: 'idle' })\nconst recent = ref<{ id: number, text: string, ok: boolean }[]>([])\nlet counter = 0\n\nconst next = computed(() => props.lines.find(line => line.scanned < line.needed))\nconst total = computed(() => props.lines.reduce((sum, line) => sum + line.needed, 0))\nconst done = computed(() => props.lines.reduce((sum, line) => sum + Math.min(line.scanned, line.needed), 0))\nconst percent = computed(() => (total.value ? Math.round((done.value / total.value) * 100) : 0))\n\nconst palette = {\n ok: { icon: 'check_circle', box: 'bg-success-container text-on-success-container' },\n wrong: { icon: 'error', box: 'bg-error-container text-on-error-container' },\n duplicate: { icon: 'warning', box: 'bg-warning-container text-on-warning-container' }\n} as const\n\nfunction vibrate(pattern: number | number[]) {\n // API not available (iOS Safari) or blocked: the visual feedback remains.\n if (typeof navigator !== 'undefined' && 'vibrate' in navigator) navigator.vibrate(pattern)\n}\n\nfunction handle(raw: string) {\n const value = raw.trim()\n if (!value || props.blocked) return\n const line = props.lines.find(item => item.ean === value)\n if (!line) {\n outcome.value = { kind: 'wrong', message: 'Tego kodu nie ma na tej liście' }\n vibrate([80, 60, 80])\n }\n else if (line.scanned >= line.needed) {\n outcome.value = { kind: 'duplicate', message: `${line.name}: komplet, nic więcej nie trzeba` }\n vibrate(120)\n }\n else {\n outcome.value = { kind: 'ok', message: line.name }\n vibrate(40)\n emit('scan', line)\n }\n recent.value = [{ id: ++counter, text: value, ok: outcome.value.kind === 'ok' }, ...recent.value].slice(0, 5)\n code.value = ''\n // Focus returns to the field: the next scan from the reader lands immediately.\n nextTick(() => field.value?.focus())\n}\n\nfunction onCamera(value: string) {\n cameraOpen.value = false\n handle(value)\n}\n\nonMounted(() => field.value?.focus())\n</script>\n\n<template>\n <div class=\"mx-auto flex min-h-dvh max-w-xl flex-col\">\n <MTopAppBar title=\"Zbieranie\" navigation-icon=\"arrow_back\" navigation-label=\"Wstecz\" @navigation=\"emit('close')\" />\n\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <MProgressBar :value=\"percent\" :label=\"`Zebrano ${done} z ${total}`\" />\n\n <MCard v-if=\"next\" variant=\"filled\" class=\"p-4\">\n <p class=\"text-label-large text-on-surface-variant\">Zeskanuj teraz</p>\n <p class=\"text-headline-small text-on-surface\">{{ next.name }}</p>\n <p class=\"text-title-medium text-on-surface-variant\">{{ next.location }} · brakuje {{ next.needed - next.scanned }} szt.</p>\n </MCard>\n <p v-else class=\"text-title-large text-on-surface\">Wszystko zebrane</p>\n\n <!-- Last scan result: icon and sentence, not color alone. Errors use role=\"alert\", others role=\"status\". -->\n <div\n v-if=\"outcome.kind !== 'idle'\"\n :role=\"outcome.kind === 'wrong' ? 'alert' : 'status'\"\n class=\"flex items-center gap-3 rounded-lg p-4\"\n :class=\"palette[outcome.kind].box\"\n >\n <MIcon :name=\"palette[outcome.kind].icon\" :size=\"40\" :filled=\"true\" />\n <p class=\"text-title-large\">{{ outcome.message }}</p>\n </div>\n\n <MList v-if=\"recent.length\" :dense=\"true\">\n <MListItem\n v-for=\"item in recent\"\n :key=\"item.id\"\n :icon=\"item.ok ? 'check' : 'close'\"\n :title=\"item.text\"\n />\n </MList>\n </div>\n\n <!-- Thumb zone: field and main action at the bottom edge, with margin for the system bar. -->\n <div class=\"sticky bottom-0 flex flex-col gap-3 border-t border-outline-variant bg-surface p-4 pb-[calc(1rem+env(safe-area-inset-bottom))]\">\n <MTextField\n ref=\"field\"\n v-model=\"code\"\n label=\"Kod z czytnika lub wpisany\"\n variant=\"outlined\"\n :disabled=\"blocked\"\n autocomplete=\"off\"\n @keydown.enter=\"handle(code)\"\n />\n <MButton size=\"md\" icon=\"photo_camera\" class=\"w-full\" :disabled=\"blocked\" @click=\"cameraOpen = true\">\n Skanuj aparatem\n </MButton>\n </div>\n\n <MBottomSheet v-model=\"cameraOpen\" title=\"Skanuj aparatem\" max-height=\"92vh\">\n <MQRScanner v-if=\"cameraOpen\" autostart once :formats=\"['ean_13', 'ean_8', 'code_128', 'qr_code']\" @detect=\"onCamera($event.rawValue)\" />\n </MBottomSheet>\n </div>\n</template>\n```\n\n### Keeping the soft keyboard away on a phone (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\n// The field is used by the reader: on a phone the on-screen keyboard must not open on focus.\n// Since 1.11.0 these attributes reach the <input> directly.\nconst field = useTemplateRef<{ focus: () => void }>('field')\nconst code = defineModel<string>({ default: '' })\nconst manual = ref(false)\n\n// “Type manually” button: restores the keyboard only on demand.\nfunction typeByHand() {\n manual.value = true\n nextTick(() => field.value?.focus())\n}\n</script>\n\n<template>\n <div class=\"flex gap-2\">\n <MTextField\n ref=\"field\"\n v-model=\"code\"\n label=\"Kod\"\n variant=\"outlined\"\n autocomplete=\"off\"\n :inputmode=\"manual ? 'text' : 'none'\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n enterkeyhint=\"go\"\n aria-label=\"Kod z czytnika lub wpisany\"\n class=\"min-w-0 flex-1\"\n />\n <MIconButton icon=\"keyboard\" label=\"Wpisz ręcznie\" size=\"md\" variant=\"tonal\" @click=\"typeByHand\" />\n </div>\n</template>\n```\n\n### Plain Vue\n\n```vue\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { MButton, MTextField } from '@m3ui-vue/m3ui-vue'\n\nconst code = ref('')\nconst emit = defineEmits<{ scan: [code: string] }>()\n\nfunction submit() {\n if (!code.value.trim()) return\n emit('scan', code.value.trim())\n code.value = ''\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-3 p-4\">\n <MTextField v-model=\"code\" label=\"Kod\" variant=\"outlined\" @keydown.enter=\"submit\" />\n <MButton size=\"md\" class=\"w-full\" @click=\"submit\">Zatwierdź</MButton>\n </div>\n</template>\n```",
|
|
2132
2227
|
"phone": "Put what to do next at the top (card with the item and the place), the answer in the middle, the field and the large button at the bottom where the thumb rests. All text of the answer is at least `text-title-large`; the icon is 40 px. Use `100dvh` (`min-h-dvh`), not `100vh`, so the bar of the browser does not hide the bottom controls, and add the safe-area inset under the buttons (the library's sheet does the same for the top, source: pkg:src/components/MBottomSheet.vue:52-56). A vibration pattern distinguishes the three outcomes without looking: one short for right, two for wrong, one longer for already done. Vibration is not available in iOS Safari; the visual answer always stays.",
|
|
2133
2228
|
"wide": "On a tablet (600 px and up) put the list of lines in a second column and keep the scan block in the first, as `list-detail-adaptive` does; the scan column must keep the same bottom action. Do not enlarge the buttons beyond `md`: `lg` and `xl` (96 and 136 px) are for hero actions, not for an app used all day. For a hardware reader on a desktop or a docked tablet, the field with focus is the whole interface; a visible line \"Czeka na skan\" tells the person the screen is ready.",
|
|
2134
|
-
"pitfalls": "- A hardware reader types into whatever has focus. Since 1.11.0 `MDialog` and the sheets move focus into themselves and return it to the opener on close, so a scan cannot land in the field behind an open dialog; but when the sheet or dialog was opened by code (not by the field), focus returns to whatever had it, so after the result call `nextTick` then `focus()` on the field (source: pkg:src/composables/_useFocusTrap.ts:3-12). Disable the field (`blocked`) while a dialog or the sheet is open.\n- Since 1.11.0 `MTextField` passes `inputmode`, `enterkeyhint`, `autocapitalize` and `aria-label` to its `<input>` as plain attributes (the second example), and `placeholder` is a prop shown while focused. A label is still required (source: pkg:src/composables/_splitAttrs.ts:3-11; lib@
|
|
2229
|
+
"pitfalls": "- A hardware reader types into whatever has focus. Since 1.11.0 `MDialog` and the sheets move focus into themselves and return it to the opener on close, so a scan cannot land in the field behind an open dialog; but when the sheet or dialog was opened by code (not by the field), focus returns to whatever had it, so after the result call `nextTick` then `focus()` on the field (source: pkg:src/composables/_useFocusTrap.ts:3-12). Disable the field (`blocked`) while a dialog or the sheet is open.\n- Since 1.11.0 `MTextField` passes `inputmode`, `enterkeyhint`, `autocapitalize` and `aria-label` to its `<input>` as plain attributes (the second example), and `placeholder` is a prop shown while focused. A label is still required (source: pkg:src/composables/_splitAttrs.ts:3-11; lib@ed784d6:CHANGELOG.md:59).\n- `@keydown.enter` on `MTextField` works because the event bubbles to the component's root element; it is not a declared event of the component (inferred from source: pkg:src/components/MTextField.vue:96; pkg:src/components/MTextField.vue:208-227).\n- `MAlert` has no `role`; for a result that must be announced use your own `role=\"alert\"` (errors) or `role=\"status\"` (the rest), as above (inferred from source: pkg:src/components/MAlert.vue:70-82).\n- Use the `warning` role (since 1.11.0) for \"already scanned\", not a literal color in the template; color alone is not enough, so keep the icon and the sentence (source: pkg:src/styles/theme.css:58-68).\n- `MBottomSheet` with `fullHeight` is deprecated; use `max-height=\"92vh\"`. The sheet is for the camera view only; a sheet inside a sheet is hard to close on a phone.\n- The result box is one element whose `role` flips between `alert` and `status` and whose text changes. A live region is announced reliably when it is inserted, not when its role changes, and two identical wrong scans in a row produce the same text and no new announcement. Add `:key=\"counter\"` (a number you increase on every scan) to the result box so each scan inserts a fresh element.\n- `MDialog` and `MBottomSheet` render their content through `Teleport to=\"body\"`, and `MDialog` renders it on the first render when `modelValue` starts as `true`. For a scan screen that opens a confirmation dialog on load (for example a \"resume session\" prompt), set the flag in `onMounted` so the server HTML and the first client render match (source: pkg:src/components/MDialog.vue:111-163; pkg:src/components/MBottomSheet.vue:224).\n- A camera stream sees the same code on every frame. `MQRScanner` already ignores a repeated code for 2 seconds and `once` closes the reading after the first, as above; with your own video reader count one reading once yourself, or one product becomes five pieces (source: pkg:src/components/MQRScanner.vue:2-7).\n- `MQRScanner` has no torch control; in a dark warehouse aisle rely on the hardware reader or typed code, or build your own camera view with `getUserMedia` and the `torch` track constraint.\n- Do not rely on sound alone in a warehouse; it is often too loud to hear. Sound and vibration are options, the visual answer is not."
|
|
2135
2230
|
},
|
|
2136
2231
|
"examples": [
|
|
2137
2232
|
{
|
|
@@ -2168,71 +2263,71 @@
|
|
|
2168
2263
|
},
|
|
2169
2264
|
{
|
|
2170
2265
|
"ref": "pkg:src/components/MTopAppBar.vue:34-60",
|
|
2171
|
-
"url": "https://github.com/
|
|
2266
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTopAppBar.vue#L34-L60"
|
|
2172
2267
|
},
|
|
2173
2268
|
{
|
|
2174
2269
|
"ref": "pkg:src/components/MIcon.vue:1-55",
|
|
2175
|
-
"url": "https://github.com/
|
|
2270
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MIcon.vue#L1-L55"
|
|
2176
2271
|
},
|
|
2177
2272
|
{
|
|
2178
2273
|
"ref": "pkg:src/components/MButton.vue:38-49",
|
|
2179
|
-
"url": "https://github.com/
|
|
2274
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButton.vue#L38-L49"
|
|
2180
2275
|
},
|
|
2181
2276
|
{
|
|
2182
2277
|
"ref": "pkg:src/components/MButton.vue:149-159",
|
|
2183
|
-
"url": "https://github.com/
|
|
2278
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MButton.vue#L149-L159"
|
|
2184
2279
|
},
|
|
2185
2280
|
{
|
|
2186
2281
|
"ref": "pkg:src/components/MTextField.vue:208-227",
|
|
2187
|
-
"url": "https://github.com/
|
|
2282
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L208-L227"
|
|
2188
2283
|
},
|
|
2189
2284
|
{
|
|
2190
2285
|
"ref": "pkg:src/components/MBottomSheet.vue:25-33",
|
|
2191
|
-
"url": "https://github.com/
|
|
2286
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L25-L33"
|
|
2192
2287
|
},
|
|
2193
2288
|
{
|
|
2194
2289
|
"ref": "pkg:src/components/MBottomSheet.vue:52-56",
|
|
2195
|
-
"url": "https://github.com/
|
|
2290
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBottomSheet.vue#L52-L56"
|
|
2196
2291
|
},
|
|
2197
2292
|
{
|
|
2198
2293
|
"ref": "pkg:src/components/MProgressBar.vue:370-378",
|
|
2199
|
-
"url": "https://github.com/
|
|
2294
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MProgressBar.vue#L370-L378"
|
|
2200
2295
|
},
|
|
2201
2296
|
{
|
|
2202
2297
|
"ref": "pkg:src/components/MAlert.vue:70-82",
|
|
2203
|
-
"url": "https://github.com/
|
|
2298
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MAlert.vue#L70-L82"
|
|
2204
2299
|
},
|
|
2205
2300
|
{
|
|
2206
2301
|
"ref": "pkg:src/styles/theme.css:60-61",
|
|
2207
|
-
"url": "https://github.com/
|
|
2302
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/styles/theme.css#L60-L61"
|
|
2208
2303
|
},
|
|
2209
2304
|
{
|
|
2210
2305
|
"ref": "pkg:src/styles/theme.css:307-308",
|
|
2211
|
-
"url": "https://github.com/
|
|
2306
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/styles/theme.css#L307-L308"
|
|
2212
2307
|
},
|
|
2213
2308
|
{
|
|
2214
2309
|
"ref": "pkg:src/components/MDialog.vue:111-163",
|
|
2215
|
-
"url": "https://github.com/
|
|
2310
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDialog.vue#L111-L163"
|
|
2216
2311
|
},
|
|
2217
2312
|
{
|
|
2218
2313
|
"ref": "pkg:src/components/MQRScanner.vue:2-7",
|
|
2219
|
-
"url": "https://github.com/
|
|
2314
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MQRScanner.vue#L2-L7"
|
|
2220
2315
|
},
|
|
2221
2316
|
{
|
|
2222
2317
|
"ref": "pkg:src/components/MQRScanner.vue:33-48",
|
|
2223
|
-
"url": "https://github.com/
|
|
2318
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MQRScanner.vue#L33-L48"
|
|
2224
2319
|
},
|
|
2225
2320
|
{
|
|
2226
|
-
"ref": "lib@
|
|
2227
|
-
"url": "https://github.com/
|
|
2321
|
+
"ref": "lib@ed784d6:CHANGELOG.md",
|
|
2322
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/CHANGELOG.md"
|
|
2228
2323
|
},
|
|
2229
2324
|
{
|
|
2230
2325
|
"ref": "pkg:src/composables/_useFocusTrap.ts",
|
|
2231
|
-
"url": "https://github.com/
|
|
2326
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_useFocusTrap.ts"
|
|
2232
2327
|
},
|
|
2233
2328
|
{
|
|
2234
2329
|
"ref": "pkg:src/composables/_splitAttrs.ts",
|
|
2235
|
-
"url": "https://github.com/
|
|
2330
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_splitAttrs.ts"
|
|
2236
2331
|
}
|
|
2237
2332
|
],
|
|
2238
2333
|
"verified": {
|
|
@@ -2298,11 +2393,11 @@
|
|
|
2298
2393
|
},
|
|
2299
2394
|
{
|
|
2300
2395
|
"ref": "pkg:src/components/MStepper.vue:1-70",
|
|
2301
|
-
"url": "https://github.com/
|
|
2396
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MStepper.vue#L1-L70"
|
|
2302
2397
|
},
|
|
2303
2398
|
{
|
|
2304
2399
|
"ref": "pkg:src/components/MStepper.vue:71-173",
|
|
2305
|
-
"url": "https://github.com/
|
|
2400
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MStepper.vue#L71-L173"
|
|
2306
2401
|
},
|
|
2307
2402
|
{
|
|
2308
2403
|
"ref": "pkg:dist/api.json",
|
|
@@ -2365,35 +2460,35 @@
|
|
|
2365
2460
|
"sources": [
|
|
2366
2461
|
{
|
|
2367
2462
|
"ref": "pkg:src/components/MCarousel.vue:8",
|
|
2368
|
-
"url": "https://github.com/
|
|
2463
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L8"
|
|
2369
2464
|
},
|
|
2370
2465
|
{
|
|
2371
2466
|
"ref": "pkg:src/components/MCarousel.vue:84-87",
|
|
2372
|
-
"url": "https://github.com/
|
|
2467
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L84-L87"
|
|
2373
2468
|
},
|
|
2374
2469
|
{
|
|
2375
2470
|
"ref": "pkg:src/components/MCarousel.vue:155",
|
|
2376
|
-
"url": "https://github.com/
|
|
2471
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L155"
|
|
2377
2472
|
},
|
|
2378
2473
|
{
|
|
2379
2474
|
"ref": "pkg:src/components/MCarousel.vue:330-335",
|
|
2380
|
-
"url": "https://github.com/
|
|
2475
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L330-L335"
|
|
2381
2476
|
},
|
|
2382
2477
|
{
|
|
2383
2478
|
"ref": "pkg:src/components/MCarousel.vue:539-544",
|
|
2384
|
-
"url": "https://github.com/
|
|
2479
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L539-L544"
|
|
2385
2480
|
},
|
|
2386
2481
|
{
|
|
2387
2482
|
"ref": "pkg:src/components/MCarousel.vue:221-222",
|
|
2388
|
-
"url": "https://github.com/
|
|
2483
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L221-L222"
|
|
2389
2484
|
},
|
|
2390
2485
|
{
|
|
2391
2486
|
"ref": "pkg:src/components/MCarousel.vue:500-501",
|
|
2392
|
-
"url": "https://github.com/
|
|
2487
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCarousel.vue#L500-L501"
|
|
2393
2488
|
},
|
|
2394
2489
|
{
|
|
2395
2490
|
"ref": "pkg:src/index.ts:111",
|
|
2396
|
-
"url": "https://github.com/
|
|
2491
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/index.ts#L111"
|
|
2397
2492
|
}
|
|
2398
2493
|
],
|
|
2399
2494
|
"verified": {
|
|
@@ -2453,43 +2548,43 @@
|
|
|
2453
2548
|
"sources": [
|
|
2454
2549
|
{
|
|
2455
2550
|
"ref": "pkg:src/components/MPinInput.vue:1-10",
|
|
2456
|
-
"url": "https://github.com/
|
|
2551
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPinInput.vue#L1-L10"
|
|
2457
2552
|
},
|
|
2458
2553
|
{
|
|
2459
2554
|
"ref": "pkg:src/components/MPinInput.vue:97",
|
|
2460
|
-
"url": "https://github.com/
|
|
2555
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPinInput.vue#L97"
|
|
2461
2556
|
},
|
|
2462
2557
|
{
|
|
2463
2558
|
"ref": "pkg:src/components/MPinInput.vue:121",
|
|
2464
|
-
"url": "https://github.com/
|
|
2559
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPinInput.vue#L121"
|
|
2465
2560
|
},
|
|
2466
2561
|
{
|
|
2467
2562
|
"ref": "pkg:src/components/MPinInput.vue:134-140",
|
|
2468
|
-
"url": "https://github.com/
|
|
2563
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPinInput.vue#L134-L140"
|
|
2469
2564
|
},
|
|
2470
2565
|
{
|
|
2471
2566
|
"ref": "pkg:src/components/MPinInput.vue:251",
|
|
2472
|
-
"url": "https://github.com/
|
|
2567
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPinInput.vue#L251"
|
|
2473
2568
|
},
|
|
2474
2569
|
{
|
|
2475
2570
|
"ref": "pkg:src/components/MPinInput.vue:254",
|
|
2476
|
-
"url": "https://github.com/
|
|
2571
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPinInput.vue#L254"
|
|
2477
2572
|
},
|
|
2478
2573
|
{
|
|
2479
2574
|
"ref": "pkg:src/components/MCountdown.vue:16-26",
|
|
2480
|
-
"url": "https://github.com/
|
|
2575
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCountdown.vue#L16-L26"
|
|
2481
2576
|
},
|
|
2482
2577
|
{
|
|
2483
2578
|
"ref": "pkg:src/components/MCountdown.vue:143",
|
|
2484
|
-
"url": "https://github.com/
|
|
2579
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCountdown.vue#L143"
|
|
2485
2580
|
},
|
|
2486
2581
|
{
|
|
2487
2582
|
"ref": "pkg:src/components/MCountdown.vue:148-152",
|
|
2488
|
-
"url": "https://github.com/
|
|
2583
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCountdown.vue#L148-L152"
|
|
2489
2584
|
},
|
|
2490
2585
|
{
|
|
2491
2586
|
"ref": "pkg:src/components/MCountdown.vue:169-171",
|
|
2492
|
-
"url": "https://github.com/
|
|
2587
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCountdown.vue#L169-L171"
|
|
2493
2588
|
},
|
|
2494
2589
|
{
|
|
2495
2590
|
"ref": "https://m3.material.io/components/text-fields/guidelines",
|
|
@@ -2543,13 +2638,13 @@
|
|
|
2543
2638
|
"aria labels"
|
|
2544
2639
|
],
|
|
2545
2640
|
"sections": {
|
|
2546
|
-
"when": "Configure it once at app startup: all built-in texts of M3UI (button labels of pickers, table footers, aria labels, announcements for drag and drop) are English until you pass a locale. Since 1.11.0 the library ships a complete Polish preset, `plLocale`, with plural forms (\"1 noc\", \"2 noce\", \"5 nocy\"), and the Nuxt module (0.8.0) accepts `locale: 'pl'` (source: pkg:src/locales/index.ts:9; pkg:src/locales/pl.ts:1-6; nuxtrepo@
|
|
2547
|
-
"components": "- `plLocale` comes from the `@m3ui-vue/m3ui-vue/locales` entry, next to the other presets (es, fr, pt, de, ja, zh, ko, ar); it is a full `M3Locale` with `lang: 'pl'` (source: pkg:src/locales/index.ts:1-10; pkg:src/locales/pl.ts:5-6).\n- `createM3UI({ locale })` takes a `Partial<M3Locale>`, a plain object or a ref; in Nuxt `m3ui: { locale: 'pl' }` (or `'auto'` with `@nuxtjs/i18n`, which maps `pl-PL` to Polish) (source: pkg:src/plugin.ts:59; nuxt:dist/module.d.mts:4-23; nuxt:dist/runtime/plugin.js:35-40).\n- `useLocale()` (Nuxt: `useM3Locale()`) returns the merged texts; read it in your own components that must say the same word as a library component (source: pkg:src/composables/useLocale.ts:
|
|
2641
|
+
"when": "Configure it once at app startup: all built-in texts of M3UI (button labels of pickers, table footers, aria labels, announcements for drag and drop) are English until you pass a locale. Since 1.11.0 the library ships a complete Polish preset, `plLocale`, with plural forms (\"1 noc\", \"2 noce\", \"5 nocy\"), and the Nuxt module (0.8.0) accepts `locale: 'pl'` (source: pkg:src/locales/index.ts:9; pkg:src/locales/pl.ts:1-6; nuxtrepo@3a11195:CHANGELOG.md:21-28).\n\nYou no longer write the object yourself. Write only the keys you want to word differently, on top of the preset.",
|
|
2642
|
+
"components": "- `plLocale` comes from the `@m3ui-vue/m3ui-vue/locales` entry, next to the other presets (es, fr, pt, de, ja, zh, ko, ar); it is a full `M3Locale` with `lang: 'pl'` (source: pkg:src/locales/index.ts:1-10; pkg:src/locales/pl.ts:5-6).\n- `createM3UI({ locale })` takes a `Partial<M3Locale>`, a plain object or a ref; in Nuxt `m3ui: { locale: 'pl' }` (or `'auto'` with `@nuxtjs/i18n`, which maps `pl-PL` to Polish) (source: pkg:src/plugin.ts:59; nuxt:dist/module.d.mts:4-23; nuxt:dist/runtime/plugin.js:35-40).\n- `useLocale()` (Nuxt: `useM3Locale()`) returns the merged texts; read it in your own components that must say the same word as a library component (source: pkg:src/composables/useLocale.ts:1927-1936).\n- `formatMessage(template, vars, lang)` fills `{name}` placeholders and ICU-style plural blocks `{n, plural, one {…} few {…} many {…} other {…}}` with `Intl.PluralRules`; it is exported, so your own texts can use the same syntax (source: pkg:src/composables/useLocale.ts:1863-1888; pkg:src/index.ts:33).\n- `useToast`, `useConfirm` and `useNotification` mount in an app of their own; the plugin hands them the same locale (source: pkg:src/composables/useLocale.ts:1853-1861).",
|
|
2548
2643
|
"guideline": "Material expects text in the user's language and layouts that tolerate its length; Polish labels are often longer than English ones. The M3 guidance on bidirectionality and localization is about layout and direction rather than wording, so the rule that applies here is practical: every string a component shows or announces must be in the user's language, including the ones read by a screen reader (source: https://m3ui.dev/getting-started/i18n.md; https://m3.material.io/foundations/layout/bidirectionality-rtl).",
|
|
2549
|
-
"code": "### Nuxt: the preset\n\n```ts\n// nuxt.config.ts (fragment)\nexport default defineNuxtConfig({\n modules: ['@m3ui-vue/nuxt'],\n m3ui: { locale: 'pl' },\n app: { head: { htmlAttrs: { lang: 'pl' } } }\n})\n```\n\n### Plain Vue: the preset with a few words of your own\n\n```ts\n// main.ts\nimport { createApp } from 'vue'\nimport { createM3UI, type M3Locale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\nimport App from './App.vue'\n\n// Keys you omit come from plLocale; a key missing there would fall back to English.\nconst locale: M3Locale = {\n ...plLocale,\n recordCount: 'pozycje',\n noResults: 'Nic nie znaleziono'\n}\n\ncreateApp(App).use(createM3UI({ locale })).mount('#app')\n```\n\n### Your own counts with the library's plural rules (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\nimport { formatMessage } from '@m3ui-vue/m3ui-vue'\n\nconst props = defineProps<{ count: number }>()\nconst emit = defineEmits<{ clear: [], confirm: [] }>()\nconst locale = useM3Locale()\n\n// One template; Intl.PluralRules picks the Polish form for 1, 3 and 5.\nconst ORDERS = '{n, plural, one {# zamówienie} few {# zamówienia} many {# zamówień} other {# zamówienia}}'\nconst label = computed(() => formatMessage(ORDERS, { n: props.count }, locale.lang))\n</script>\n\n<template>\n <div class=\"flex items-center gap-2\">\n <span class=\"text-body-medium text-on-surface-variant\">{{ label }}</span>\n <MButton variant=\"text\" @click=\"emit('clear')\">{{ locale.clear }}</MButton>\n <MButton @click=\"emit('confirm')\">{{ locale.confirm }}</MButton>\n </div>\n</template>\n```\n\n### A test that keeps your overrides honest (vitest)\n\n```ts\n// tests/app/m3-locale.test.ts\n// pseudo: src/m3Locale.ts is your own module exporting `overrides` (the keys you change in plLocale)\nimport { defaultLocale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\nimport { describe, expect, it } from 'vitest'\nimport { overrides } from '../../src/m3Locale'\n\nconst placeholders = (text: string) => (text.match(/\\{(\\w+)[},]/g) ?? []).map((p) => p.slice(1, -1)).sort()\n\ndescribe('nadpisania polskich tekstów M3UI', () => {\n const entries = Object.entries(overrides) as [keyof typeof defaultLocale, string][]\n\n it('używa tylko kluczy, które istnieją w bibliotece', () => {\n for (const [key] of entries) expect(Object.keys(defaultLocale)).toContain(key)\n })\n\n it('zachowuje zmienne z polskiego presetu', () => {\n for (const [key, value] of entries) expect(placeholders(value), key).toEqual(placeholders(String(plLocale[key])))\n })\n})\n```\n\n### Switching the language while the app runs (plain Vue)\n\n`createM3UI` accepts a ref: the components read it through `toValue` in a `watchEffect`, so changing the ref re-renders every library text, toasts included (source: pkg:src/plugin.ts:206-208; pkg:src/composables/useLocale.ts:
|
|
2644
|
+
"code": "### Nuxt: the preset\n\n```ts\n// nuxt.config.ts (fragment)\nexport default defineNuxtConfig({\n modules: ['@m3ui-vue/nuxt'],\n m3ui: { locale: 'pl' },\n app: { head: { htmlAttrs: { lang: 'pl' } } }\n})\n```\n\n### Plain Vue: the preset with a few words of your own\n\n```ts\n// main.ts\nimport { createApp } from 'vue'\nimport { createM3UI, type M3Locale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\nimport App from './App.vue'\n\n// Keys you omit come from plLocale; a key missing there would fall back to English.\nconst locale: M3Locale = {\n ...plLocale,\n // a count key is a template with {count}; a bare word would read \"1 pozycje\"\n recordCount: '{count, plural, one {# pozycja} few {# pozycje} many {# pozycji} other {# pozycji}}',\n noResults: 'Nic nie znaleziono'\n}\n\ncreateApp(App).use(createM3UI({ locale })).mount('#app')\n```\n\n### Your own counts with the library's plural rules (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\nimport { formatMessage } from '@m3ui-vue/m3ui-vue'\n\nconst props = defineProps<{ count: number }>()\nconst emit = defineEmits<{ clear: [], confirm: [] }>()\nconst locale = useM3Locale()\n\n// One template; Intl.PluralRules picks the Polish form for 1, 3 and 5.\nconst ORDERS = '{n, plural, one {# zamówienie} few {# zamówienia} many {# zamówień} other {# zamówienia}}'\nconst label = computed(() => formatMessage(ORDERS, { n: props.count }, locale.lang))\n</script>\n\n<template>\n <div class=\"flex items-center gap-2\">\n <span class=\"text-body-medium text-on-surface-variant\">{{ label }}</span>\n <MButton variant=\"text\" @click=\"emit('clear')\">{{ locale.clear }}</MButton>\n <MButton @click=\"emit('confirm')\">{{ locale.confirm }}</MButton>\n </div>\n</template>\n```\n\n### A test that keeps your overrides honest (vitest)\n\n```ts\n// tests/app/m3-locale.test.ts\n// pseudo: src/m3Locale.ts is your own module exporting `overrides` (the keys you change in plLocale)\nimport { defaultLocale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\nimport { describe, expect, it } from 'vitest'\nimport { overrides } from '../../src/m3Locale'\n\nconst placeholders = (text: string) => (text.match(/\\{(\\w+)[},]/g) ?? []).map((p) => p.slice(1, -1)).sort()\n\ndescribe('nadpisania polskich tekstów M3UI', () => {\n const entries = Object.entries(overrides) as [keyof typeof defaultLocale, string][]\n\n it('używa tylko kluczy, które istnieją w bibliotece', () => {\n for (const [key] of entries) expect(Object.keys(defaultLocale)).toContain(key)\n })\n\n it('zachowuje zmienne z polskiego presetu', () => {\n for (const [key, value] of entries) expect(placeholders(value), key).toEqual(placeholders(String(plLocale[key])))\n })\n})\n```\n\n### Switching the language while the app runs (plain Vue)\n\n`createM3UI` accepts a ref: the components read it through `toValue` in a `watchEffect`, so changing the ref re-renders every library text, toasts included (source: pkg:src/plugin.ts:206-208; pkg:src/composables/useLocale.ts:1927-1936).\n\n```ts\n// locales/active.ts\nimport { ref } from 'vue'\nimport type { M3Locale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\n\n/** Pass it as `locale` to the M3UI plugin in main.ts. */\nexport const m3Locale = ref<Partial<M3Locale>>(plLocale)\n\n/** English needs only `lang`: missing keys fall back to the English defaults. */\nexport function setLanguage(lang: 'pl' | 'en') {\n m3Locale.value = lang === 'pl' ? plLocale : { lang: 'en' }\n document.documentElement.lang = lang\n}\n```\n\n### Switching the language in Nuxt\n\nA fixed `m3ui.locale` (`'pl'` or an object) is serialized at build time, so it cannot change while the app runs. To switch, install `@nuxtjs/i18n` and set `m3ui.locale: 'auto'`: the module follows the i18n language on the server and in the browser, and `pl` / `pl-PL` select `plLocale` (source: nuxt:dist/runtime/plugin.js:35-40; nuxt:dist/module.mjs:6). Everything else is explained in the `nuxt/i18n-auto` card.",
|
|
2550
2645
|
"phone": "Check the translated labels at 360 px: Polish words are longer, so a navigation bar label, a chip or a tab can be cut off. The aria texts do not take room but matter on a phone with TalkBack: a screen that looks Polish and is read in English is a common miss, and the preset covers those keys too. Keep texts that appear in live feedback or status announcements short.",
|
|
2551
|
-
"wide": "The table footer and the pagination are the most visible library texts. `MPagination` fills its texts with `formatMessage`, so the preset's \"1–10 z 240\" and \"Strona 1 z 24\" are right (source: pkg:src/components/MPagination.vue).
|
|
2552
|
-
"pitfalls": "-
|
|
2646
|
+
"wide": "The table footer and the pagination are the most visible library texts. `MPagination` fills its texts with `formatMessage`, so the preset's \"1–10 z 240\" and \"Strona 1 z 24\" are right (source: pkg:src/components/MPagination.vue). Since 1.11.1 the `MDataTable` counter does the same (\"240 rekordów\") (source: pkg:src/components/MDataTable.vue:636).",
|
|
2647
|
+
"pitfalls": "- Overrides of `selectedCount`, `recordCount`, `jsonElements` and `jsonFields` (and the `selected-text` / `records-text` props) must be templates with `{count}`, for example `recordCount: '{count, plural, one {# zamówienie} few {# zamówienia} many {# zamówień} other {# zamówienia}}'`. A bare word is shown after the number for every count (\"1 zamówienia\"); since 1.11.1 nothing is appended to it (source: pkg:src/composables/_countLabel.ts:8-10; pkg:src/locales/pl.ts:22-23).\n- `formatMessage` without its third argument uses English plural rules: \"5 paczki\" instead of \"5 paczek\". Pass `locale.lang` (or `'pl'`) (source: pkg:src/composables/useLocale.ts:1869).\n- A few components (`MBodyMap`, `MDashboardGrid`) still fill placeholders with `String.replace`, which replaces only the first occurrence and ignores plural blocks; do not repeat a placeholder in an override of their keys (source: pkg:src/components/MBodyMap.vue:109-110; pkg:src/components/MDashboardGrid.vue:260).\n- An override object without `...plLocale` replaces the preset: every key you did not list falls back to English, not Polish (source: pkg:src/composables/useLocale.ts:1927-1936).\n- A new library version may add keys; `plLocale` comes with it, but your own full copy (an old hand-written `pl.ts`) does not. Delete such a copy and keep only the overrides.\n- In Nuxt the locale passes through module options, so an object there must be plain strings; a function or a ref will not survive the build (source: nuxt:dist/module.mjs).\n- Set `lang=\"pl\"` on `<html>` yourself (as in the Nuxt config above): the locale's `lang` key formats dates and plurals but does not touch the document."
|
|
2553
2648
|
},
|
|
2554
2649
|
"examples": [
|
|
2555
2650
|
{
|
|
@@ -2562,7 +2657,7 @@
|
|
|
2562
2657
|
"title": "Plain Vue: the preset with a few words of your own",
|
|
2563
2658
|
"lang": "ts",
|
|
2564
2659
|
"nuxt": false,
|
|
2565
|
-
"code": "// main.ts\nimport { createApp } from 'vue'\nimport { createM3UI, type M3Locale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\nimport App from './App.vue'\n\n// Keys you omit come from plLocale; a key missing there would fall back to English.\nconst locale: M3Locale = {\n ...plLocale,\n recordCount: 'pozycje',\n noResults: 'Nic nie znaleziono'\n}\n\ncreateApp(App).use(createM3UI({ locale })).mount('#app')"
|
|
2660
|
+
"code": "// main.ts\nimport { createApp } from 'vue'\nimport { createM3UI, type M3Locale } from '@m3ui-vue/m3ui-vue'\nimport { plLocale } from '@m3ui-vue/m3ui-vue/locales'\nimport App from './App.vue'\n\n// Keys you omit come from plLocale; a key missing there would fall back to English.\nconst locale: M3Locale = {\n ...plLocale,\n // a count key is a template with {count}; a bare word would read \"1 pozycje\"\n recordCount: '{count, plural, one {# pozycja} few {# pozycje} many {# pozycji} other {# pozycji}}',\n noResults: 'Nic nie znaleziono'\n}\n\ncreateApp(App).use(createM3UI({ locale })).mount('#app')"
|
|
2566
2661
|
},
|
|
2567
2662
|
{
|
|
2568
2663
|
"title": "Your own counts with the library's plural rules (Nuxt)",
|
|
@@ -2585,12 +2680,16 @@
|
|
|
2585
2680
|
],
|
|
2586
2681
|
"sources": [
|
|
2587
2682
|
{
|
|
2588
|
-
"ref": "
|
|
2589
|
-
"url": "https://github.com/
|
|
2683
|
+
"ref": "pkg:src/composables/_countLabel.ts:1-10",
|
|
2684
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_countLabel.ts#L1-L10"
|
|
2685
|
+
},
|
|
2686
|
+
{
|
|
2687
|
+
"ref": "lib@ed784d6:CHANGELOG.md",
|
|
2688
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/CHANGELOG.md"
|
|
2590
2689
|
},
|
|
2591
2690
|
{
|
|
2592
|
-
"ref": "nuxtrepo@
|
|
2593
|
-
"url": "https://github.com/
|
|
2691
|
+
"ref": "nuxtrepo@3a11195:CHANGELOG.md:21-28",
|
|
2692
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue-nuxt/blob/3a11195d9b21d958c0fb871297738c04f857f86f/CHANGELOG.md#L21-L28"
|
|
2594
2693
|
},
|
|
2595
2694
|
{
|
|
2596
2695
|
"ref": "https://m3.material.io/foundations/layout/bidirectionality-rtl",
|
|
@@ -2602,31 +2701,31 @@
|
|
|
2602
2701
|
},
|
|
2603
2702
|
{
|
|
2604
2703
|
"ref": "pkg:src/composables/useLocale.ts",
|
|
2605
|
-
"url": "https://github.com/
|
|
2704
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useLocale.ts"
|
|
2606
2705
|
},
|
|
2607
2706
|
{
|
|
2608
2707
|
"ref": "pkg:src/locales/index.ts",
|
|
2609
|
-
"url": "https://github.com/
|
|
2708
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/locales/index.ts"
|
|
2610
2709
|
},
|
|
2611
2710
|
{
|
|
2612
2711
|
"ref": "pkg:src/locales/pl.ts",
|
|
2613
|
-
"url": "https://github.com/
|
|
2712
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/locales/pl.ts"
|
|
2614
2713
|
},
|
|
2615
2714
|
{
|
|
2616
2715
|
"ref": "pkg:src/components/MDataTable.vue",
|
|
2617
|
-
"url": "https://github.com/
|
|
2716
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDataTable.vue"
|
|
2618
2717
|
},
|
|
2619
2718
|
{
|
|
2620
2719
|
"ref": "pkg:src/components/MPagination.vue",
|
|
2621
|
-
"url": "https://github.com/
|
|
2720
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPagination.vue"
|
|
2622
2721
|
},
|
|
2623
2722
|
{
|
|
2624
2723
|
"ref": "pkg:src/plugin.ts",
|
|
2625
|
-
"url": "https://github.com/
|
|
2724
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/plugin.ts"
|
|
2626
2725
|
},
|
|
2627
2726
|
{
|
|
2628
2727
|
"ref": "pkg:src/index.ts",
|
|
2629
|
-
"url": "https://github.com/
|
|
2728
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/index.ts"
|
|
2630
2729
|
},
|
|
2631
2730
|
{
|
|
2632
2731
|
"ref": "nuxt:dist/module.d.mts",
|
|
@@ -2642,16 +2741,16 @@
|
|
|
2642
2741
|
},
|
|
2643
2742
|
{
|
|
2644
2743
|
"ref": "pkg:src/components/MBodyMap.vue",
|
|
2645
|
-
"url": "https://github.com/
|
|
2744
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MBodyMap.vue"
|
|
2646
2745
|
},
|
|
2647
2746
|
{
|
|
2648
2747
|
"ref": "pkg:src/components/MDashboardGrid.vue",
|
|
2649
|
-
"url": "https://github.com/
|
|
2748
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MDashboardGrid.vue"
|
|
2650
2749
|
}
|
|
2651
2750
|
],
|
|
2652
2751
|
"verified": {
|
|
2653
|
-
"by": "update-1.
|
|
2654
|
-
"at": "2026-12-
|
|
2752
|
+
"by": "update-1.13.0",
|
|
2753
|
+
"at": "2026-12-05",
|
|
2655
2754
|
"method": "source-read"
|
|
2656
2755
|
}
|
|
2657
2756
|
},
|
|
@@ -2693,7 +2792,7 @@
|
|
|
2693
2792
|
"when": "Use it for a till on a tablet or a phone: the cashier types the amount, takes cash (the keypad shows what is still due or the change) or a card, and gets a receipt to print. For a full shop cart with products, put the product list next to this flow; the payment part stays the same.",
|
|
2694
2793
|
"components": "- `MPosKeypad`: `v-model` is a string; `currency`, `entry=\"shift\"` (digits fill from the cents, as on a till), `max`, `quickAmounts` (bank notes), `due` (the amount to pay: the display then shows \"Do zapłaty\" or \"Reszta\" from the locale), `actionLabel` / `actionIcon` / `actionDisabled` and `@submit`. With `due`, the action button stays disabled until the amount covers it (source: pkg:src/components/MPosKeypad.vue:205-224).\n- `MReceipt`: `items` (`{ name, quantity?, price, note? }`), `adjustments` (discounts, taxes; `included: true` for VAT inside the price), `payments` (more than the total prints the change), `currency`, `number`, `date`, `paper`, `footer`, and the exposed `print()` that prints only the receipt (source: pkg:src/components/MReceipt.vue:3-27; pkg:src/components/MReceipt.vue:34; pkg:src/components/MReceipt.vue:125-134). `ReceiptItem`, `ReceiptAdjustment` and `ReceiptPayment` are exported from the package.\n- `MDialog` (`persistent`) shows the receipt after payment; `MButton` for \"Gotówka\", \"Karta\", \"Drukuj\", \"Nowa sprzedaż\".",
|
|
2695
2794
|
"guideline": "Large targets and one main action per step: the amount, then the payment method, then the receipt. The money on screen is the most important text, so it is the largest; the remaining amount and the change must not rely on color alone (the keypad writes the word too).",
|
|
2696
|
-
"code": "### Sale with cash or card and a printed receipt\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from 'vue'\nimport { MButton, MDialog, MPosKeypad, MReceipt } from '@m3ui-vue/m3ui-vue'\nimport type { ReceiptAdjustment, ReceiptItem, ReceiptPayment } from '@m3ui-vue/m3ui-vue'\n\nconst amount = ref('')\nconst tendered = ref('')\nconst step = ref<'amount' | 'cash'>('amount')\nconst receiptOpen = ref(false)\nconst sale = ref<{ number: string, date: Date, items: ReceiptItem[], payments: ReceiptPayment[] } | null>(null)\nconst receipt = useTemplateRef<InstanceType<typeof MReceipt>>('receipt')\nlet nextNumber = 1042\n\nconst vat: ReceiptAdjustment[] = [{ label: 'w tym VAT 23%', percent: 23, included: true }]\nconst due = computed(() => Number(amount.value || 0))\n\nfunction finish(method: string, paid: number) {\n sale.value = {\n number: `PAR/${nextNumber++}`,\n date: new Date(),\n items: [{ name: 'Sprzedaż', quantity: 1, price: due.value }],\n payments: [{ method, amount: paid }],\n }\n receiptOpen.value = true\n}\n\nfunction payCash(value: string) {\n // Enter on a hardware keyboard can submit before the amount covers the sale: check it here too.\n if (Number(value || 0) >= due.value) finish('Gotówka', Number(value))\n}\n\nfunction newSale() {\n receiptOpen.value = false\n amount.value = ''\n tendered.value = ''\n step.value = 'amount'\n}\n</script>\n\n<template>\n <main class=\"mx-auto flex min-h-dvh max-w-sm flex-col gap-4 bg-surface p-4\">\n <h1 class=\"text-title-large text-on-surface\">Kasa</h1>\n\n <template v-if=\"step === 'amount'\">\n <MPosKeypad v-model=\"amount\" currency=\"PLN\" entry=\"shift\" :max=\"99999.99\" />\n <div class=\"grid grid-cols-2 gap-3\">\n <MButton variant=\"tonal\" icon=\"payments\" :disabled=\"!due\" @click=\"step = 'cash'\">Gotówka</MButton>\n <MButton icon=\"credit_card\" :disabled=\"!due\" @click=\"finish('Karta', due)\">Karta</MButton>\n </div>\n </template>\n\n <template v-else>\n <MPosKeypad\n v-model=\"tendered\"\n currency=\"PLN\"\n entry=\"shift\"\n :due=\"due\"\n :quick-amounts=\"[50, 100, 200]\"\n action-label=\"Przyjmij gotówkę\"\n action-icon=\"payments\"\n @submit=\"payCash\"\n />\n <MButton variant=\"text\" icon=\"arrow_back\" @click=\"step = 'amount'\">Zmień kwotę</MButton>\n </template>\n\n <MDialog v-model=\"receiptOpen\" title=\"Paragon\" max-width=\"max-w-sm\" persistent>\n <div v-if=\"sale\" class=\"flex justify-center bg-surface-container p-2\">\n <MReceipt\n ref=\"receipt\"\n :items=\"sale.items\"\n :adjustments=\"vat\"\n :payments=\"sale.payments\"\n currency=\"PLN\"\n :number=\"sale.number\"\n :date=\"sale.date\"\n footer=\"Dziękujemy za zakupy!\"\n />\n </div>\n <template #actions>\n <MButton variant=\"text\" icon=\"print\" @click=\"receipt?.print()\">Drukuj</MButton>\n <MButton icon=\"add\" @click=\"newSale\">Nowa sprzedaż</MButton>\n </template>\n </MDialog>\n </main>\n</template>\n```\n\nThe keypad's \"Do zapłaty\", \"Reszta\", \"Usuń\" and the receipt's \"Razem\" come from the app locale: add the `keypad*` and `receipt*` keys of the `polish-locale` recipe and `lang: 'pl'`, or they are English and amounts are formatted as `12.50` (source: pkg:src/composables/useLocale.ts:
|
|
2795
|
+
"code": "### Sale with cash or card and a printed receipt\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from 'vue'\nimport { MButton, MDialog, MPosKeypad, MReceipt } from '@m3ui-vue/m3ui-vue'\nimport type { ReceiptAdjustment, ReceiptItem, ReceiptPayment } from '@m3ui-vue/m3ui-vue'\n\nconst amount = ref('')\nconst tendered = ref('')\nconst step = ref<'amount' | 'cash'>('amount')\nconst receiptOpen = ref(false)\nconst sale = ref<{ number: string, date: Date, items: ReceiptItem[], payments: ReceiptPayment[] } | null>(null)\nconst receipt = useTemplateRef<InstanceType<typeof MReceipt>>('receipt')\nlet nextNumber = 1042\n\nconst vat: ReceiptAdjustment[] = [{ label: 'w tym VAT 23%', percent: 23, included: true }]\nconst due = computed(() => Number(amount.value || 0))\n\nfunction finish(method: string, paid: number) {\n sale.value = {\n number: `PAR/${nextNumber++}`,\n date: new Date(),\n items: [{ name: 'Sprzedaż', quantity: 1, price: due.value }],\n payments: [{ method, amount: paid }],\n }\n receiptOpen.value = true\n}\n\nfunction payCash(value: string) {\n // Enter on a hardware keyboard can submit before the amount covers the sale: check it here too.\n if (Number(value || 0) >= due.value) finish('Gotówka', Number(value))\n}\n\nfunction newSale() {\n receiptOpen.value = false\n amount.value = ''\n tendered.value = ''\n step.value = 'amount'\n}\n</script>\n\n<template>\n <main class=\"mx-auto flex min-h-dvh max-w-sm flex-col gap-4 bg-surface p-4\">\n <h1 class=\"text-title-large text-on-surface\">Kasa</h1>\n\n <template v-if=\"step === 'amount'\">\n <MPosKeypad v-model=\"amount\" currency=\"PLN\" entry=\"shift\" :max=\"99999.99\" />\n <div class=\"grid grid-cols-2 gap-3\">\n <MButton variant=\"tonal\" icon=\"payments\" :disabled=\"!due\" @click=\"step = 'cash'\">Gotówka</MButton>\n <MButton icon=\"credit_card\" :disabled=\"!due\" @click=\"finish('Karta', due)\">Karta</MButton>\n </div>\n </template>\n\n <template v-else>\n <MPosKeypad\n v-model=\"tendered\"\n currency=\"PLN\"\n entry=\"shift\"\n :due=\"due\"\n :quick-amounts=\"[50, 100, 200]\"\n action-label=\"Przyjmij gotówkę\"\n action-icon=\"payments\"\n @submit=\"payCash\"\n />\n <MButton variant=\"text\" icon=\"arrow_back\" @click=\"step = 'amount'\">Zmień kwotę</MButton>\n </template>\n\n <MDialog v-model=\"receiptOpen\" title=\"Paragon\" max-width=\"max-w-sm\" persistent>\n <div v-if=\"sale\" class=\"flex justify-center bg-surface-container p-2\">\n <MReceipt\n ref=\"receipt\"\n :items=\"sale.items\"\n :adjustments=\"vat\"\n :payments=\"sale.payments\"\n currency=\"PLN\"\n :number=\"sale.number\"\n :date=\"sale.date\"\n footer=\"Dziękujemy za zakupy!\"\n />\n </div>\n <template #actions>\n <MButton variant=\"text\" icon=\"print\" @click=\"receipt?.print()\">Drukuj</MButton>\n <MButton icon=\"add\" @click=\"newSale\">Nowa sprzedaż</MButton>\n </template>\n </MDialog>\n </main>\n</template>\n```\n\nThe keypad's \"Do zapłaty\", \"Reszta\", \"Usuń\" and the receipt's \"Razem\" come from the app locale: add the `keypad*` and `receipt*` keys of the `polish-locale` recipe and `lang: 'pl'`, or they are English and amounts are formatted as `12.50` (source: pkg:src/composables/useLocale.ts:1687-1690; pkg:src/composables/useLocale.ts:1696-1699).",
|
|
2697
2796
|
"phone": "The keypad fills the width of a `max-w-sm` column; on a phone in portrait it takes most of the screen, which is right for a till. Keep the two payment buttons side by side under it, at full height of the thumb zone.",
|
|
2698
2797
|
"wide": "On a tablet in landscape put the product list or the cart on the left and this column on the right; the receipt dialog stays centered. Do not stretch the keypad wider than about 400 px: keys far apart are slower to hit.",
|
|
2699
2798
|
"pitfalls": "- The model is a string: convert it with `Number(value || 0)`, and treat `''` as no amount.\n- Enter on a keyboard can emit `submit` even when the amount does not cover `due` if no `actionLabel` / `actionDisabled` is set; with them, as above, it is blocked, but check in your handler anyway (source: pkg:src/components/MPosKeypad.vue:205-224).\n- `MReceipt` has no `locale` prop: its labels, money and date follow the app locale (see above).\n- Percentage adjustments apply one after another: a discount listed after the VAT line is computed on the amount with VAT (source: pkg:src/components/MReceipt.vue:87-96).\n- `print()` prints the receipt in its paper width (`paper`, default `80mm`); test it with the real printer driver, since browsers add their own margins.\n- A receipt shown on screen is not a fiscal receipt: in Poland a sale must also go through a fiscal printer or an online cash register."
|
|
@@ -2709,31 +2808,31 @@
|
|
|
2709
2808
|
"sources": [
|
|
2710
2809
|
{
|
|
2711
2810
|
"ref": "pkg:src/components/MPosKeypad.vue:205-224",
|
|
2712
|
-
"url": "https://github.com/
|
|
2811
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPosKeypad.vue#L205-L224"
|
|
2713
2812
|
},
|
|
2714
2813
|
{
|
|
2715
2814
|
"ref": "pkg:src/components/MReceipt.vue:3-27",
|
|
2716
|
-
"url": "https://github.com/
|
|
2815
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MReceipt.vue#L3-L27"
|
|
2717
2816
|
},
|
|
2718
2817
|
{
|
|
2719
2818
|
"ref": "pkg:src/components/MReceipt.vue:34",
|
|
2720
|
-
"url": "https://github.com/
|
|
2819
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MReceipt.vue#L34"
|
|
2721
2820
|
},
|
|
2722
2821
|
{
|
|
2723
2822
|
"ref": "pkg:src/components/MReceipt.vue:87-96",
|
|
2724
|
-
"url": "https://github.com/
|
|
2823
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MReceipt.vue#L87-L96"
|
|
2725
2824
|
},
|
|
2726
2825
|
{
|
|
2727
2826
|
"ref": "pkg:src/components/MReceipt.vue:125-134",
|
|
2728
|
-
"url": "https://github.com/
|
|
2827
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MReceipt.vue#L125-L134"
|
|
2729
2828
|
},
|
|
2730
2829
|
{
|
|
2731
|
-
"ref": "pkg:src/composables/useLocale.ts:
|
|
2732
|
-
"url": "https://github.com/
|
|
2830
|
+
"ref": "pkg:src/composables/useLocale.ts:1687-1690",
|
|
2831
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useLocale.ts#L1687-L1690"
|
|
2733
2832
|
},
|
|
2734
2833
|
{
|
|
2735
|
-
"ref": "pkg:src/composables/useLocale.ts:
|
|
2736
|
-
"url": "https://github.com/
|
|
2834
|
+
"ref": "pkg:src/composables/useLocale.ts:1696-1699",
|
|
2835
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useLocale.ts#L1696-L1699"
|
|
2737
2836
|
}
|
|
2738
2837
|
],
|
|
2739
2838
|
"verified": {
|
|
@@ -2800,47 +2899,47 @@
|
|
|
2800
2899
|
"sources": [
|
|
2801
2900
|
{
|
|
2802
2901
|
"ref": "pkg:src/components/MCard.vue:2-10",
|
|
2803
|
-
"url": "https://github.com/
|
|
2902
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCard.vue#L2-L10"
|
|
2804
2903
|
},
|
|
2805
2904
|
{
|
|
2806
2905
|
"ref": "pkg:src/components/MCard.vue:18-22",
|
|
2807
|
-
"url": "https://github.com/
|
|
2906
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCard.vue#L18-L22"
|
|
2808
2907
|
},
|
|
2809
2908
|
{
|
|
2810
2909
|
"ref": "pkg:src/components/MCard.vue:142-143",
|
|
2811
|
-
"url": "https://github.com/
|
|
2910
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCard.vue#L142-L143"
|
|
2812
2911
|
},
|
|
2813
2912
|
{
|
|
2814
2913
|
"ref": "pkg:src/components/MCard.vue:148-163",
|
|
2815
|
-
"url": "https://github.com/
|
|
2914
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCard.vue#L148-L163"
|
|
2816
2915
|
},
|
|
2817
2916
|
{
|
|
2818
2917
|
"ref": "pkg:src/components/MCard.vue:148-156",
|
|
2819
|
-
"url": "https://github.com/
|
|
2918
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCard.vue#L148-L156"
|
|
2820
2919
|
},
|
|
2821
2920
|
{
|
|
2822
2921
|
"ref": "pkg:src/components/MCard.vue:161-163",
|
|
2823
|
-
"url": "https://github.com/
|
|
2922
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MCard.vue#L161-L163"
|
|
2824
2923
|
},
|
|
2825
2924
|
{
|
|
2826
2925
|
"ref": "pkg:src/components/MChip.vue:124",
|
|
2827
|
-
"url": "https://github.com/
|
|
2926
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L124"
|
|
2828
2927
|
},
|
|
2829
2928
|
{
|
|
2830
2929
|
"ref": "pkg:src/components/MChip.vue:210",
|
|
2831
|
-
"url": "https://github.com/
|
|
2930
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L210"
|
|
2832
2931
|
},
|
|
2833
2932
|
{
|
|
2834
2933
|
"ref": "pkg:src/components/MRating.vue:26-27",
|
|
2835
|
-
"url": "https://github.com/
|
|
2934
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MRating.vue#L26-L27"
|
|
2836
2935
|
},
|
|
2837
2936
|
{
|
|
2838
2937
|
"ref": "pkg:src/components/MRating.vue:205",
|
|
2839
|
-
"url": "https://github.com/
|
|
2938
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MRating.vue#L205"
|
|
2840
2939
|
},
|
|
2841
2940
|
{
|
|
2842
2941
|
"ref": "pkg:src/components/MRating.vue:221-223",
|
|
2843
|
-
"url": "https://github.com/
|
|
2942
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MRating.vue#L221-L223"
|
|
2844
2943
|
}
|
|
2845
2944
|
],
|
|
2846
2945
|
"verified": {
|
|
@@ -2905,31 +3004,31 @@
|
|
|
2905
3004
|
"sources": [
|
|
2906
3005
|
{
|
|
2907
3006
|
"ref": "pkg:src/components/MAvatar.vue:3-60",
|
|
2908
|
-
"url": "https://github.com/
|
|
3007
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MAvatar.vue#L3-L60"
|
|
2909
3008
|
},
|
|
2910
3009
|
{
|
|
2911
3010
|
"ref": "pkg:src/components/MImageCropper.vue:2-14",
|
|
2912
|
-
"url": "https://github.com/
|
|
3011
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MImageCropper.vue#L2-L14"
|
|
2913
3012
|
},
|
|
2914
3013
|
{
|
|
2915
3014
|
"ref": "pkg:src/components/MImageCropper.vue:29-37",
|
|
2916
|
-
"url": "https://github.com/
|
|
3015
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MImageCropper.vue#L29-L37"
|
|
2917
3016
|
},
|
|
2918
3017
|
{
|
|
2919
3018
|
"ref": "pkg:src/components/MImageCropper.vue:386-390",
|
|
2920
|
-
"url": "https://github.com/
|
|
3019
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MImageCropper.vue#L386-L390"
|
|
2921
3020
|
},
|
|
2922
3021
|
{
|
|
2923
3022
|
"ref": "pkg:src/components/MImageCropper.vue:437",
|
|
2924
|
-
"url": "https://github.com/
|
|
3023
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MImageCropper.vue#L437"
|
|
2925
3024
|
},
|
|
2926
3025
|
{
|
|
2927
3026
|
"ref": "pkg:src/components/MForm.vue:2-37",
|
|
2928
|
-
"url": "https://github.com/
|
|
3027
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MForm.vue#L2-L37"
|
|
2929
3028
|
},
|
|
2930
3029
|
{
|
|
2931
3030
|
"ref": "pkg:src/components/MTextField.vue:250-287",
|
|
2932
|
-
"url": "https://github.com/
|
|
3031
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTextField.vue#L250-L287"
|
|
2933
3032
|
}
|
|
2934
3033
|
],
|
|
2935
3034
|
"verified": {
|
|
@@ -2997,23 +3096,23 @@
|
|
|
2997
3096
|
"sources": [
|
|
2998
3097
|
{
|
|
2999
3098
|
"ref": "pkg:src/components/MSearchField.vue:2-14",
|
|
3000
|
-
"url": "https://github.com/
|
|
3099
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchField.vue#L2-L14"
|
|
3001
3100
|
},
|
|
3002
3101
|
{
|
|
3003
3102
|
"ref": "pkg:src/components/MSearchField.vue:71",
|
|
3004
|
-
"url": "https://github.com/
|
|
3103
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchField.vue#L71"
|
|
3005
3104
|
},
|
|
3006
3105
|
{
|
|
3007
3106
|
"ref": "pkg:src/components/MSearchField.vue:105-107",
|
|
3008
|
-
"url": "https://github.com/
|
|
3107
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchField.vue#L105-L107"
|
|
3009
3108
|
},
|
|
3010
3109
|
{
|
|
3011
3110
|
"ref": "pkg:src/components/MChip.vue:210",
|
|
3012
|
-
"url": "https://github.com/
|
|
3111
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MChip.vue#L210"
|
|
3013
3112
|
},
|
|
3014
3113
|
{
|
|
3015
3114
|
"ref": "pkg:src/components/MPagination.vue:32-40",
|
|
3016
|
-
"url": "https://github.com/
|
|
3115
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPagination.vue#L32-L40"
|
|
3017
3116
|
}
|
|
3018
3117
|
],
|
|
3019
3118
|
"verified": {
|
|
@@ -3110,47 +3209,47 @@
|
|
|
3110
3209
|
},
|
|
3111
3210
|
{
|
|
3112
3211
|
"ref": "pkg:src/components/MList.vue:15-42",
|
|
3113
|
-
"url": "https://github.com/
|
|
3212
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MList.vue#L15-L42"
|
|
3114
3213
|
},
|
|
3115
3214
|
{
|
|
3116
3215
|
"ref": "pkg:src/components/MListItem.vue:2-17",
|
|
3117
|
-
"url": "https://github.com/
|
|
3216
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L2-L17"
|
|
3118
3217
|
},
|
|
3119
3218
|
{
|
|
3120
3219
|
"ref": "pkg:src/components/MListItem.vue:335-364",
|
|
3121
|
-
"url": "https://github.com/
|
|
3220
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L335-L364"
|
|
3122
3221
|
},
|
|
3123
3222
|
{
|
|
3124
3223
|
"ref": "pkg:src/components/MListItem.vue:537-549",
|
|
3125
|
-
"url": "https://github.com/
|
|
3224
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L537-L549"
|
|
3126
3225
|
},
|
|
3127
3226
|
{
|
|
3128
3227
|
"ref": "pkg:src/components/MSwitch.vue:248-280",
|
|
3129
|
-
"url": "https://github.com/
|
|
3228
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSwitch.vue#L248-L280"
|
|
3130
3229
|
},
|
|
3131
3230
|
{
|
|
3132
3231
|
"ref": "pkg:src/components/MListGroup.vue:2-9",
|
|
3133
|
-
"url": "https://github.com/
|
|
3232
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListGroup.vue#L2-L9"
|
|
3134
3233
|
},
|
|
3135
3234
|
{
|
|
3136
3235
|
"ref": "pkg:src/components/MSwitch.vue:248-251",
|
|
3137
|
-
"url": "https://github.com/
|
|
3236
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSwitch.vue#L248-L251"
|
|
3138
3237
|
},
|
|
3139
3238
|
{
|
|
3140
3239
|
"ref": "pkg:src/components/MSegmentedButton.vue:11-31",
|
|
3141
|
-
"url": "https://github.com/
|
|
3240
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSegmentedButton.vue#L11-L31"
|
|
3142
3241
|
},
|
|
3143
3242
|
{
|
|
3144
3243
|
"ref": "pkg:src/components/MSegmentedButton.vue:53-83",
|
|
3145
|
-
"url": "https://github.com/
|
|
3244
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSegmentedButton.vue#L53-L83"
|
|
3146
3245
|
},
|
|
3147
3246
|
{
|
|
3148
3247
|
"ref": "pkg:src/components/MSelect.vue:32-74",
|
|
3149
|
-
"url": "https://github.com/
|
|
3248
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSelect.vue#L32-L74"
|
|
3150
3249
|
},
|
|
3151
3250
|
{
|
|
3152
3251
|
"ref": "pkg:src/components/MSection.vue:2-12",
|
|
3153
|
-
"url": "https://github.com/
|
|
3252
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSection.vue#L2-L12"
|
|
3154
3253
|
}
|
|
3155
3254
|
],
|
|
3156
3255
|
"verified": {
|
|
@@ -3191,12 +3290,12 @@
|
|
|
3191
3290
|
],
|
|
3192
3291
|
"sections": {
|
|
3193
3292
|
"when": "Use a snackbar for short feedback that does not block work: \"Zapisano\", \"Usunięto pozycję\" with \"Cofnij\", \"Brak połączenia, skan czeka w kolejce\". A destructive action that can be reversed should run at once and offer Undo, not ask first (see the `confirm-destructive-action` recipe for the irreversible case).\n\nDo not use it for an error the user must act on (a field error belongs under the field, a blocking problem in an `MAlert` or a dialog), and not for long text: a toast is one line.",
|
|
3194
|
-
"components": "- `useToast()` (Nuxt: `useM3Toast()`): `show`, `success`, `error`, `warning`, `info`, `loading`, `update`, `dismiss`; `toasts` and `position` are shared refs. The renderer, `MSnackbar`, is mounted for you in its own app on the first call: do not place it in a template (source: pkg:src/composables/useToast.ts:34-41; pkg:src/composables/useToast.ts:131-133).\n- Options: `duration` (ms, `0` means until dismissed), `action: { label, onClick }`, `icon` (a Material Symbol, or `null` for none), `color`, `loading` (source: pkg:src/composables/useToast.ts:49-57).\n- Defaults: 4000 ms, 6000 ms for `error`; a `loading` toast stays until updated or dismissed (source: pkg:src/composables/useToast.ts:87).\n- Pressing the action runs `onClick` and then dismisses the toast (source: pkg:src/components/MSnackbar.vue:130-142).\n- Since 1.10.0 the library has this pattern built in: `useUndo()` runs an action, shows the \"Undo\" snackbar, keeps undo and redo history, binds Ctrl/Cmd+Z and has a `commit` step for the server call that must wait until Undo is no longer offered (see the `useUndo` card; with `MScaffold` pass `notify` so its FAB makes room). The `useUndoable` helper below shows how the same thing is built from `useToast` alone, which is enough for a single level of undo (source: pkg:src/composables/useUndo.ts:5-35; lib@
|
|
3293
|
+
"components": "- `useToast()` (Nuxt: `useM3Toast()`): `show`, `success`, `error`, `warning`, `info`, `loading`, `update`, `dismiss`; `toasts` and `position` are shared refs. The renderer, `MSnackbar`, is mounted for you in its own app on the first call: do not place it in a template (source: pkg:src/composables/useToast.ts:34-41; pkg:src/composables/useToast.ts:131-133).\n- Options: `duration` (ms, `0` means until dismissed), `action: { label, onClick }`, `icon` (a Material Symbol, or `null` for none), `color`, `loading` (source: pkg:src/composables/useToast.ts:49-57).\n- Defaults: 4000 ms, 6000 ms for `error`; a `loading` toast stays until updated or dismissed (source: pkg:src/composables/useToast.ts:87).\n- Pressing the action runs `onClick` and then dismisses the toast (source: pkg:src/components/MSnackbar.vue:130-142).\n- Since 1.10.0 the library has this pattern built in: `useUndo()` runs an action, shows the \"Undo\" snackbar, keeps undo and redo history, binds Ctrl/Cmd+Z and has a `commit` step for the server call that must wait until Undo is no longer offered (see the `useUndo` card; with `MScaffold` pass `notify` so its FAB makes room). The `useUndoable` helper below shows how the same thing is built from `useToast` alone, which is enough for a single level of undo (source: pkg:src/composables/useUndo.ts:5-35; lib@ed784d6:CHANGELOG.md:105).",
|
|
3195
3294
|
"guideline": "A snackbar shows a brief message about a process the app has performed or will perform, offers at most one action and disappears by itself, so it must never carry information that is needed later (source: https://m3.material.io/components/snackbar/overview; https://m3.material.io/components/snackbar/guidelines). Give the user enough time to read and to press the action: the longer the text, the longer the duration. M3UI implements the single action and the timer, and since 1.11.0 a limit on toasts on screen (`max`); it does not announce the message (see Pitfalls).",
|
|
3196
3295
|
"code": "### Undo for a removed list item (Nuxt)\n\n```ts\n// app/composables/useUndoable.ts\nexport interface UndoableOptions {\n message: string\n /** Immediately: removes the item from the view (optimistically). */\n apply: () => void\n /** Revert: restores the item to the view. */\n revert: () => void\n /** After the undo window expires: the actual write to the server. */\n commit: () => Promise<void>\n}\n\nconst UNDO_MS = 6000\n\nexport function useUndoable() {\n const toast = useM3Toast()\n const waiting = new Set<() => Promise<void>>()\n\n function run(options: UndoableOptions) {\n options.apply()\n let done = false\n let timer: ReturnType<typeof setTimeout> | undefined\n\n const finish = async () => {\n if (done) return\n done = true\n clearTimeout(timer)\n waiting.delete(finish)\n try {\n await options.commit()\n }\n catch {\n options.revert()\n toast.error('Nie udało się zapisać zmiany. Pozycja wróciła na listę.')\n }\n }\n waiting.add(finish)\n\n toast.info(options.message, {\n duration: UNDO_MS,\n icon: 'delete',\n action: {\n label: 'Cofnij',\n onClick: () => {\n if (done) return\n done = true\n clearTimeout(timer)\n waiting.delete(finish)\n options.revert()\n }\n }\n })\n timer = setTimeout(finish, UNDO_MS)\n }\n\n // Leaving the screen during the undo window commits what is waiting.\n onScopeDispose(() => {\n for (const finish of [...waiting]) void finish()\n })\n\n return { run }\n}\n```\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\ninterface Item { id: string, name: string, quantity: number }\n\nconst items = ref<Item[]>([\n { id: 'a', name: 'Karton 30x20x10', quantity: 12 },\n { id: 'b', name: 'Taśma pakowa 48 mm', quantity: 40 }\n])\nconst { run } = useUndoable()\n\nfunction remove(item: Item) {\n const index = items.value.findIndex(entry => entry.id === item.id)\n run({\n message: `Usunięto: ${item.name}`,\n apply: () => items.value.splice(index, 1),\n revert: () => items.value.splice(Math.min(index, items.value.length), 0, item),\n commit: async () => { await $fetch(`/api/items/${item.id}`, { method: 'DELETE' }) }\n })\n}\n</script>\n\n<template>\n <MList :dividers=\"true\">\n <MListItem\n v-for=\"item in items\"\n :key=\"item.id\"\n :title=\"item.name\"\n :trailing-text=\"`${item.quantity} szt.`\"\n >\n <template #trailing>\n <MButton variant=\"text\" color=\"error\" icon=\"delete\" @click=\"remove(item)\">Usuń</MButton>\n </template>\n </MListItem>\n </MList>\n</template>\n```\n\n### A toast that follows a request: loading, then success or error (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\nconst toast = useM3Toast()\nconst sending = ref(false)\n\nasync function sendParcel() {\n sending.value = true\n const id = toast.loading('Wysyłam paczkę…')\n try {\n await $fetch('/api/parcels/send', { method: 'POST' })\n // update() with loading: false starts the close timer (4000 ms, or the duration prop if set).\n toast.update(id, { loading: false, variant: 'success', message: 'Paczka wysłana', icon: 'check_circle' })\n }\n catch {\n toast.update(id, { loading: false, variant: 'error', message: 'Nie udało się wysłać paczki', icon: 'error', duration: 6000 })\n }\n finally {\n sending.value = false\n }\n}\n</script>\n\n<template>\n <MButton :loading=\"sending\" icon=\"local_shipping\" @click=\"sendParcel\">Wyślij paczkę</MButton>\n</template>\n```\n\n### Position, and an announcement for screen readers (Nuxt)\n\n```vue\n<!-- nuxt -->\n<script setup lang=\"ts\">\n// App layout: a toast above the phone's bottom navigation does not fit, so we move it to the top.\nconst { position, toasts } = useM3Toast()\nposition.value = 'top-center'\n\n// MSnackbar has no aria-live region: mirror the text for screen readers.\nconst announcement = computed(() => toasts.value.at(-1)?.message ?? '')\n</script>\n\n<template>\n <div class=\"sr-only\" role=\"status\" aria-live=\"polite\">{{ announcement }}</div>\n</template>\n```\n\n### Plain Vue\n\n```vue\n<script setup lang=\"ts\">\nimport { MButton, useToast } from '@m3ui-vue/m3ui-vue'\n\nconst toast = useToast()\n\nfunction archive() {\n toast.success('Zarchiwizowano zamówienie', {\n action: { label: 'Cofnij', onClick: () => toast.info('Przywrócono zamówienie') }\n })\n}\n</script>\n\n<template>\n <MButton variant=\"tonal\" @click=\"archive\">Archiwizuj</MButton>\n</template>\n```",
|
|
3197
3296
|
"phone": "The container is fixed at `bottom-4` and centered by default (`bottom-center`), each toast between 16 rem and 20 rem wide (`min-w-64 max-w-xs`) (source: pkg:src/components/MSnackbar.vue:23-39; pkg:src/components/MSnackbar.vue:97). On a phone it therefore sits over the bottom navigation bar and the FAB. When a screen has a bottom navigation bar or FAB, move toasts to the top with `position.value = 'top-center'`, or keep them at the bottom only on screens without a bottom bar. Keep the message under about 40 characters, in the imperative or the past tense (\"Usunięto 3 pozycje\").",
|
|
3198
3297
|
"wide": "On a wide window the default bottom-center position is fine, or use `bottom-left`/`bottom-right` so a toast does not cover the middle of a table. A toast can stay a little longer there (6000 to 8000 ms) because the user is usually watching the screen. Do not put a keyboard-only action in it: the action is a button reachable by Tab, but the toast disappears by itself, so an important choice belongs in a dialog.",
|
|
3199
|
-
"pitfalls": "- The toast has no live region: `MSnackbar` renders no `role=\"status\"` or `aria-live` (inferred from source: pkg:src/components/MSnackbar.vue:94-143). Screen reader users hear nothing. Mirror the text into a visually hidden `aria-live` region as in the third example.\n- The timer of a toast and your own commit timer are independent. Keep both equal and cancel your own timer in `onClick`, otherwise Undo restores the item and a later commit still deletes it.\n- Identical toasts without an action and without `loading` are merged into one with a counter badge, which restarts the timer (source: pkg:src/composables/useToast.ts:71-84). Toasts with an action are never merged, so ten quick deletions give ten stacked toasts unless you set `max` (since 1.11.0: `useToast().max.value = 3` dismisses the oldest non-loading toast). Better still, collapse them yourself: dismiss the previous id and show \"Usunięto 3 pozycje\" (source: pkg:src/composables/useToast.ts:31-32; pkg:src/composables/useToast.ts:94-105).\n- `update(id, { loading: false })` restarts the timer with `patch.duration ?? 4000`; set `duration` in the patch if the final message needs another time (source: pkg:src/composables/useToast.ts:107-120).\n- `toasts` and `position` are module-level refs. In Nuxt SSR, `position.value = 'top-center'` in a layout's `setup` runs on the server too and changes the value for every later request in that process, Since 1.11.0 a `toast.*()` call during server rendering does nothing and returns `-1`. Set the position in a client-only place (`onMounted`, a plugin with `.client`) and call the toast functions from event handlers or client code (source: pkg:src/composables/useToast.ts:25-41; pkg:src/composables/useToast.ts:63-66).\n- `position` is one shared ref for all toasts, not per call (source: pkg:src/composables/useToast.ts:30).\n- Since 1.11.0 a toast can have a second line: `description` in the options makes the message read as a title; the icon is set or hidden with `icon` (`null` hides it) (source: pkg:src/composables/useToast.ts:9; pkg:src/composables/useToast.ts:49-57).\n- Every variant uses theme roles since 1.11.0 (`success-container`, `warning-container`, `error-container`, `secondary-container` for `info`), so all follow a custom palette and dark mode (source: pkg:src/components/MSnackbar.vue:50-87).\n- `useToast` creates a second Vue app for `MSnackbar`. The plugin stores the locale for it (source: pkg:src/composables/useLocale.ts:
|
|
3298
|
+
"pitfalls": "- The toast has no live region: `MSnackbar` renders no `role=\"status\"` or `aria-live` (inferred from source: pkg:src/components/MSnackbar.vue:94-143). Screen reader users hear nothing. Mirror the text into a visually hidden `aria-live` region as in the third example.\n- The timer of a toast and your own commit timer are independent. Keep both equal and cancel your own timer in `onClick`, otherwise Undo restores the item and a later commit still deletes it.\n- Identical toasts without an action and without `loading` are merged into one with a counter badge, which restarts the timer (source: pkg:src/composables/useToast.ts:71-84). Toasts with an action are never merged, so ten quick deletions give ten stacked toasts unless you set `max` (since 1.11.0: `useToast().max.value = 3` dismisses the oldest non-loading toast). Better still, collapse them yourself: dismiss the previous id and show \"Usunięto 3 pozycje\" (source: pkg:src/composables/useToast.ts:31-32; pkg:src/composables/useToast.ts:94-105).\n- `update(id, { loading: false })` restarts the timer with `patch.duration ?? 4000`; set `duration` in the patch if the final message needs another time (source: pkg:src/composables/useToast.ts:107-120).\n- `toasts` and `position` are module-level refs. In Nuxt SSR, `position.value = 'top-center'` in a layout's `setup` runs on the server too and changes the value for every later request in that process, Since 1.11.0 a `toast.*()` call during server rendering does nothing and returns `-1`. Set the position in a client-only place (`onMounted`, a plugin with `.client`) and call the toast functions from event handlers or client code (source: pkg:src/composables/useToast.ts:25-41; pkg:src/composables/useToast.ts:63-66).\n- `position` is one shared ref for all toasts, not per call (source: pkg:src/composables/useToast.ts:30).\n- Since 1.11.0 a toast can have a second line: `description` in the options makes the message read as a title; the icon is set or hidden with `icon` (`null` hides it) (source: pkg:src/composables/useToast.ts:9; pkg:src/composables/useToast.ts:49-57).\n- Every variant uses theme roles since 1.11.0 (`success-container`, `warning-container`, `error-container`, `secondary-container` for `info`), so all follow a custom palette and dark mode (source: pkg:src/components/MSnackbar.vue:50-87).\n- `useToast` creates a second Vue app for `MSnackbar`. The plugin stores the locale for it (source: pkg:src/composables/useLocale.ts:1318-1332); in a test without `createM3UI` the close button label stays in English (inferred from source: pkg:src/composables/useLocale.ts:1318-1332)."
|
|
3200
3299
|
},
|
|
3201
3300
|
"examples": [
|
|
3202
3301
|
{
|
|
@@ -3232,12 +3331,12 @@
|
|
|
3232
3331
|
],
|
|
3233
3332
|
"sources": [
|
|
3234
3333
|
{
|
|
3235
|
-
"ref": "lib@
|
|
3236
|
-
"url": "https://github.com/
|
|
3334
|
+
"ref": "lib@ed784d6:CHANGELOG.md:105",
|
|
3335
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/CHANGELOG.md#L105"
|
|
3237
3336
|
},
|
|
3238
3337
|
{
|
|
3239
3338
|
"ref": "pkg:src/composables/useUndo.ts",
|
|
3240
|
-
"url": "https://github.com/
|
|
3339
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useUndo.ts"
|
|
3241
3340
|
},
|
|
3242
3341
|
{
|
|
3243
3342
|
"ref": "https://m3.material.io/components/snackbar/overview",
|
|
@@ -3249,67 +3348,67 @@
|
|
|
3249
3348
|
},
|
|
3250
3349
|
{
|
|
3251
3350
|
"ref": "pkg:src/composables/useToast.ts:25-41",
|
|
3252
|
-
"url": "https://github.com/
|
|
3351
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L25-L41"
|
|
3253
3352
|
},
|
|
3254
3353
|
{
|
|
3255
3354
|
"ref": "pkg:src/composables/useToast.ts:59-92",
|
|
3256
|
-
"url": "https://github.com/
|
|
3355
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L59-L92"
|
|
3257
3356
|
},
|
|
3258
3357
|
{
|
|
3259
3358
|
"ref": "pkg:src/composables/useToast.ts:107-124",
|
|
3260
|
-
"url": "https://github.com/
|
|
3359
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L107-L124"
|
|
3261
3360
|
},
|
|
3262
3361
|
{
|
|
3263
3362
|
"ref": "pkg:src/components/MSnackbar.vue:23-39",
|
|
3264
|
-
"url": "https://github.com/
|
|
3363
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L23-L39"
|
|
3265
3364
|
},
|
|
3266
3365
|
{
|
|
3267
3366
|
"ref": "pkg:src/components/MSnackbar.vue:94-143",
|
|
3268
|
-
"url": "https://github.com/
|
|
3367
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L94-L143"
|
|
3269
3368
|
},
|
|
3270
3369
|
{
|
|
3271
3370
|
"ref": "pkg:src/components/MSnackbar.vue:61-78",
|
|
3272
|
-
"url": "https://github.com/
|
|
3371
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L61-L78"
|
|
3273
3372
|
},
|
|
3274
3373
|
{
|
|
3275
3374
|
"ref": "pkg:src/components/MSnackbar.vue:130-142",
|
|
3276
|
-
"url": "https://github.com/
|
|
3375
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L130-L142"
|
|
3277
3376
|
},
|
|
3278
3377
|
{
|
|
3279
3378
|
"ref": "pkg:src/composables/useToast.ts:30",
|
|
3280
|
-
"url": "https://github.com/
|
|
3379
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L30"
|
|
3281
3380
|
},
|
|
3282
3381
|
{
|
|
3283
3382
|
"ref": "pkg:src/composables/useToast.ts:34-41",
|
|
3284
|
-
"url": "https://github.com/
|
|
3383
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L34-L41"
|
|
3285
3384
|
},
|
|
3286
3385
|
{
|
|
3287
3386
|
"ref": "pkg:src/composables/useToast.ts:49-57",
|
|
3288
|
-
"url": "https://github.com/
|
|
3387
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L49-L57"
|
|
3289
3388
|
},
|
|
3290
3389
|
{
|
|
3291
3390
|
"ref": "pkg:src/composables/useToast.ts:71-84",
|
|
3292
|
-
"url": "https://github.com/
|
|
3391
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L71-L84"
|
|
3293
3392
|
},
|
|
3294
3393
|
{
|
|
3295
3394
|
"ref": "pkg:src/composables/useToast.ts:87",
|
|
3296
|
-
"url": "https://github.com/
|
|
3395
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L87"
|
|
3297
3396
|
},
|
|
3298
3397
|
{
|
|
3299
3398
|
"ref": "pkg:src/composables/useToast.ts:107-120",
|
|
3300
|
-
"url": "https://github.com/
|
|
3399
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L107-L120"
|
|
3301
3400
|
},
|
|
3302
3401
|
{
|
|
3303
3402
|
"ref": "pkg:src/composables/useToast.ts:131-133",
|
|
3304
|
-
"url": "https://github.com/
|
|
3403
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L131-L133"
|
|
3305
3404
|
},
|
|
3306
3405
|
{
|
|
3307
3406
|
"ref": "pkg:src/components/MSnackbar.vue:97",
|
|
3308
|
-
"url": "https://github.com/
|
|
3407
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L97"
|
|
3309
3408
|
},
|
|
3310
3409
|
{
|
|
3311
|
-
"ref": "pkg:src/composables/useLocale.ts:
|
|
3312
|
-
"url": "https://github.com/
|
|
3410
|
+
"ref": "pkg:src/composables/useLocale.ts:1854-1925",
|
|
3411
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useLocale.ts#L1854-L1925"
|
|
3313
3412
|
}
|
|
3314
3413
|
],
|
|
3315
3414
|
"verified": {
|
|
@@ -3373,27 +3472,27 @@
|
|
|
3373
3472
|
"sources": [
|
|
3374
3473
|
{
|
|
3375
3474
|
"ref": "pkg:src/components/MMap.vue:2-10",
|
|
3376
|
-
"url": "https://github.com/
|
|
3475
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMap.vue#L2-L10"
|
|
3377
3476
|
},
|
|
3378
3477
|
{
|
|
3379
3478
|
"ref": "pkg:src/components/MMap.vue:345-359",
|
|
3380
|
-
"url": "https://github.com/
|
|
3479
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMap.vue#L345-L359"
|
|
3381
3480
|
},
|
|
3382
3481
|
{
|
|
3383
3482
|
"ref": "pkg:src/components/MMap.vue:374-378",
|
|
3384
|
-
"url": "https://github.com/
|
|
3483
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMap.vue#L374-L378"
|
|
3385
3484
|
},
|
|
3386
3485
|
{
|
|
3387
3486
|
"ref": "pkg:src/components/MMapMarker.vue:3-8",
|
|
3388
|
-
"url": "https://github.com/
|
|
3487
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMapMarker.vue#L3-L8"
|
|
3389
3488
|
},
|
|
3390
3489
|
{
|
|
3391
3490
|
"ref": "pkg:src/components/MMapMarker.vue:71-74",
|
|
3392
|
-
"url": "https://github.com/
|
|
3491
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMapMarker.vue#L71-L74"
|
|
3393
3492
|
},
|
|
3394
3493
|
{
|
|
3395
3494
|
"ref": "pkg:src/components/MMapMarker.vue:93-96",
|
|
3396
|
-
"url": "https://github.com/
|
|
3495
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MMapMarker.vue#L93-L96"
|
|
3397
3496
|
},
|
|
3398
3497
|
{
|
|
3399
3498
|
"ref": "nuxt:dist/module.mjs:73-88",
|
|
@@ -3462,39 +3561,39 @@
|
|
|
3462
3561
|
"sources": [
|
|
3463
3562
|
{
|
|
3464
3563
|
"ref": "pkg:src/components/MSwipeToDismiss.vue:5-6",
|
|
3465
|
-
"url": "https://github.com/
|
|
3564
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSwipeToDismiss.vue#L5-L6"
|
|
3466
3565
|
},
|
|
3467
3566
|
{
|
|
3468
3567
|
"ref": "pkg:src/components/MSwipeToDismiss.vue:96",
|
|
3469
|
-
"url": "https://github.com/
|
|
3568
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSwipeToDismiss.vue#L96"
|
|
3470
3569
|
},
|
|
3471
3570
|
{
|
|
3472
3571
|
"ref": "pkg:src/components/MSwipeToDismiss.vue:240-245",
|
|
3473
|
-
"url": "https://github.com/
|
|
3572
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSwipeToDismiss.vue#L240-L245"
|
|
3474
3573
|
},
|
|
3475
3574
|
{
|
|
3476
3575
|
"ref": "pkg:src/components/MListItem.vue:122",
|
|
3477
|
-
"url": "https://github.com/
|
|
3576
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L122"
|
|
3478
3577
|
},
|
|
3479
3578
|
{
|
|
3480
3579
|
"ref": "pkg:src/components/MListItem.vue:305-309",
|
|
3481
|
-
"url": "https://github.com/
|
|
3580
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MListItem.vue#L305-L309"
|
|
3482
3581
|
},
|
|
3483
3582
|
{
|
|
3484
3583
|
"ref": "pkg:src/components/MPullToRefresh.vue:291-311",
|
|
3485
|
-
"url": "https://github.com/
|
|
3584
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MPullToRefresh.vue#L291-L311"
|
|
3486
3585
|
},
|
|
3487
3586
|
{
|
|
3488
3587
|
"ref": "pkg:src/composables/useToast.ts:49-57",
|
|
3489
|
-
"url": "https://github.com/
|
|
3588
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useToast.ts#L49-L57"
|
|
3490
3589
|
},
|
|
3491
3590
|
{
|
|
3492
3591
|
"ref": "pkg:src/components/MSnackbar.vue:131-143",
|
|
3493
|
-
"url": "https://github.com/
|
|
3592
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSnackbar.vue#L131-L143"
|
|
3494
3593
|
},
|
|
3495
3594
|
{
|
|
3496
3595
|
"ref": "pkg:src/composables/_useSegmentRuns.ts:1-26",
|
|
3497
|
-
"url": "https://github.com/
|
|
3596
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_useSegmentRuns.ts#L1-L26"
|
|
3498
3597
|
}
|
|
3499
3598
|
],
|
|
3500
3599
|
"verified": {
|
|
@@ -3598,39 +3697,39 @@
|
|
|
3598
3697
|
},
|
|
3599
3698
|
{
|
|
3600
3699
|
"ref": "pkg:src/composables/useTheme.ts:6-81",
|
|
3601
|
-
"url": "https://github.com/
|
|
3700
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useTheme.ts#L6-L81"
|
|
3602
3701
|
},
|
|
3603
3702
|
{
|
|
3604
3703
|
"ref": "pkg:src/composables/_themeTransition.ts:41-47",
|
|
3605
|
-
"url": "https://github.com/
|
|
3704
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/_themeTransition.ts#L41-L47"
|
|
3606
3705
|
},
|
|
3607
3706
|
{
|
|
3608
3707
|
"ref": "pkg:src/composables/useColorPalette.ts:105-136",
|
|
3609
|
-
"url": "https://github.com/
|
|
3708
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useColorPalette.ts#L105-L136"
|
|
3610
3709
|
},
|
|
3611
3710
|
{
|
|
3612
3711
|
"ref": "pkg:src/composables/useColorPalette.ts:217-242",
|
|
3613
|
-
"url": "https://github.com/
|
|
3712
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useColorPalette.ts#L217-L242"
|
|
3614
3713
|
},
|
|
3615
3714
|
{
|
|
3616
3715
|
"ref": "pkg:src/composables/useColorPalette.ts:269-319",
|
|
3617
|
-
"url": "https://github.com/
|
|
3716
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useColorPalette.ts#L269-L319"
|
|
3618
3717
|
},
|
|
3619
3718
|
{
|
|
3620
3719
|
"ref": "pkg:src/plugin.ts:41-71",
|
|
3621
|
-
"url": "https://github.com/
|
|
3720
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/plugin.ts#L41-L71"
|
|
3622
3721
|
},
|
|
3623
3722
|
{
|
|
3624
3723
|
"ref": "pkg:src/components/MSegmentedButton.vue:53-83",
|
|
3625
|
-
"url": "https://github.com/
|
|
3724
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSegmentedButton.vue#L53-L83"
|
|
3626
3725
|
},
|
|
3627
3726
|
{
|
|
3628
3727
|
"ref": "pkg:src/components/MColorPicker.vue:199",
|
|
3629
|
-
"url": "https://github.com/
|
|
3728
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MColorPicker.vue#L199"
|
|
3630
3729
|
},
|
|
3631
3730
|
{
|
|
3632
3731
|
"ref": "pkg:package.json:100-101",
|
|
3633
|
-
"url": "https://github.com/
|
|
3732
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/package.json#L100-L101"
|
|
3634
3733
|
},
|
|
3635
3734
|
{
|
|
3636
3735
|
"ref": "nuxt:dist/module.d.mts:24-60",
|
|
@@ -3730,31 +3829,31 @@
|
|
|
3730
3829
|
},
|
|
3731
3830
|
{
|
|
3732
3831
|
"ref": "pkg:src/components/MAppBarWithSearch.vue:2-16",
|
|
3733
|
-
"url": "https://github.com/
|
|
3832
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MAppBarWithSearch.vue#L2-L16"
|
|
3734
3833
|
},
|
|
3735
3834
|
{
|
|
3736
3835
|
"ref": "pkg:src/components/MAppBarWithSearch.vue:18-68",
|
|
3737
|
-
"url": "https://github.com/
|
|
3836
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MAppBarWithSearch.vue#L18-L68"
|
|
3738
3837
|
},
|
|
3739
3838
|
{
|
|
3740
3839
|
"ref": "pkg:src/components/MSearchBar.vue:105-155",
|
|
3741
|
-
"url": "https://github.com/
|
|
3840
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchBar.vue#L105-L155"
|
|
3742
3841
|
},
|
|
3743
3842
|
{
|
|
3744
3843
|
"ref": "pkg:src/components/MSearchBar.vue:181-185",
|
|
3745
|
-
"url": "https://github.com/
|
|
3844
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MSearchBar.vue#L181-L185"
|
|
3746
3845
|
},
|
|
3747
3846
|
{
|
|
3748
3847
|
"ref": "pkg:src/components/MTopAppBar.vue:2-14",
|
|
3749
|
-
"url": "https://github.com/
|
|
3848
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTopAppBar.vue#L2-L14"
|
|
3750
3849
|
},
|
|
3751
3850
|
{
|
|
3752
3851
|
"ref": "pkg:src/components/MTopAppBar.vue:34-60",
|
|
3753
|
-
"url": "https://github.com/
|
|
3852
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/components/MTopAppBar.vue#L34-L60"
|
|
3754
3853
|
},
|
|
3755
3854
|
{
|
|
3756
3855
|
"ref": "pkg:src/composables/useDebounce.ts:3-24",
|
|
3757
|
-
"url": "https://github.com/
|
|
3856
|
+
"url": "https://github.com/m3ui-vue/m3ui-vue/blob/ed784d6475d4475a9ddab48da9f76a48c441993c/src/composables/useDebounce.ts#L3-L24"
|
|
3758
3857
|
}
|
|
3759
3858
|
],
|
|
3760
3859
|
"verified": {
|