@m3ui-vue/m3ui-vue 1.3.8 → 1.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.
Files changed (111) hide show
  1. package/dist/API.md +1058 -18
  2. package/dist/{MButton-D5eJiDza.js → MButton-DQMTIlaV.js} +2 -2
  3. package/dist/{MButton-D5eJiDza.js.map → MButton-DQMTIlaV.js.map} +1 -1
  4. package/dist/{MDialog-WqB0jewp.js → MDialog-cdgapGfZ.js} +2 -2
  5. package/dist/{MDialog-WqB0jewp.js.map → MDialog-cdgapGfZ.js.map} +1 -1
  6. package/dist/{MListItem-Cf-C2Ru-.js → MListItem-ZkSGIIrb.js} +2 -2
  7. package/dist/{MListItem-Cf-C2Ru-.js.map → MListItem-ZkSGIIrb.js.map} +1 -1
  8. package/dist/{MLoadingIndicator-D4GzEZoH.js → MLoadingIndicator-U6_oGx8z.js} +2 -2
  9. package/dist/{MLoadingIndicator-D4GzEZoH.js.map → MLoadingIndicator-U6_oGx8z.js.map} +1 -1
  10. package/dist/{MSeekBar-B19xoWE3.js → MSeekBar-DTZVizZg.js} +2 -2
  11. package/dist/{MSeekBar-B19xoWE3.js.map → MSeekBar-DTZVizZg.js.map} +1 -1
  12. package/dist/{MSlider-9RoiuebS.js → MSlider-CqJkEYRZ.js} +2 -2
  13. package/dist/{MSlider-9RoiuebS.js.map → MSlider-CqJkEYRZ.js.map} +1 -1
  14. package/dist/{MSpinner-BNF8MN-L.js → MSpinner-Btgc-0nb.js} +2 -2
  15. package/dist/{MSpinner-BNF8MN-L.js.map → MSpinner-Btgc-0nb.js.map} +1 -1
  16. package/dist/{MTextField-CuG0T3qh.js → MTextField-B6M0gJEO.js} +2 -2
  17. package/dist/{MTextField-CuG0T3qh.js.map → MTextField-B6M0gJEO.js.map} +1 -1
  18. package/dist/{MTooltip-Bv7yxngk.js → MTooltip-Dspji4XG.js} +4 -4
  19. package/dist/{MTooltip-Bv7yxngk.js.map → MTooltip-Dspji4XG.js.map} +1 -1
  20. package/dist/api.json +1 -1
  21. package/dist/code-editor.js +1 -1
  22. package/dist/components/MAudioPlayer.vue.d.ts +2 -2
  23. package/dist/components/MAvailabilityCalendar.vue.d.ts +83 -0
  24. package/dist/components/MBeforeAfter.vue.d.ts +61 -0
  25. package/dist/components/MBodyMap.vue.d.ts +70 -0
  26. package/dist/components/MCandlestickChart.vue.d.ts +82 -0
  27. package/dist/components/MCertificate.vue.d.ts +76 -0
  28. package/dist/components/MCreditCardInput.vue.d.ts +75 -0
  29. package/dist/components/MMortgageCalculator.vue.d.ts +83 -0
  30. package/dist/components/MOdontogram.vue.d.ts +86 -0
  31. package/dist/components/MOrderBook.vue.d.ts +89 -0
  32. package/dist/components/MOrderTicket.vue.d.ts +91 -0
  33. package/dist/components/MPosKeypad.vue.d.ts +84 -0
  34. package/dist/components/MProductConfigurator.vue.d.ts +136 -0
  35. package/dist/components/MQuiz.vue.d.ts +102 -0
  36. package/dist/components/MReceipt.vue.d.ts +93 -0
  37. package/dist/components/MSeatMap.vue.d.ts +131 -0
  38. package/dist/components/MSeekBar.vue.d.ts +1 -1
  39. package/dist/components/MTicket.vue.d.ts +83 -0
  40. package/dist/components/MVideoPlayer.vue.d.ts +1 -1
  41. package/dist/components/MVitalsChart.vue.d.ts +73 -0
  42. package/dist/composables/_printElement.d.ts +9 -0
  43. package/dist/composables/cardBrand.d.ts +25 -0
  44. package/dist/composables/mortgage.d.ts +37 -0
  45. package/dist/composables/useLocale.d.ts +131 -0
  46. package/dist/draw.js +2 -2
  47. package/dist/flow.js +1 -1
  48. package/dist/gantt.js +1 -1
  49. package/dist/index.d.ts +35 -0
  50. package/dist/locales/index.js +924 -7
  51. package/dist/locales/index.js.map +1 -1
  52. package/dist/m3ui-vue.css +1 -1
  53. package/dist/m3ui.js +8264 -3553
  54. package/dist/m3ui.js.map +1 -1
  55. package/dist/map.js +5 -5
  56. package/dist/media.js +4 -4
  57. package/dist/pdf.js +4 -4
  58. package/dist/rich-text-editor.js +4 -4
  59. package/dist/styles.css +1 -1
  60. package/dist/{useLocale-D2ucaY-l.js → useLocale-DLKJIRFi.js} +133 -2
  61. package/dist/useLocale-DLKJIRFi.js.map +1 -0
  62. package/package.json +1 -1
  63. package/src/__tests__/MAvailabilityCalendar.test.ts +85 -0
  64. package/src/__tests__/MBeforeAfter.test.ts +79 -0
  65. package/src/__tests__/MBodyMap.test.ts +60 -0
  66. package/src/__tests__/MCandlestickChart.test.ts +66 -0
  67. package/src/__tests__/MCertificate.test.ts +32 -0
  68. package/src/__tests__/MCreditCardInput.test.ts +122 -0
  69. package/src/__tests__/MMortgageCalculator.test.ts +49 -0
  70. package/src/__tests__/MOdontogram.test.ts +93 -0
  71. package/src/__tests__/MOrderBook.test.ts +66 -0
  72. package/src/__tests__/MOrderTicket.test.ts +68 -0
  73. package/src/__tests__/MPosKeypad.test.ts +116 -0
  74. package/src/__tests__/MProductConfigurator.test.ts +73 -0
  75. package/src/__tests__/MQuiz.test.ts +104 -0
  76. package/src/__tests__/MReceipt.test.ts +52 -0
  77. package/src/__tests__/MSeatMap.test.ts +76 -0
  78. package/src/__tests__/MTicket.test.ts +38 -0
  79. package/src/__tests__/MVitalsChart.test.ts +49 -0
  80. package/src/__tests__/mortgage.test.ts +25 -0
  81. package/src/__tests__/ssr.test.ts +11 -0
  82. package/src/components/MAvailabilityCalendar.vue +460 -0
  83. package/src/components/MBeforeAfter.vue +248 -0
  84. package/src/components/MBodyMap.vue +266 -0
  85. package/src/components/MCandlestickChart.vue +479 -0
  86. package/src/components/MCertificate.vue +351 -0
  87. package/src/components/MCreditCardInput.vue +351 -0
  88. package/src/components/MMortgageCalculator.vue +258 -0
  89. package/src/components/MOdontogram.vue +462 -0
  90. package/src/components/MOrderBook.vue +287 -0
  91. package/src/components/MOrderTicket.vue +217 -0
  92. package/src/components/MPosKeypad.vue +406 -0
  93. package/src/components/MProductConfigurator.vue +412 -0
  94. package/src/components/MQuiz.vue +531 -0
  95. package/src/components/MReceipt.vue +249 -0
  96. package/src/components/MSeatMap.vue +431 -0
  97. package/src/components/MTicket.vue +209 -0
  98. package/src/components/MVitalsChart.vue +303 -0
  99. package/src/composables/_printElement.ts +36 -0
  100. package/src/composables/cardBrand.ts +104 -0
  101. package/src/composables/mortgage.ts +70 -0
  102. package/src/composables/useLocale.ts +277 -0
  103. package/src/index.ts +35 -0
  104. package/src/locales/de.ts +131 -0
  105. package/src/locales/es.ts +131 -0
  106. package/src/locales/fr.ts +131 -0
  107. package/src/locales/ja.ts +131 -0
  108. package/src/locales/ko.ts +131 -0
  109. package/src/locales/pt.ts +131 -0
  110. package/src/locales/zh.ts +131 -0
  111. package/dist/useLocale-D2ucaY-l.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ /** A price level of an `MOrderBook`: `[price, size]`. */
