@m3ui-vue/m3ui-vue 1.4.0 → 1.4.1
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/dist/API.md +45 -3
- package/dist/api.json +1 -1
- package/dist/components/MCountdown.vue.d.ts +80 -0
- package/dist/index.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +3318 -3167
- package/dist/m3ui.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/__tests__/MCountdown.test.ts +75 -0
- package/src/__tests__/clearToNull.test.ts +30 -0
- package/src/components/MAutocomplete.vue +2 -2
- package/src/components/MCountdown.vue +200 -0
- package/src/components/MSelect.vue +2 -2
- package/src/index.ts +2 -0
package/dist/API.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @m3ui-vue/m3ui-vue 1.4.
|
|
1
|
+
# @m3ui-vue/m3ui-vue 1.4.1 — API reference
|
|
2
2
|
|
|
3
3
|
Material Design 3 components for Vue 3 + Tailwind CSS v4. Generated from the source by
|
|
4
4
|
`scripts/generate-api.mjs`; full docs with live demos at https://m3ui.dev.
|
|
@@ -232,7 +232,7 @@ Props:
|
|
|
232
232
|
- `debounce?: number = 0` — Delay (ms) before filtering and firing @debounced. Selection is always instant
|
|
233
233
|
|
|
234
234
|
Events:
|
|
235
|
-
- `update:modelValue(unknown)` — Emitted on selection — powers v-model
|
|
235
|
+
- `update:modelValue(unknown)` — Emitted on selection — powers v-model (`null` when the clear button empties it)
|
|
236
236
|
- `debounced(string)` — Emitted debounce ms after the user stops typing the search query (only when debounce > 0)
|
|
237
237
|
|
|
238
238
|
### MAvailabilityCalendar
|
|
@@ -1020,6 +1020,48 @@ Events:
|
|
|
1020
1020
|
- `error(unknown)` — Emitted if the browser refuses the clipboard write
|
|
1021
1021
|
- `copied(string)` — Emitted with the copied value after a successful clipboard write
|
|
1022
1022
|
|
|
1023
|
+
### MCountdown
|
|
1024
|
+
|
|
1025
|
+
MCountdown — a countdown to a date: days, hours, minutes and seconds with rolling digits, in boxes or inline. Unit names come from `Intl` in the app's language. Units left out of `units` fold into the next larger one shown (no `days` → 50 hours). Ticks on the second boundary; every tick costs one timer, not one per digit.
|
|
1026
|
+
|
|
1027
|
+
Props:
|
|
1028
|
+
- `to: string | number | Date` — The moment it counts down to: a `Date`, a timestamp in ms, or a date string
|
|
1029
|
+
- `units?: CountdownUnit[] = ["days", "hours", "minutes", "seconds"]` — Units shown, largest first; leaving one out folds it into the next larger one
|
|
1030
|
+
- `variant?: "inline" | "boxes" = "boxes"` — `boxes`: each unit in its own container with its name below; `inline`: one line of text (3d 04h 12m)
|
|
1031
|
+
- `size?: "sm" | "md" | "lg" = "md"` — Digit size
|
|
1032
|
+
- `labels?: boolean = true` — Show unit names
|
|
1033
|
+
- `hideEmpty?: boolean = false` — Hide leading units while they're zero (no "0 days" a few hours before)
|
|
1034
|
+
- `animate?: boolean = true` — Roll the digits; false (or the system's reduced motion) swaps them
|
|
1035
|
+
- `locale?: string` — BCP-47 language for the unit names; defaults to the app's locale
|
|
1036
|
+
|
|
1037
|
+
Events:
|
|
1038
|
+
- `finished()` — Emitted once when the countdown reaches zero (not on mount if `to` is already past)
|
|
1039
|
+
- `tick(CountdownParts)` — Emitted every second with the `CountdownParts`
|
|
1040
|
+
|
|
1041
|
+
Slots:
|
|
1042
|
+
- `#finished` — Shown instead of the countdown once it reaches zero
|
|
1043
|
+
- `#default { days: number; hours: number; minutes: number; seconds: number; total: number; finished: boolean; }` — Replaces the whole rendering; receives `CountdownParts` (`days`, `hours`, `minutes`, `seconds`, `total`, `finished`)
|
|
1044
|
+
|
|
1045
|
+
Exposed (template ref):
|
|
1046
|
+
- `parts: CountdownParts`
|
|
1047
|
+
|
|
1048
|
+
```ts
|
|
1049
|
+
export type CountdownUnit = 'days' | 'hours' | 'minutes' | 'seconds'
|
|
1050
|
+
```
|
|
1051
|
+
|
|
1052
|
+
```ts
|
|
1053
|
+
/** What the default slot receives: the time left, split into the units shown */
|
|
1054
|
+
export interface CountdownParts {
|
|
1055
|
+
days: number
|
|
1056
|
+
hours: number
|
|
1057
|
+
minutes: number
|
|
1058
|
+
seconds: number
|
|
1059
|
+
/** Milliseconds left (0 once finished) */
|
|
1060
|
+
total: number
|
|
1061
|
+
finished: boolean
|
|
1062
|
+
}
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1023
1065
|
### MCreditCardInput
|
|
1024
1066
|
|
|
1025
1067
|
Card payment fields: number, expiry, security code and optionally the cardholder's name, with a live card preview that turns over while the security code is typed. The number is grouped as its network prints it (4-6-5 for American Express), the network is detected from the first digits, and every field is checked (length, Luhn checksum, a future expiry, the code's length for that network). It only collects and checks what is typed: it doesn't tokenize or send anything. Hand the value to your payment provider's SDK.
|
|
@@ -4319,7 +4361,7 @@ Props:
|
|
|
4319
4361
|
- `noResultsText?: string` — Text shown when options is empty — defaults to the current locale's string
|
|
4320
4362
|
|
|
4321
4363
|
Events:
|
|
4322
|
-
- `update:modelValue(unknown)` — Emitted with the selected option's value.
|
|
4364
|
+
- `update:modelValue(unknown)` — Emitted with the selected option's value (`null` when the clear button empties it).
|
|
4323
4365
|
|
|
4324
4366
|
```ts
|
|
4325
4367
|
export interface SelectOption {
|