2
+ export type OrderBookLevel = [price: number, size: number];
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
6
+ /** Buy orders, `[price, size]`, any order */
7
+ bids: OrderBookLevel[];
8
+ /** Sell orders, `[price, size]`, any order */
9
+ asks: OrderBookLevel[];
10
+ /** Levels shown per side */
11
+ levels?: number;
12
+ /** Groups prices into buckets of this size (bids round down, asks round up) */
13
+ step?: number;
14
+ /** Decimals of prices. Defaults to the decimals of `step`, or 2 */
15
+ decimals?: number;
16
+ /** Decimals of sizes */
17
+ sizeDecimals?: number;
18
+ /** Last traded price, shown between the sides; its arrow follows the previous value */
19
+ lastPrice?: number;
20
+ /** Asks above bids, or bids and asks side by side */
21
+ layout?: "stacked" | "split";
22
+ /** Flashes levels whose size changed */
23
+ flash?: boolean;
24
+ /** Color of bids (any CSS color) */
25
+ bidColor?: string;
26
+ /** Color of asks (any CSS color) */
27
+ askColor?: string;
28
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29
+ select: (args_0: {
30
+ price: number;
31
+ size: number;
32
+ side: "bid" | "ask";
33
+ }) => any;
34
+ }, string, import("vue").PublicProps, Readonly<{
35
+ /** Buy orders, `[price, size]`, any order */
36
+ bids: OrderBookLevel[];
37
+ /** Sell orders, `[price, size]`, any order */
38
+ asks: OrderBookLevel[];
39
+ /** Levels shown per side */
40
+ levels?: number;
41
+ /** Groups prices into buckets of this size (bids round down, asks round up) */
42
+ step?: number;
43
+ /** Decimals of prices. Defaults to the decimals of `step`, or 2 */
44
+ decimals?: number;
45
+ /** Decimals of sizes */
46
+ sizeDecimals?: number;
47
+ /** Last traded price, shown between the sides; its arrow follows the previous value */
48
+ lastPrice?: number;
49
+ /** Asks above bids, or bids and asks side by side */
50
+ layout?: "stacked" | "split";
51
+ /** Flashes levels whose size changed */
52
+ flash?: boolean;
53
+ /** Color of bids (any CSS color) */
54
+ bidColor?: string;
55
+ /** Color of asks (any CSS color) */
56
+ askColor?: string;
57
+ }> & Readonly<{
58
+ onSelect?: ((args_0: {
59
+ price: number;
60
+ size: number;
61
+ side: "bid" | "ask";
62
+ }) => any) | undefined;
63
+ }>, {
64
+ layout: "stacked" | "split";
65
+ levels: number;
66
+ sizeDecimals: number;
67
+ flash: boolean;
68
+ bidColor: string;
69
+ askColor: string;
70
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
71
+ middle?: (props: {
72
+ lastPrice: number | undefined;
73
+ direction: "up" | "down" | null;
74
+ spread: number | undefined;
75
+ spreadPercent: number | undefined;
76
+ }) => any;
77
+ } & {
78
+ middle?: (props: {
79
+ lastPrice: number | undefined;
80
+ direction: "up" | "down" | null;
81
+ spread: number | undefined;
82
+ spreadPercent: number | undefined;
83
+ }) => any;
84
+ }>;
85
+ type __VLS_WithSlots<T, S> = T & {
86
+ new (): {
87
+ $slots: S;
88
+ };
89
+ };
@@ -0,0 +1,91 @@
1
+ /** A modifier on an order line: a plain string, or with a kind to style additions and removals. */
2
+ export type OrderModifier = string | {
3
+ label: string;
4
+ kind?: 'add' | 'remove' | 'info';
5
+ };
6
+ /** A line of an `MOrderTicket`. */
7
+ export interface OrderItem {
8
+ id: string | number;
9
+ name: string;
10
+ quantity?: number;
11
+ modifiers?: OrderModifier[];
12
+ /** A free note for this line, e.g. "allergy: nuts" */
13
+ note?: string;
14
+ }
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
18
+ /** Order number shown big in the header, e.g. 42 or "A-17" */
19
+ number: string | number;
20
+ /** Where it goes, e.g. "Table 7", "Takeaway · Ana" */
21
+ title?: string;
22
+ /** Material Symbol before the title, e.g. "restaurant", "takeout_dining", "two_wheeler" */
23
+ icon?: string;
24
+ /** When the order came in (Date, ISO string or epoch ms); drives the timer */
25
+ createdAt: Date | string | number;
26
+ /** When it was finished: freezes the timer at that moment */
27
+ finishedAt?: Date | string | number;
28
+ /** The order lines */
29
+ items: OrderItem[];
30
+ /** Ids of the lines done (v-model:done) */
31
+ done?: (string | number)[];
32
+ /** A note for the whole order */
33
+ note?: string;
34
+ /** Minutes after which the header turns to the warning color */
35
+ warnAfter?: number;
36
+ /** Minutes after which the header turns to the error color */
37
+ lateAfter?: number;
38
+ /** Read-only: lines can't be ticked */
39
+ readonly?: boolean;
40
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
41
+ complete: () => any;
42
+ "update:done": (args_0: (string | number)[]) => any;
43
+ }, string, import("vue").PublicProps, Readonly<{
44
+ /** Order number shown big in the header, e.g. 42 or "A-17" */
45
+ number: string | number;
46
+ /** Where it goes, e.g. "Table 7", "Takeaway · Ana" */
47
+ title?: string;
48
+ /** Material Symbol before the title, e.g. "restaurant", "takeout_dining", "two_wheeler" */
49
+ icon?: string;
50
+ /** When the order came in (Date, ISO string or epoch ms); drives the timer */
51
+ createdAt: Date | string | number;
52
+ /** When it was finished: freezes the timer at that moment */
53
+ finishedAt?: Date | string | number;
54
+ /** The order lines */
55
+ items: OrderItem[];
56
+ /** Ids of the lines done (v-model:done) */
57
+ done?: (string | number)[];
58
+ /** A note for the whole order */
59
+ note?: string;
60
+ /** Minutes after which the header turns to the warning color */
61
+ warnAfter?: number;
62
+ /** Minutes after which the header turns to the error color */
63
+ lateAfter?: number;
64
+ /** Read-only: lines can't be ticked */
65
+ readonly?: boolean;
66
+ }> & Readonly<{
67
+ onComplete?: (() => any) | undefined;
68
+ "onUpdate:done"?: ((args_0: (string | number)[]) => any) | undefined;
69
+ }>, {
70
+ done: (string | number)[];
71
+ readonly: boolean;
72
+ warnAfter: number;
73
+ lateAfter: number;
74
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
75
+ header?: (props: {}) => any;
76
+ } & {
77
+ item?: (props: {
78
+ item: OrderItem;
79
+ done: boolean;
80
+ }) => any;
81
+ } & {
82
+ actions?: (props: {
83
+ allDone: boolean;
84
+ elapsed: number;
85
+ }) => any;
86
+ }>;
87
+ type __VLS_WithSlots<T, S> = T & {
88
+ new (): {
89
+ $slots: S;
90
+ };
91
+ };
@@ -0,0 +1,84 @@
1
+ type __VLS_Props = {
2
+ /** Value (v-model): a decimal string like "12.50", or a digit string in `pin` mode */
3
+ modelValue: string;
4
+ /**
5
+ * What is typed: `amount` (decimals, currency formatting), `integer` (quantities, no decimals) or `pin`
6
+ * (digits shown as dots, leading zeros kept)
7
+ */
8
+ mode?: 'amount' | 'integer' | 'pin';
9
+ /** Decimal places of an amount */
10
+ decimals?: number;
11
+ /**
12
+ * How an amount is entered: `free` (a decimal-point key) or `shift` (cash register: digits shift in from the
13
+ * right, with a `00` key instead of the point)
14
+ */
15
+ entry?: 'free' | 'shift';
16
+ /** ISO 4217 code (e.g. "USD", "ARS") to format the amount as money. Unset shows a plain number */
17
+ currency?: string;
18
+ /** Largest amount accepted; keys that would pass it are ignored */
19
+ max?: number;
20
+ /** Most digits accepted (a PIN's length, for one). With `pin` mode, filling it emits `submit` on its own */
21
+ maxLength?: number;
22
+ /** Chips above the keys with preset amounts */
23
+ quickAmounts?: number[];
24
+ /** Whether a quick amount replaces the value or adds to it */
25
+ quickMode?: 'set' | 'add';
26
+ /** Amount due: shows the remaining amount under the value, or the change once it's covered */
27
+ due?: number;
28
+ /** Label of the submit button. Without it (and without the `action` slot) there is no button */
29
+ actionLabel?: string;
30
+ /** Material Symbol on the submit button */
31
+ actionIcon?: string;
32
+ /** Disables the submit button. By default it's disabled while the value is empty or doesn't cover `due` */
33
+ actionDisabled?: boolean;
34
+ /** Hides the value display (e.g. the value is shown elsewhere) */
35
+ hideDisplay?: boolean;
36
+ /** Physical keyboard: while the keypad is focused, always (`global`), or never */
37
+ keyboard?: 'focus' | 'global' | 'none';
38
+ /** A short vibration on every key, on devices that support it */
39
+ haptics?: boolean;
40
+ /** Disables every key */
41
+ disabled?: boolean;
42
+ };
43
+ declare function submit(): void;
44
+ declare var __VLS_1: {
45
+ value: string;
46
+ formatted: string;
47
+ amount: number;
48
+ }, __VLS_8: {
49
+ value: string;
50
+ amount: number;
51
+ submit: typeof submit;
52
+ };
53
+ type __VLS_Slots = {} & {
54
+ display?: (props: typeof __VLS_1) => any;
55
+ } & {
56
+ action?: (props: typeof __VLS_8) => any;
57
+ };
58
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
59
+ "update:modelValue": (args_0: string) => any;
60
+ submit: (args_0: string) => any;
61
+ key: (args_0: string) => any;
62
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
63
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
64
+ onSubmit?: ((args_0: string) => any) | undefined;
65
+ onKey?: ((args_0: string) => any) | undefined;
66
+ }>, {
67
+ mode: "amount" | "integer" | "pin";
68
+ disabled: boolean;
69
+ entry: "free" | "shift";
70
+ decimals: number;
71
+ quickMode: "set" | "add";
72
+ actionDisabled: boolean;
73
+ hideDisplay: boolean;
74
+ keyboard: "focus" | "global" | "none";
75
+ haptics: boolean;
76
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
77
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
78
+ declare const _default: typeof __VLS_export;
79
+ export default _default;
80
+ type __VLS_WithSlots<T, S> = T & {
81
+ new (): {
82
+ $slots: S;
83
+ };
84
+ };
@@ -0,0 +1,136 @@
1
+ /** One choice in a `ProductOptionGroup`. */
2
+ export interface ProductOption {
3
+ value: string;
4
+ label: string;
5
+ /** Price added by this option (per unit; negative lowers it) */
6
+ price?: number;
7
+ /** Swatch color for `display: 'swatches'` (any CSS color) */
8
+ color?: string;
9
+ /** Swatch image for `display: 'swatches'` */
10
+ image?: string;
11
+ /** A line under the label in list display */
12
+ description?: string;
13
+ disabled?: boolean;
14
+ }
15
+ /**
16
+ * A group of options of a product: a size, a color, extras, the sides of a combo.
17
+ * - `single`: pick one (radio list, chips or swatches). Its value is a string.
18
+ * - `multiple`: pick several, between `min` and `max` (checkbox list or chips). Its value is a string array.
19
+ * - `quantity`: a count of each option, up to `max` in total (+/− rows). Its value is `{ [option]: count }`.
20
+ */
21
+ export interface ProductOptionGroup {
22
+ key: string;
23
+ label: string;
24
+ type?: 'single' | 'multiple' | 'quantity';
25
+ /** How the options are drawn. Defaults to `list` (`chips` for sizes is a good fit, `swatches` for colors) */
26
+ display?: 'list' | 'chips' | 'swatches';
27
+ /** A single group must have a choice */
28
+ required?: boolean;
29
+ /** Least selections / units in a multiple or quantity group */
30
+ min?: number;
31
+ /** Most selections / units in a multiple or quantity group */
32
+ max?: number;
33
+ options: ProductOption[];
34
+ }
35
+ export type ProductSelection = Record<string, string | string[] | Record<string, number> | undefined>;
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
38
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
39
+ /** The option groups */
40
+ groups: ProductOptionGroup[];
41
+ /** The selection (v-model), keyed by group key */
42
+ modelValue?: ProductSelection;
43
+ /** Price of the product before options */
44
+ basePrice?: number;
45
+ /** Units of the product (v-model:quantity). Pass `null` to hide the quantity stepper */
46
+ quantity?: number | null;
47
+ /** Most units of the product */
48
+ maxQuantity?: number;
49
+ /** ISO 4217 code to format prices */
50
+ currency?: string;
51
+ /** Label of the add button; without it there is no button */
52
+ actionLabel?: string;
53
+ /**
54
+ * Whether an option can be picked given the rest of the selection, e.g. a size out of stock in the chosen
55
+ * color. Unavailable options are crossed out and can't be picked
56
+ */
57
+ isAvailable?: (group: ProductOptionGroup, option: ProductOption, selection: ProductSelection) => boolean;
58
+ disabled?: boolean;
59
+ }, {
60
+ valid: import("vue").ComputedRef<boolean>;
61
+ unitPrice: import("vue").ComputedRef<number>;
62
+ total: import("vue").ComputedRef<number>;
63
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
64
+ add: (args_0: {
65
+ selection: ProductSelection;
66
+ quantity: number;
67
+ unitPrice: number;
68
+ total: number;
69
+ }) => any;
70
+ "update:modelValue": (args_0: ProductSelection) => any;
71
+ "update:quantity": (args_0: number) => any;
72
+ }, string, import("vue").PublicProps, Readonly<{
73
+ /** The option groups */
74
+ groups: ProductOptionGroup[];
75
+ /** The selection (v-model), keyed by group key */
76
+ modelValue?: ProductSelection;
77
+ /** Price of the product before options */
78
+ basePrice?: number;
79
+ /** Units of the product (v-model:quantity). Pass `null` to hide the quantity stepper */
80
+ quantity?: number | null;
81
+ /** Most units of the product */
82
+ maxQuantity?: number;
83
+ /** ISO 4217 code to format prices */
84
+ currency?: string;
85
+ /** Label of the add button; without it there is no button */
86
+ actionLabel?: string;
87
+ /**
88
+ * Whether an option can be picked given the rest of the selection, e.g. a size out of stock in the chosen
89
+ * color. Unavailable options are crossed out and can't be picked
90
+ */
91
+ isAvailable?: (group: ProductOptionGroup, option: ProductOption, selection: ProductSelection) => boolean;
92
+ disabled?: boolean;
93
+ }> & Readonly<{
94
+ onAdd?: ((args_0: {
95
+ selection: ProductSelection;
96
+ quantity: number;
97
+ unitPrice: number;
98
+ total: number;
99
+ }) => any) | undefined;
100
+ "onUpdate:modelValue"?: ((args_0: ProductSelection) => any) | undefined;
101
+ "onUpdate:quantity"?: ((args_0: number) => any) | undefined;
102
+ }>, {
103
+ modelValue: ProductSelection;
104
+ disabled: boolean;
105
+ quantity: number | null;
106
+ basePrice: number;
107
+ maxQuantity: number;
108
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
109
+ header?: (props: {}) => any;
110
+ } & {
111
+ option?: (props: {
112
+ group: ProductOptionGroup;
113
+ option: ProductOption;
114
+ selected: boolean;
115
+ available: boolean;
116
+ }) => any;
117
+ } & {
118
+ option?: (props: {
119
+ group: ProductOptionGroup;
120
+ option: ProductOption;
121
+ selected: boolean;
122
+ available: boolean;
123
+ }) => any;
124
+ } & {
125
+ action?: (props: {
126
+ valid: boolean;
127
+ total: number;
128
+ quantity: number;
129
+ add: () => void;
130
+ }) => any;
131
+ }>;
132
+ type __VLS_WithSlots<T, S> = T & {
133
+ new (): {
134
+ $slots: S;
135
+ };
136
+ };
@@ -0,0 +1,102 @@
1
+ /**
2
+ * A question of an `MQuiz`.
3
+ * - `single`: `answer` is the index of the right option.
4
+ * - `multiple`: `answer` is the indices of every right option (all of them, and only them, to score).
5
+ * - `truefalse`: `answer` is a boolean.
6
+ * - `order`: `options` are given in the right order; the quiz shuffles them.
7
+ * - `text`: `answer` is the accepted answer(s); case, accents and extra spaces are ignored.
8
+ */
9
+ export interface QuizQuestion {
10
+ id: string | number;
11
+ type?: 'single' | 'multiple' | 'truefalse' | 'order' | 'text';
12
+ prompt: string;
13
+ /** An image shown with the prompt */
14
+ image?: string;
15
+ options?: string[];
16
+ answer?: number | number[] | boolean | string | string[];
17
+ /** Shown after answering: why the answer is what it is */
18
+ explanation?: string;
19
+ /** Points the question is worth */
20
+ points?: number;
21
+ }
22
+ export type QuizAnswer = number | number[] | boolean | string;
23
+ /** The outcome of a finished quiz. */
24
+ export interface QuizResult {
25
+ score: number;
26
+ total: number;
27
+ percent: number;
28
+ /** Whether `percent` reached `passScore` (always true without one) */
29
+ passed: boolean;
30
+ answers: Record<string, {
31
+ value: QuizAnswer | undefined;
32
+ correct: boolean;
33
+ }>;
34
+ }
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
37
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
38
+ questions: QuizQuestion[];
39
+ /** Check each answer right away, or only reveal them in the results */
40
+ feedback?: "immediate" | "end";
41
+ /** Shuffles the questions on every attempt */
42
+ shuffle?: boolean;
43
+ /** Shuffles the options of choice questions */
44
+ shuffleOptions?: boolean;
45
+ /** Percent needed to pass, e.g. 70. Without it there's no pass / fail */
46
+ passScore?: number;
47
+ /** Time limit for the whole quiz, in seconds */
48
+ timeLimit?: number;
49
+ /** Lists every question with the given and the right answer in the results */
50
+ review?: boolean;
51
+ /** Offers to try again from the results */
52
+ allowRetry?: boolean;
53
+ }, {
54
+ restart: () => void;
55
+ result: import("vue").ComputedRef<QuizResult>;
56
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
+ finish: (args_0: QuizResult) => any;
58
+ answer: (args_0: {
59
+ id: string | number;
60
+ value: QuizAnswer | undefined;
61
+ correct: boolean;
62
+ }) => any;
63
+ }, string, import("vue").PublicProps, Readonly<{
64
+ questions: QuizQuestion[];
65
+ /** Check each answer right away, or only reveal them in the results */
66
+ feedback?: "immediate" | "end";
67
+ /** Shuffles the questions on every attempt */
68
+ shuffle?: boolean;
69
+ /** Shuffles the options of choice questions */
70
+ shuffleOptions?: boolean;
71
+ /** Percent needed to pass, e.g. 70. Without it there's no pass / fail */
72
+ passScore?: number;
73
+ /** Time limit for the whole quiz, in seconds */
74
+ timeLimit?: number;
75
+ /** Lists every question with the given and the right answer in the results */
76
+ review?: boolean;
77
+ /** Offers to try again from the results */
78
+ allowRetry?: boolean;
79
+ }> & Readonly<{
80
+ onFinish?: ((args_0: QuizResult) => any) | undefined;
81
+ onAnswer?: ((args_0: {
82
+ id: string | number;
83
+ value: QuizAnswer | undefined;
84
+ correct: boolean;
85
+ }) => any) | undefined;
86
+ }>, {
87
+ feedback: "immediate" | "end";
88
+ shuffle: boolean;
89
+ shuffleOptions: boolean;
90
+ review: boolean;
91
+ allowRetry: boolean;
92
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
93
+ result?: (props: {
94
+ result: QuizResult;
95
+ retry: () => void;
96
+ }) => any;
97
+ }>;
98
+ type __VLS_WithSlots<T, S> = T & {
99
+ new (): {
100
+ $slots: S;
101
+ };
102
+ };
@@ -0,0 +1,93 @@
1
+ /** A line of an `MReceipt`. `price` is the unit price; the line amount is `price × quantity`. */
2
+ export interface ReceiptItem {
3
+ name: string;
4
+ quantity?: number;
5
+ price: number;
6
+ /** Extra text under the name, e.g. "No onion" or a SKU */
7
+ note?: string;
8
+ }
9
+ /**
10
+ * A line after the subtotal: a discount, a tax, a tip, a service fee. Give `amount` (negative for a discount) or
11
+ * `percent` of the subtotal (negative for a discount). `included` marks a tax already inside the prices: it's
12
+ * shown but not added again. Percentages apply to the running total, in the order given (put discounts first).
13
+ */
14
+ export interface ReceiptAdjustment {
15
+ label: string;
16
+ amount?: number;
17
+ percent?: number;
18
+ included?: boolean;
19
+ }
20
+ /** A payment toward the total, e.g. `{ method: 'Cash', amount: 50 }`. Paying more than the total shows the change. */
21
+ export interface ReceiptPayment {
22
+ method: string;
23
+ amount: number;
24
+ }
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
27
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
28
+ /** The lines sold */
29
+ items: ReceiptItem[];
30
+ /** Discounts, taxes, tips, fees, applied after the subtotal in this order */
31
+ adjustments?: ReceiptAdjustment[];
32
+ /** Payments made; more than the total shows the change */
33
+ payments?: ReceiptPayment[];
34
+ /** ISO 4217 code, e.g. "USD". Without one, amounts are plain numbers */
35
+ currency?: string;
36
+ /** Receipt / invoice number, shown under the header */
37
+ number?: string | number;
38
+ /** Date of the sale (Date, ISO string or epoch ms) */
39
+ date?: Date | string | number;
40
+ /** Paper width: 58 mm, 80 mm, or the width of the container */
41
+ paper?: "58mm" | "80mm" | "auto";
42
+ /** Torn zigzag edges at the top and bottom, or straight */
43
+ edge?: "zigzag" | "straight";
44
+ /** Text at the bottom when the `footer` slot isn't used */
45
+ footer?: string;
46
+ }, {
47
+ print: () => void;
48
+ /** Totals in the receipt's units (not cents) */
49
+ totals: import("vue").ComputedRef<{
50
+ subtotal: number;
51
+ total: number;
52
+ paid: number;
53
+ change: number;
54
+ }>;
55
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
56
+ /** The lines sold */
57
+ items: ReceiptItem[];
58
+ /** Discounts, taxes, tips, fees, applied after the subtotal in this order */
59
+ adjustments?: ReceiptAdjustment[];
60
+ /** Payments made; more than the total shows the change */
61
+ payments?: ReceiptPayment[];
62
+ /** ISO 4217 code, e.g. "USD". Without one, amounts are plain numbers */
63
+ currency?: string;
64
+ /** Receipt / invoice number, shown under the header */
65
+ number?: string | number;
66
+ /** Date of the sale (Date, ISO string or epoch ms) */
67
+ date?: Date | string | number;
68
+ /** Paper width: 58 mm, 80 mm, or the width of the container */
69
+ paper?: "58mm" | "80mm" | "auto";
70
+ /** Torn zigzag edges at the top and bottom, or straight */
71
+ edge?: "zigzag" | "straight";
72
+ /** Text at the bottom when the `footer` slot isn't used */
73
+ footer?: string;
74
+ }> & Readonly<{}>, {
75
+ paper: "58mm" | "80mm" | "auto";
76
+ edge: "zigzag" | "straight";
77
+ adjustments: ReceiptAdjustment[];
78
+ payments: ReceiptPayment[];
79
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
80
+ header?: (props: {}) => any;
81
+ } & {
82
+ item?: (props: {
83
+ item: ReceiptItem;
84
+ amount: number;
85
+ }) => any;
86
+ } & {
87
+ footer?: (props: {}) => any;
88
+ }>;
89
+ type __VLS_WithSlots<T, S> = T & {
90
+ new (): {
91
+ $slots: S;
92
+ };
93
+ };