@mono-lit/helper 0.0.3 → 0.0.5
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/control-tooltip-7vegYmq3.js +678 -0
- package/dist/{tooltip-FCMRUSLi.js → control-tooltip-C3rA_nSH.js} +12 -119
- package/dist/{data-source-controller-Cf_sMxEh.js → data-source-controller-C6C4ej_M.js} +1 -1
- package/dist/{data-source-options-Bk-UoaZV.js → data-source-options-Cz9fVLK8.js} +3 -2
- package/dist/{data-source-read-Cuqw3LcP.js → data-source-read-i6CYSUEl.js} +2 -1
- package/dist/{excel-DtRpxmxs.js → excel-BPdDt06G.js} +1 -1
- package/dist/{export-B91P6J1y.js → export-DgomqI_3.js} +2 -2
- package/dist/export.js +2 -2
- package/dist/{field-icons-FmyBWa0g.js → field-icons-t8rXRCKs.js} +50 -1
- package/dist/field-tooltip-FyMi9vNM.js +266 -0
- package/dist/field-tooltip.css_raw-DEctHXKm.js +270 -0
- package/dist/field-validation-CHHQi1zl.js +170 -0
- package/dist/field-validation.css_raw-B3Iu33rS.js +178 -0
- package/dist/index.js +4 -3
- package/dist/{index.node-dvrNviMx.js → index.node-DzCuvHLg.js} +1 -1
- package/dist/index.node.js +4 -3
- package/dist/input-format-GrRCJBqV.js +251 -0
- package/dist/input.css_raw-CQu2fAsU.js +5 -0
- package/dist/{mono-data-grid-BHlo1IgR.js → mono-data-grid-KDpu4d4_.js} +5 -4
- package/dist/{mono-form-controller-IYn0MuUQ.js → mono-form-controller-BkMR8g14.js} +18 -3
- package/dist/{reactive-DFCdZbH9.js → normalize-error-BmLbgANw.js} +1 -48
- package/dist/nuxt.js +36 -8
- package/dist/{popup-portal-HWhkd7oy.js → popup-portal-C8ttHDRX.js} +17 -1
- package/dist/{popup-stack-De05Y-mJ.js → popup-stack-C64WCuXq.js} +21 -1
- package/dist/src/components/accordion/accordion-core.d.ts +4 -1
- package/dist/src/components/accordion/mono-accordion.shadow.d.ts +4 -1
- package/dist/src/components/date/date-core.d.ts +3 -0
- package/dist/src/components/date/date-types.d.ts +36 -1
- package/dist/src/components/drawer/drawer-core.d.ts +1 -0
- package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +3 -0
- package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +31 -0
- package/dist/src/components/form/form-types.d.ts +23 -5
- package/dist/src/components/input/index.d.ts +2 -2
- package/dist/src/components/input/index.shadow.d.ts +2 -2
- package/dist/src/components/input/input-core.d.ts +23 -3
- package/dist/src/components/input/input-types.d.ts +84 -9
- package/dist/src/components/input/mono-input.d.ts +3 -2
- package/dist/src/components/input/mono-input.shadow.d.ts +3 -2
- package/dist/src/components/modal/modal-core.d.ts +1 -0
- package/dist/src/components/otp/index.d.ts +5 -0
- package/dist/src/components/otp/index.shadow.d.ts +6 -0
- package/dist/src/components/otp/mono-otp.d.ts +32 -0
- package/dist/src/components/otp/mono-otp.shadow.d.ts +30 -0
- package/dist/src/components/otp/otp-core.d.ts +91 -0
- package/dist/src/components/otp/otp-types.d.ts +161 -0
- package/dist/src/components/otp/otp-utils.d.ts +41 -0
- package/dist/src/components/select/select-core.d.ts +3 -0
- package/dist/src/components/select/select-types.d.ts +31 -0
- package/dist/src/components/slider/index.d.ts +5 -0
- package/dist/src/components/slider/index.shadow.d.ts +6 -0
- package/dist/src/components/slider/mono-slider.d.ts +33 -0
- package/dist/src/components/slider/mono-slider.shadow.d.ts +29 -0
- package/dist/src/components/slider/slider-core.d.ts +77 -0
- package/dist/src/components/slider/slider-math.d.ts +102 -0
- package/dist/src/components/slider/slider-types.d.ts +188 -0
- package/dist/src/components/tag-input/tag-input-core.d.ts +3 -0
- package/dist/src/components/tag-input/tag-input-types.d.ts +31 -0
- package/dist/src/components/textarea/textarea-core.d.ts +3 -0
- package/dist/src/components/textarea/textarea-types.d.ts +31 -0
- package/dist/src/composables/field-bubble.d.ts +34 -0
- package/dist/src/composables/field-icons.d.ts +10 -0
- package/dist/src/composables/field-tooltip.d.ts +52 -0
- package/dist/src/composables/field-validation.d.ts +58 -0
- package/dist/src/composables/popup-portal.d.ts +12 -0
- package/dist/src/composables/popup-stack.d.ts +21 -0
- package/dist/src/entries/index.d.ts +1 -1
- package/dist/src/entries/index.node.d.ts +1 -1
- package/dist/src/nuxt/index.d.ts +2 -2
- package/dist/src/nuxt/ssr-lit/index.d.ts +4 -0
- package/dist/ssr-lit/runtime/components/LitWrapper.vue +11 -0
- package/dist/ssr-lit/runtime/components/LitWrapperClient.vue +11 -0
- package/dist/ssr-lit/runtime/components/LitWrapperServer.vue +38 -0
- package/dist/ssr-lit/runtime/plugins/antiFouc.server.js +25 -0
- package/dist/ssr-lit/runtime/plugins/hydrateSupport.client.js +4 -0
- package/dist/ssr-lit/runtime/plugins/polyfill.client.js +9 -0
- package/dist/ssr-lit/runtime/utils/customElements.js +11 -0
- package/dist/ssr-lit/runtime/utils/litElementRenderer.js +28 -0
- package/dist/{styles-D-ergrfR.js → styles-BODNpZV1.js} +1 -1
- package/dist/tooltip-Drekihf5.js +102 -0
- package/dist/tooltip-loader-3U9FTOXj.js +20 -0
- package/dist/tooltip-loader-Dcp9AUZn.js +23 -0
- package/dist/tooltip.js +3 -1
- package/dist/ui/accordion.js +16 -3
- package/dist/ui/alert.js +2 -2
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/button-dropdown.js +1 -1
- package/dist/ui/chart.js +1 -1
- package/dist/ui/date.js +66 -5
- package/dist/ui/drawer.js +11 -2
- package/dist/ui/dropdown-table.js +60 -5
- package/dist/ui/dropdown.js +3 -2
- package/dist/ui/file-upload.js +1 -1
- package/dist/ui/form.js +1 -1
- package/dist/ui/index.css +8857 -3974
- package/dist/ui/input.js +362 -260
- package/dist/ui/menu.js +1 -1
- package/dist/ui/modal.js +11 -2
- package/dist/ui/otp.js +835 -0
- package/dist/ui/select.js +67 -3
- package/dist/ui/shadow/accordion.js +31 -4
- package/dist/ui/shadow/alert.js +1 -1
- package/dist/ui/shadow/button-dropdown.js +1 -1
- package/dist/ui/shadow/chart.js +4 -4
- package/dist/ui/shadow/date.js +67 -6
- package/dist/ui/shadow/drawer.js +11 -2
- package/dist/ui/shadow/dropdown-table.js +62 -7
- package/dist/ui/shadow/dropdown.js +3 -2
- package/dist/ui/shadow/input.js +367 -261
- package/dist/ui/shadow/modal.js +11 -2
- package/dist/ui/shadow/otp.js +842 -0
- package/dist/ui/shadow/select.js +71 -6
- package/dist/ui/shadow/sidebar.js +2 -2
- package/dist/ui/shadow/slider.js +1082 -0
- package/dist/ui/shadow/table.js +6 -6
- package/dist/ui/shadow/tag-input.js +72 -7
- package/dist/ui/shadow/textarea.js +63 -2
- package/dist/ui/sidebar.js +2 -2
- package/dist/ui/slider.js +1079 -0
- package/dist/ui/table.js +2 -2
- package/dist/ui/tag-input.js +67 -3
- package/dist/ui/textarea.js +62 -1
- package/dist/ui/theme/luma.css +505 -466
- package/dist/ui/theme/lyra.css +505 -466
- package/dist/ui/theme/maia.css +501 -466
- package/dist/ui/theme/mira.css +505 -466
- package/dist/ui/theme/nova.css +503 -466
- package/dist/ui/theme/one.css +742 -699
- package/dist/ui/theme/rhea.css +506 -466
- package/dist/ui/theme/sera.css +507 -466
- package/dist/ui/theme/vega.css +495 -466
- package/dist/{vite-DcyRlTTf.js → vite-CivRCJaf.js} +2 -0
- package/dist/vite.js +1 -1
- package/dist/vue.d.ts +10 -0
- package/package.json +30 -15
- package/dist/input.css_raw-CGESifay.js +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccordionColor, AccordionCssClass, AccordionSize } from "./accordion-types.js";
|
|
2
2
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
3
|
-
import { LitElement } from "lit";
|
|
3
|
+
import { LitElement, TemplateResult, nothing } from "lit";
|
|
4
4
|
//#region src/components/accordion/accordion-core.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Slot regions the accordion lays out. `default` is the unnamed body region.
|
|
@@ -21,6 +21,8 @@ export declare class MonoAccordionCoreInterface {
|
|
|
21
21
|
label: string;
|
|
22
22
|
/** @deprecated alias of `subtitle` */
|
|
23
23
|
description: string;
|
|
24
|
+
/** Leading icon — an iconify class or plain text. `slot="icon"` wins over it. */
|
|
25
|
+
icon: string;
|
|
24
26
|
modelValue: boolean;
|
|
25
27
|
disabled: boolean;
|
|
26
28
|
cssClass: AccordionCssClass;
|
|
@@ -46,6 +48,7 @@ export declare class MonoAccordionCoreInterface {
|
|
|
46
48
|
protected get _hasTitleContent(): boolean;
|
|
47
49
|
protected get _hasSubtitleContent(): boolean;
|
|
48
50
|
protected get _hasIconContent(): boolean;
|
|
51
|
+
protected _renderIconGlyph(): TemplateResult | typeof nothing;
|
|
49
52
|
protected _setCssClass(value: unknown): void;
|
|
50
53
|
protected _handleClick(event: Event): void;
|
|
51
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
2
|
import { MonoAccordionCoreInterface } from "./accordion-core.js";
|
|
3
|
-
import { LitElement, TemplateResult } from "lit";
|
|
3
|
+
import { LitElement, TemplateResult, nothing } from "lit";
|
|
4
4
|
//#region src/components/accordion/mono-accordion.shadow.d.ts
|
|
5
5
|
declare const MonoAccordionShadow_base: Constructor<MonoAccordionCoreInterface> & typeof LitElement;
|
|
6
6
|
/**
|
|
@@ -23,6 +23,9 @@ export declare class MonoAccordionShadow extends MonoAccordionShadow_base {
|
|
|
23
23
|
static styles: import("lit").CSSResult[];
|
|
24
24
|
connectedCallback(): void;
|
|
25
25
|
firstUpdated(changed: Map<string, unknown>): void;
|
|
26
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
27
|
+
/** Iconify classes are drawn as inline SVG — page utility CSS cannot reach here. */
|
|
28
|
+
protected _renderIconGlyph(): TemplateResult | typeof nothing;
|
|
26
29
|
/**
|
|
27
30
|
* Presence of a region that may also answer to an old name (`label` →
|
|
28
31
|
* `title`, `description` → `subtitle`): the union of both slots.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
2
|
import { CssSizeValue } from "../../composables/css-size.js";
|
|
3
3
|
import { DateColor, DateCssClass, DateMode, DateSize, DateType, DateValidationState, DateVariant } from "./date-types.js";
|
|
4
|
+
import { FieldTooltipController, FieldTooltipValue } from "../../composables/field-tooltip.js";
|
|
4
5
|
import { LitElement, TemplateResult } from "lit";
|
|
5
6
|
import { Options } from "flatpickr/dist/types/options";
|
|
6
7
|
//#region src/components/date/date-core.d.ts
|
|
@@ -29,6 +30,8 @@ export declare class MonoDateCoreInterface {
|
|
|
29
30
|
label?: string;
|
|
30
31
|
placeholder?: string;
|
|
31
32
|
helperText?: string;
|
|
33
|
+
tooltip: FieldTooltipValue;
|
|
34
|
+
protected readonly _tooltip: FieldTooltipController;
|
|
32
35
|
validationState?: DateValidationState;
|
|
33
36
|
validationMessage?: string;
|
|
34
37
|
error: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VisibilityProps } from "../../composables/visibility.js";
|
|
2
|
+
import { MonoTooltipOptions } from "../tooltip/tooltip-types.js";
|
|
2
3
|
import { Options } from "flatpickr/dist/types/options";
|
|
3
4
|
//#region src/components/date/date-types.d.ts
|
|
4
5
|
/** Picker mode — drives flatpickr's calendar/time configuration. */
|
|
@@ -6,7 +7,15 @@ export type DateType = 'date' | 'datetime' | 'time';
|
|
|
6
7
|
export type DateSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
7
8
|
export type DateColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'teal' | 'purple' | 'neutral' | 'dark';
|
|
8
9
|
export type DateVariant = 'outlined' | 'filled' | 'underlined';
|
|
9
|
-
|
|
10
|
+
/** Where the label sits: above the box (default), notched into its top border (inset for filled / underlined), or beside it. */
|
|
11
|
+
export type DateLabelPosition = 'top' | 'notched' | 'left' | 'right';
|
|
12
|
+
/** Where the validation message shows: under the box (default), behind a state icon inside it, or floating under it on hover / focus. */
|
|
13
|
+
export type DateValidationPosition = 'bottom' | 'icon' | 'float';
|
|
14
|
+
/**
|
|
15
|
+
* `error` / `success` are the date's own names; `invalid` / `valid` are accepted as
|
|
16
|
+
* aliases — the names every other control (and `controlMonoForm`) uses.
|
|
17
|
+
*/
|
|
18
|
+
export type DateValidationState = 'default' | 'error' | 'success' | 'invalid' | 'valid';
|
|
10
19
|
/** flatpickr selection mode. */
|
|
11
20
|
export type DateMode = 'single' | 'multiple' | 'range';
|
|
12
21
|
export interface DateCssClass {
|
|
@@ -64,11 +73,37 @@ export interface DateProps extends VisibilityProps {
|
|
|
64
73
|
size?: DateSize;
|
|
65
74
|
color?: DateColor;
|
|
66
75
|
variant?: DateVariant;
|
|
76
|
+
/**
|
|
77
|
+
* Where the label sits: `top` (above the box, default), `notched` (on the top
|
|
78
|
+
* border for outlined; inset inside the box for filled / underlined), or
|
|
79
|
+
* `left` / `right` of the box. Knobs: `--mono-date-label-width`, `-label-side-gap`,
|
|
80
|
+
* `-label-notch-font-size`, `-label-notch-bg`.
|
|
81
|
+
*/
|
|
82
|
+
labelPosition?: DateLabelPosition;
|
|
83
|
+
'label-position'?: DateLabelPosition;
|
|
84
|
+
labelposition?: DateLabelPosition;
|
|
85
|
+
/**
|
|
86
|
+
* Where the validation message shows. `bottom` (default): the row under the box.
|
|
87
|
+
* `icon`: a state icon inside the box; hover / tap / keyboard focus shows the message in
|
|
88
|
+
* a state-coloured bubble. `float`: the message floats under the box only while the field
|
|
89
|
+
* is hovered or focused. In `icon` / `float` the row under the box keeps the helper text.
|
|
90
|
+
*/
|
|
91
|
+
validationPosition?: DateValidationPosition;
|
|
92
|
+
'validation-position'?: DateValidationPosition;
|
|
93
|
+
validationposition?: DateValidationPosition;
|
|
67
94
|
/** Field label + helper / validation messaging. */
|
|
68
95
|
label?: string;
|
|
69
96
|
placeholder?: string;
|
|
70
97
|
helperText?: string;
|
|
71
98
|
'helper-text'?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Info icon at the end of the label; hovering, focusing or tapping it shows this text.
|
|
101
|
+
* Plain text → a small built-in bubble (no dependency). Full tooltip options
|
|
102
|
+
* (`:tooltip.prop="{ content, placement, color }"`) → a `mono-tooltip`, which needs the
|
|
103
|
+
* optional `@floating-ui/dom` + `@floating-ui/core` peers (without them that form renders
|
|
104
|
+
* no icon). Shown only beside a label.
|
|
105
|
+
*/
|
|
106
|
+
tooltip?: string | MonoTooltipOptions;
|
|
72
107
|
validationState?: DateValidationState;
|
|
73
108
|
'validation-state'?: DateValidationState;
|
|
74
109
|
validationMessage?: string;
|
|
@@ -56,6 +56,7 @@ export declare class MonoDrawerCoreInterface implements PopupLayer {
|
|
|
56
56
|
get hasBackdrop(): boolean;
|
|
57
57
|
get pinnedZ(): number | undefined;
|
|
58
58
|
onStackEscape(event: KeyboardEvent): void;
|
|
59
|
+
containsEventPath(path: EventTarget[]): boolean;
|
|
59
60
|
setStackZ(z: number, isTopBackdrop: boolean): void;
|
|
60
61
|
protected _slotsCaptured: boolean;
|
|
61
62
|
protected _hasHeaderSlotState: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
2
|
import { CssSizeValue } from "../../composables/css-size.js";
|
|
3
3
|
import { DropdownPlacement } from "../dropdown/dropdown-types.js";
|
|
4
|
+
import { FieldTooltipController, FieldTooltipValue } from "../../composables/field-tooltip.js";
|
|
4
5
|
import { PopupPortalController } from "../../composables/popup-portal.js";
|
|
5
6
|
import { DropdownPanelOptions, DropdownTableChipProps, DropdownTableColor, DropdownTableCssClass, DropdownTableSize, DropdownTableValidationState, DropdownTableVariant } from "./dropdown-table-types.js";
|
|
6
7
|
import { MonoDropdownController } from "./mono-data-dropdown.js";
|
|
@@ -15,6 +16,8 @@ export declare class MonoDropdownTableCoreInterface {
|
|
|
15
16
|
label: string;
|
|
16
17
|
placeholder: string;
|
|
17
18
|
helperText: string;
|
|
19
|
+
tooltip: FieldTooltipValue;
|
|
20
|
+
protected readonly _tooltip: FieldTooltipController;
|
|
18
21
|
validationState: DropdownTableValidationState;
|
|
19
22
|
validationMessage: string;
|
|
20
23
|
errorMessage: string;
|
|
@@ -2,6 +2,7 @@ import { CssSizeValue, PanelSizeProps } from "../../composables/css-size.js";
|
|
|
2
2
|
import { DropdownPlacement } from "../dropdown/dropdown-types.js";
|
|
3
3
|
import { VisibilityProps } from "../../composables/visibility.js";
|
|
4
4
|
import { ChipBehaviour, ChipColor, ChipCssClass, ChipRounded, ChipSize, ChipVariant } from "../chip/chip-types.js";
|
|
5
|
+
import { MonoTooltipOptions } from "../tooltip/tooltip-types.js";
|
|
5
6
|
import { ChipLimitProps } from "../../composables/chip-limits.js";
|
|
6
7
|
import { MonoDropdownController, MonoDropdownItem } from "./mono-data-dropdown.js";
|
|
7
8
|
//#region src/components/dropdown-table/dropdown-table-types.d.ts
|
|
@@ -62,6 +63,10 @@ export type DropdownTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
|
62
63
|
export type DropdownTableColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'teal' | 'purple' | 'neutral' | 'dark';
|
|
63
64
|
/** Field style variant. */
|
|
64
65
|
export type DropdownTableVariant = 'outlined' | 'filled' | 'underlined';
|
|
66
|
+
/** Where the label sits: above the box (default), notched into its top border (inset for filled / underlined), or beside it. */
|
|
67
|
+
export type DropdownTableLabelPosition = 'top' | 'notched' | 'left' | 'right';
|
|
68
|
+
/** Where the validation message shows: under the box (default), behind a state icon inside it, or floating under it on hover / focus. */
|
|
69
|
+
export type DropdownTableValidationPosition = 'bottom' | 'icon' | 'float';
|
|
65
70
|
/** Validation appearance. */
|
|
66
71
|
export type DropdownTableValidationState = 'default' | 'valid' | 'invalid' | 'warning';
|
|
67
72
|
/**
|
|
@@ -133,6 +138,24 @@ export interface DropdownTableProps extends VisibilityProps {
|
|
|
133
138
|
color?: DropdownTableColor;
|
|
134
139
|
/** Field style variant. */
|
|
135
140
|
variant?: DropdownTableVariant;
|
|
141
|
+
/**
|
|
142
|
+
* Where the label sits: `top` (above the box, default), `notched` (on the top
|
|
143
|
+
* border for outlined; inset inside the box for filled / underlined), or
|
|
144
|
+
* `left` / `right` of the box. Knobs: `--mono-dropdown-table-label-width`, `-label-side-gap`,
|
|
145
|
+
* `-label-notch-font-size`, `-label-notch-bg`.
|
|
146
|
+
*/
|
|
147
|
+
labelPosition?: DropdownTableLabelPosition;
|
|
148
|
+
'label-position'?: DropdownTableLabelPosition;
|
|
149
|
+
labelposition?: DropdownTableLabelPosition;
|
|
150
|
+
/**
|
|
151
|
+
* Where the validation message shows. `bottom` (default): the row under the box.
|
|
152
|
+
* `icon`: a state icon inside the box; hover / tap / keyboard focus shows the message in
|
|
153
|
+
* a state-coloured bubble. `float`: the message floats under the box only while the field
|
|
154
|
+
* is hovered or focused. In `icon` / `float` the row under the box keeps the helper text.
|
|
155
|
+
*/
|
|
156
|
+
validationPosition?: DropdownTableValidationPosition;
|
|
157
|
+
'validation-position'?: DropdownTableValidationPosition;
|
|
158
|
+
validationposition?: DropdownTableValidationPosition;
|
|
136
159
|
/** Text label shown above the field. */
|
|
137
160
|
label?: string;
|
|
138
161
|
/** Placeholder shown in the field when nothing is selected. */
|
|
@@ -140,6 +163,14 @@ export interface DropdownTableProps extends VisibilityProps {
|
|
|
140
163
|
/** Helper text shown below the field. */
|
|
141
164
|
helperText?: string;
|
|
142
165
|
'helper-text'?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Info icon at the end of the label; hovering, focusing or tapping it shows this text.
|
|
168
|
+
* Plain text → a small built-in bubble (no dependency). Full tooltip options
|
|
169
|
+
* (`:tooltip.prop="{ content, placement, color }"`) → a `mono-tooltip`, which needs the
|
|
170
|
+
* optional `@floating-ui/dom` + `@floating-ui/core` peers (without them that form renders
|
|
171
|
+
* no icon). Shown only beside a label.
|
|
172
|
+
*/
|
|
173
|
+
tooltip?: string | MonoTooltipOptions;
|
|
143
174
|
/** Validation state controlling the field's appearance. */
|
|
144
175
|
validationState?: DropdownTableValidationState;
|
|
145
176
|
'validation-state'?: DropdownTableValidationState;
|
|
@@ -10,6 +10,8 @@ import { RichTextEditorEvents, RichTextEditorProps } from "../rich-text-editor/r
|
|
|
10
10
|
import { TagInputEvents, TagInputProps } from "../tag-input/tag-input-types.js";
|
|
11
11
|
import { RadioEvents, RadioProps } from "../radio/radio-types.js";
|
|
12
12
|
import { SwitchEvents, SwitchProps } from "../switch/switch-types.js";
|
|
13
|
+
import { SliderEvents, SliderProps } from "../slider/slider-types.js";
|
|
14
|
+
import { OtpEvents, OtpProps } from "../otp/otp-types.js";
|
|
13
15
|
//#region src/components/form/form-types.d.ts
|
|
14
16
|
/**
|
|
15
17
|
* Tag name → its props, so `inputs[key].props` and `setProp()` autocomplete against the
|
|
@@ -32,6 +34,8 @@ export interface MonoFormComponentProps {
|
|
|
32
34
|
'mono-checkbox': Partial<CheckboxProps> & MonoEventProps<CheckboxEvents>;
|
|
33
35
|
'mono-radio': Partial<RadioProps> & MonoEventProps<RadioEvents>;
|
|
34
36
|
'mono-switch': Partial<SwitchProps> & MonoEventProps<SwitchEvents>;
|
|
37
|
+
'mono-slider': Partial<SliderProps> & MonoEventProps<SliderEvents>;
|
|
38
|
+
'mono-otp': Partial<OtpProps> & MonoEventProps<OtpEvents>;
|
|
35
39
|
}
|
|
36
40
|
/** Every component `monoForm` can drive. */
|
|
37
41
|
export type MonoFormComponent = keyof MonoFormComponentProps;
|
|
@@ -52,13 +56,27 @@ export interface MonoFormRuleCtx<V = unknown> {
|
|
|
52
56
|
key: string;
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
|
-
* Anything schema-shaped
|
|
56
|
-
*
|
|
57
|
-
*
|
|
59
|
+
* Anything schema-shaped. Duck-typed on purpose: @mono-lit/helper takes no
|
|
60
|
+
* validation dependency. Two shapes are accepted:
|
|
61
|
+
* - yup-shaped: `validateSync` (or an async `validate`) that throws; the
|
|
62
|
+
* error's `errors[0]` / `message` becomes the message.
|
|
63
|
+
* - Standard Schema v1 (Valibot, Zod, ArkType, …): `['~standard'].validate`;
|
|
64
|
+
* the first issue's `message` becomes the message.
|
|
58
65
|
*/
|
|
59
66
|
export interface MonoFormSchemaLike {
|
|
60
|
-
validateSync?: (value: unknown, options?:
|
|
61
|
-
validate?: (value: unknown, options?:
|
|
67
|
+
validateSync?: (value: unknown, options?: any) => unknown;
|
|
68
|
+
validate?: (value: unknown, options?: any) => unknown;
|
|
69
|
+
readonly '~standard'?: {
|
|
70
|
+
readonly validate: (value: unknown) => {
|
|
71
|
+
readonly issues?: ReadonlyArray<{
|
|
72
|
+
readonly message: string;
|
|
73
|
+
}> | undefined;
|
|
74
|
+
} | Promise<{
|
|
75
|
+
readonly issues?: ReadonlyArray<{
|
|
76
|
+
readonly message: string;
|
|
77
|
+
}> | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
62
80
|
}
|
|
63
81
|
interface MonoFormRuleBase {
|
|
64
82
|
/** Overrides the form-level `validation.type` for this rule only. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../../vue.d.ts" />
|
|
2
2
|
import { InputFormat, InputFormatCtx, InputFormatDescriptor, InputFormatOn, applyFormat, caretAfterFormat, localeSeparators, normaliseValue, parseFormat, resolveFormat, significantFor, stripFormat } from "./input-format.js";
|
|
3
|
-
import { InputColor, InputEvents, InputProps, InputSize, InputType, InputVariant } from "./input-types.js";
|
|
3
|
+
import { InputColor, InputEvents, InputFileErrorEventDetail, InputModelEventDetail, InputModelValue, InputProps, InputSize, InputType, InputVariant } from "./input-types.js";
|
|
4
4
|
import { MonoInput } from "./mono-input.js";
|
|
5
5
|
import { generateInputAriaAttributes, generateInputAttributes, getInputIcon, validateInputProps } from "./input-utils.js";
|
|
6
|
-
export { type InputColor, type InputEvents, type InputFormat, type InputFormatCtx, type InputFormatDescriptor, type InputFormatOn, type InputProps, type InputSize, type InputType, type InputVariant, MonoInput, applyFormat, caretAfterFormat, generateInputAriaAttributes, generateInputAttributes, getInputIcon, localeSeparators, normaliseValue, parseFormat, resolveFormat, significantFor, stripFormat, validateInputProps };
|
|
6
|
+
export { type InputColor, type InputEvents, type InputFileErrorEventDetail, type InputFormat, type InputFormatCtx, type InputFormatDescriptor, type InputFormatOn, type InputModelEventDetail, type InputModelValue, type InputProps, type InputSize, type InputType, type InputVariant, MonoInput, applyFormat, caretAfterFormat, generateInputAriaAttributes, generateInputAttributes, getInputIcon, localeSeparators, normaliseValue, parseFormat, resolveFormat, significantFor, stripFormat, validateInputProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="../../../vue.d.ts" />
|
|
2
2
|
import { InputFormat, InputFormatCtx, InputFormatDescriptor, InputFormatOn, applyFormat, caretAfterFormat, localeSeparators, normaliseValue, parseFormat, resolveFormat, significantFor, stripFormat } from "./input-format.js";
|
|
3
|
-
import { InputColor, InputEvents, InputProps, InputSize, InputType, InputVariant } from "./input-types.js";
|
|
3
|
+
import { InputColor, InputEvents, InputFileErrorEventDetail, InputModelEventDetail, InputModelValue, InputProps, InputSize, InputType, InputVariant } from "./input-types.js";
|
|
4
4
|
import { InputSlotName, MonoInputCore } from "./input-core.js";
|
|
5
5
|
import { generateInputAriaAttributes, generateInputAttributes, getInputIcon, validateInputProps } from "./input-utils.js";
|
|
6
6
|
import { MonoInputShadow } from "./mono-input.shadow.js";
|
|
7
|
-
export { type InputColor, type InputEvents, type InputFormat, type InputFormatCtx, type InputFormatDescriptor, type InputFormatOn, type InputProps, type InputSize, type InputSlotName, type InputType, type InputVariant, MonoInputCore, MonoInputShadow, applyFormat, caretAfterFormat, generateInputAriaAttributes, generateInputAttributes, getInputIcon, localeSeparators, normaliseValue, parseFormat, resolveFormat, significantFor, stripFormat, validateInputProps };
|
|
7
|
+
export { type InputColor, type InputEvents, type InputFileErrorEventDetail, type InputFormat, type InputFormatCtx, type InputFormatDescriptor, type InputFormatOn, type InputModelEventDetail, type InputModelValue, type InputProps, type InputSize, type InputSlotName, type InputType, type InputVariant, MonoInputCore, MonoInputShadow, applyFormat, caretAfterFormat, generateInputAriaAttributes, generateInputAttributes, getInputIcon, localeSeparators, normaliseValue, parseFormat, resolveFormat, significantFor, stripFormat, validateInputProps };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
2
|
import { CssSizeValue, buildSizeStyle } from "../../composables/css-size.js";
|
|
3
|
+
import { FieldTooltipController, FieldTooltipValue } from "../../composables/field-tooltip.js";
|
|
3
4
|
import { InputFormat, InputFormatOn } from "./input-format.js";
|
|
4
|
-
import { InputColor, InputCssClass, InputSize, InputType, InputValidationState, InputVariant } from "./input-types.js";
|
|
5
|
+
import { InputColor, InputCssClass, InputModelValue, InputSize, InputType, InputValidationState, InputVariant } from "./input-types.js";
|
|
6
|
+
import { FieldValidationController } from "../../composables/field-validation.js";
|
|
5
7
|
import { LitElement, TemplateResult, nothing } from "lit";
|
|
6
8
|
//#region src/components/input/input-core.d.ts
|
|
7
9
|
export declare const numberStringConverter: {
|
|
@@ -9,6 +11,8 @@ export declare const numberStringConverter: {
|
|
|
9
11
|
toAttribute(value: number | undefined): string | null;
|
|
10
12
|
};
|
|
11
13
|
export type InputSlotName = 'prefix' | 'suffix' | 'label' | 'helper';
|
|
14
|
+
/** Glyphs the builds draw: the clear `×`, and the `type="file"` upload cloud. */
|
|
15
|
+
export type InputIconName = 'close' | 'upload';
|
|
12
16
|
/** Public surface added by the core mixin (for typing the wrappers + tag map). */
|
|
13
17
|
export declare class MonoInputCoreInterface {
|
|
14
18
|
cssClass: InputCssClass;
|
|
@@ -17,7 +21,11 @@ export declare class MonoInputCoreInterface {
|
|
|
17
21
|
size: InputSize;
|
|
18
22
|
color: InputColor;
|
|
19
23
|
variant: InputVariant;
|
|
20
|
-
modelValue:
|
|
24
|
+
modelValue: InputModelValue;
|
|
25
|
+
accept: string;
|
|
26
|
+
multiple: boolean;
|
|
27
|
+
maxFileSize?: number;
|
|
28
|
+
showValue: boolean;
|
|
21
29
|
formatDisplay?: InputFormat;
|
|
22
30
|
formatValue?: InputFormat;
|
|
23
31
|
formatOn: InputFormatOn;
|
|
@@ -27,6 +35,14 @@ export declare class MonoInputCoreInterface {
|
|
|
27
35
|
placeholder: string;
|
|
28
36
|
label: string;
|
|
29
37
|
helperText: string;
|
|
38
|
+
tooltip: FieldTooltipValue;
|
|
39
|
+
protected readonly _tooltip: FieldTooltipController;
|
|
40
|
+
protected readonly _validation: FieldValidationController;
|
|
41
|
+
protected get _validationNotice(): {
|
|
42
|
+
state: string;
|
|
43
|
+
text: string;
|
|
44
|
+
} | null;
|
|
45
|
+
protected _renderMovedMessage(): TemplateResult;
|
|
30
46
|
validationState: InputValidationState;
|
|
31
47
|
validationMessage: string;
|
|
32
48
|
error: boolean;
|
|
@@ -69,12 +85,16 @@ export declare class MonoInputCoreInterface {
|
|
|
69
85
|
protected readonly _resolvedValidationState: InputValidationState;
|
|
70
86
|
protected readonly _wrapperClasses: string;
|
|
71
87
|
protected readonly _fieldClasses: string;
|
|
88
|
+
protected readonly _isFile: boolean;
|
|
89
|
+
protected readonly _isRange: boolean;
|
|
72
90
|
protected _cls(base: string, key: keyof InputCssClass): string;
|
|
73
91
|
protected _sizeStyle(): ReturnType<typeof buildSizeStyle>;
|
|
74
92
|
protected _renderWrapper(inner: TemplateResult): TemplateResult;
|
|
75
93
|
protected _renderNative(): TemplateResult;
|
|
76
94
|
protected _renderClear(): TemplateResult | typeof nothing;
|
|
77
|
-
protected
|
|
95
|
+
protected _renderFileIcon(): TemplateResult | typeof nothing;
|
|
96
|
+
protected _renderRangeValue(where: 'label' | 'field'): TemplateResult | typeof nothing;
|
|
97
|
+
protected renderIcon(name: InputIconName): TemplateResult;
|
|
78
98
|
}
|
|
79
99
|
/**
|
|
80
100
|
* `MonoInputCore` — all render-mode-agnostic logic for `mono-input`: reactive
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { VisibilityProps } from "../../composables/visibility.js";
|
|
2
|
+
import { MonoTooltipOptions } from "../tooltip/tooltip-types.js";
|
|
2
3
|
import { InputFormat, InputFormatCtx, InputFormatOn } from "./input-format.js";
|
|
3
4
|
//#region src/components/input/input-types.d.ts
|
|
4
|
-
export type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'date' | 'time' | 'month' | 'week' | 'search';
|
|
5
|
+
export type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'date' | 'time' | 'month' | 'week' | 'search' | 'file' | 'range';
|
|
5
6
|
export type InputSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
6
7
|
export type InputVariant = 'outlined' | 'filled' | 'underlined';
|
|
8
|
+
/** Where the label sits: above the box (default), notched into its top border (inset for filled / underlined), or beside it. */
|
|
9
|
+
export type InputLabelPosition = 'top' | 'notched' | 'left' | 'right';
|
|
10
|
+
/** Where the validation message shows: under the box (default), behind a state icon inside it, or floating under it on hover / focus. */
|
|
11
|
+
export type InputValidationPosition = 'bottom' | 'icon' | 'float';
|
|
7
12
|
export type InputColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'teal' | 'purple' | 'neutral' | 'dark';
|
|
8
13
|
export type InputValidationState = 'default' | 'valid' | 'invalid' | 'warning';
|
|
14
|
+
/**
|
|
15
|
+
* What `modelValue` holds: the text for every text-like type; for `type="file"` the picked
|
|
16
|
+
* `File` (`null` when empty), or `File[]` with `multiple`.
|
|
17
|
+
*/
|
|
18
|
+
export type InputModelValue = string | File | File[] | null;
|
|
9
19
|
export type InputModelEventDetail = {
|
|
10
|
-
modelValue:
|
|
11
|
-
currentValue:
|
|
12
|
-
oldValue:
|
|
13
|
-
value:
|
|
20
|
+
modelValue: InputModelValue;
|
|
21
|
+
currentValue: InputModelValue;
|
|
22
|
+
oldValue: InputModelValue;
|
|
23
|
+
value: InputModelValue;
|
|
14
24
|
name?: string;
|
|
25
|
+
/** `type="file"` only — the picked files, always as an array. */
|
|
26
|
+
files?: File[];
|
|
15
27
|
sourceEvent?: Event;
|
|
16
28
|
/** What the field is SHOWING — differs from `value` once a `format-display` is set. */
|
|
17
29
|
displayValue?: string;
|
|
@@ -25,10 +37,23 @@ export interface InputCssClass {
|
|
|
25
37
|
native?: string;
|
|
26
38
|
clear?: string;
|
|
27
39
|
suffix?: string;
|
|
40
|
+
/** `type="file"` — the upload icon at the end of the field. */
|
|
41
|
+
fileIcon?: string;
|
|
42
|
+
/** `type="range"` — the value readout (end of the label row, or after the slider). */
|
|
43
|
+
rangeValue?: string;
|
|
28
44
|
messageWrap?: string;
|
|
29
45
|
message?: string;
|
|
30
46
|
}
|
|
31
47
|
export type InputModelEvent = CustomEvent<InputModelEventDetail>;
|
|
48
|
+
/** `type="file"` — a picked file was rejected (same shape as `mono-file-upload`'s `error`). */
|
|
49
|
+
export type InputFileErrorEventDetail = {
|
|
50
|
+
message: string;
|
|
51
|
+
reason: 'max-file-size';
|
|
52
|
+
file?: File;
|
|
53
|
+
maxFileSize?: number;
|
|
54
|
+
sourceEvent?: Event;
|
|
55
|
+
};
|
|
56
|
+
export type InputFileErrorEvent = CustomEvent<InputFileErrorEventDetail>;
|
|
32
57
|
export interface InputProps extends VisibilityProps {
|
|
33
58
|
/** Native input type controlling the field's behavior and keyboard. */
|
|
34
59
|
type?: InputType;
|
|
@@ -38,16 +63,54 @@ export interface InputProps extends VisibilityProps {
|
|
|
38
63
|
color?: InputColor;
|
|
39
64
|
/** Visual style of the field (outlined, filled, or underlined). */
|
|
40
65
|
variant?: InputVariant;
|
|
66
|
+
/**
|
|
67
|
+
* Where the label sits: `top` (above the box, default), `notched` (on the top
|
|
68
|
+
* border for outlined; inset inside the box for filled / underlined), or
|
|
69
|
+
* `left` / `right` of the box. Knobs: `--mono-input-label-width`, `-label-side-gap`,
|
|
70
|
+
* `-label-notch-font-size`, `-label-notch-bg`.
|
|
71
|
+
*/
|
|
72
|
+
labelPosition?: InputLabelPosition;
|
|
73
|
+
'label-position'?: InputLabelPosition;
|
|
74
|
+
labelposition?: InputLabelPosition;
|
|
75
|
+
/**
|
|
76
|
+
* Where the validation message shows. `bottom` (default): the row under the box.
|
|
77
|
+
* `icon`: a state icon inside the box; hover / tap / keyboard focus shows the message in
|
|
78
|
+
* a state-coloured bubble. `float`: the message floats under the box only while the field
|
|
79
|
+
* is hovered or focused. In `icon` / `float` the row under the box keeps the helper text.
|
|
80
|
+
*/
|
|
81
|
+
validationPosition?: InputValidationPosition;
|
|
82
|
+
'validation-position'?: InputValidationPosition;
|
|
83
|
+
validationposition?: InputValidationPosition;
|
|
41
84
|
/** Placeholder text shown when the field is empty. */
|
|
42
85
|
placeholder?: string;
|
|
43
86
|
/** Current input value. */
|
|
44
87
|
value?: string | number;
|
|
45
88
|
/** Form field name submitted with the input. */
|
|
46
89
|
name?: string;
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Two-way bound value for v-model-style usage. For `type="file"` it is the picked `File`
|
|
92
|
+
* (`null` when empty), or `File[]` with `multiple`.
|
|
93
|
+
*/
|
|
94
|
+
modelValue?: InputModelValue;
|
|
95
|
+
'model-value'?: InputModelValue;
|
|
96
|
+
modelvalue?: InputModelValue;
|
|
97
|
+
/** `type="file"` — the native `accept` filter (`"image/*,.pdf"`). */
|
|
98
|
+
accept?: string;
|
|
99
|
+
/** `type="file"` — allow picking several files; `modelValue` becomes `File[]`. */
|
|
100
|
+
multiple?: boolean;
|
|
101
|
+
/** `type="file"` — reject files larger than this many bytes (emits `error`). */
|
|
102
|
+
maxFileSize?: number;
|
|
103
|
+
'max-file-size'?: number;
|
|
104
|
+
maxfilesize?: number;
|
|
105
|
+
/**
|
|
106
|
+
* `type="range"` — show the current value beside the slider (default `true`): at the end of
|
|
107
|
+
* the label row, or after the slider when there is no label. It is drawn through
|
|
108
|
+
* `format-display`, so `format-display="Rp {}"` or a function shapes it. `show-value="false"`
|
|
109
|
+
* hides it.
|
|
110
|
+
*/
|
|
111
|
+
showValue?: boolean;
|
|
112
|
+
'show-value'?: boolean;
|
|
113
|
+
showvalue?: boolean;
|
|
51
114
|
/**
|
|
52
115
|
* How the field is DISPLAYED — a pattern (`#,##0.##`, `{}@gmail.com`) or a function.
|
|
53
116
|
* Never changes the value. A numeric pattern requires `type="text"`.
|
|
@@ -86,6 +149,14 @@ export interface InputProps extends VisibilityProps {
|
|
|
86
149
|
helperText?: string;
|
|
87
150
|
'helper-text'?: string;
|
|
88
151
|
helpertext?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Info icon at the end of the label; hovering, focusing or tapping it shows this text.
|
|
154
|
+
* Plain text → a small built-in bubble (no dependency). Full tooltip options
|
|
155
|
+
* (`:tooltip.prop="{ content, placement, color }"`) → a `mono-tooltip`, which needs the
|
|
156
|
+
* optional `@floating-ui/dom` + `@floating-ui/core` peers (without them that form renders
|
|
157
|
+
* no icon). Shown only beside a label.
|
|
158
|
+
*/
|
|
159
|
+
tooltip?: string | MonoTooltipOptions;
|
|
89
160
|
/** Explicit validation state for styling and messaging. */
|
|
90
161
|
validationState?: InputValidationState;
|
|
91
162
|
'validation-state'?: InputValidationState;
|
|
@@ -170,12 +241,16 @@ export interface InputEvents {
|
|
|
170
241
|
input: InputModelEvent;
|
|
171
242
|
change: InputModelEvent;
|
|
172
243
|
clear: InputModelEvent;
|
|
244
|
+
/** `type="file"` — a picked file was rejected. */
|
|
245
|
+
error: InputFileErrorEvent;
|
|
173
246
|
'mno-input': InputModelEvent;
|
|
174
247
|
mnoInput: InputModelEvent;
|
|
175
248
|
'mno-change': InputModelEvent;
|
|
176
249
|
mnoChange: InputModelEvent;
|
|
177
250
|
'mno-clear': InputModelEvent;
|
|
178
251
|
mnoClear: InputModelEvent;
|
|
252
|
+
'mno-error': InputFileErrorEvent;
|
|
253
|
+
mnoError: InputFileErrorEvent;
|
|
179
254
|
}
|
|
180
255
|
//#endregion
|
|
181
256
|
export type { InputFormat, InputFormatCtx, InputFormatOn };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
|
-
import { MonoInputCoreInterface } from "./input-core.js";
|
|
2
|
+
import { InputIconName, MonoInputCoreInterface } from "./input-core.js";
|
|
3
3
|
import { LitElement, TemplateResult } from "lit";
|
|
4
4
|
//#region src/components/input/mono-input.d.ts
|
|
5
5
|
declare const MonoInput_base: Constructor<MonoInputCoreInterface> & typeof LitElement;
|
|
@@ -36,9 +36,10 @@ export declare class MonoInput extends MonoInput_base {
|
|
|
36
36
|
disconnectedCallback(): void;
|
|
37
37
|
protected updated(changed: Map<string, unknown>): void;
|
|
38
38
|
private _placeSlot;
|
|
39
|
-
protected renderIcon(
|
|
39
|
+
protected renderIcon(name: InputIconName): TemplateResult;
|
|
40
40
|
private _renderLabel;
|
|
41
41
|
private _renderHelper;
|
|
42
|
+
private _renderHelperText;
|
|
42
43
|
protected render(): TemplateResult;
|
|
43
44
|
}
|
|
44
45
|
declare global {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
|
-
import { MonoInputCoreInterface } from "./input-core.js";
|
|
2
|
+
import { InputIconName, MonoInputCoreInterface } from "./input-core.js";
|
|
3
3
|
import { LitElement, TemplateResult } from "lit";
|
|
4
4
|
//#region src/components/input/mono-input.shadow.d.ts
|
|
5
5
|
declare const MonoInputShadow_base: Constructor<MonoInputCoreInterface> & typeof LitElement;
|
|
@@ -28,9 +28,10 @@ export declare class MonoInputShadow extends MonoInputShadow_base {
|
|
|
28
28
|
private _slotHasContent;
|
|
29
29
|
private _setSlotState;
|
|
30
30
|
private _onSlotChange;
|
|
31
|
-
protected renderIcon(
|
|
31
|
+
protected renderIcon(name: InputIconName): TemplateResult;
|
|
32
32
|
private _renderLabel;
|
|
33
33
|
private _renderHelper;
|
|
34
|
+
private _renderHelperText;
|
|
34
35
|
protected render(): TemplateResult;
|
|
35
36
|
connectedCallback(): void;
|
|
36
37
|
}
|
|
@@ -65,6 +65,7 @@ export declare class MonoModalCoreInterface implements PopupLayer {
|
|
|
65
65
|
get hasBackdrop(): boolean;
|
|
66
66
|
get pinnedZ(): number | undefined;
|
|
67
67
|
onStackEscape(event: KeyboardEvent): void;
|
|
68
|
+
containsEventPath(path: EventTarget[]): boolean;
|
|
68
69
|
setStackZ(z: number, isTopBackdrop: boolean): void;
|
|
69
70
|
protected _slotsCaptured: boolean;
|
|
70
71
|
protected _hasHeadSlotState: boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference path="../../../vue.d.ts" />
|
|
2
|
+
import { OtpColor, OtpCssClass, OtpEvents, OtpGroups, OtpLabelPosition, OtpModelEvent, OtpModelEventDetail, OtpProps, OtpSize, OtpType, OtpValidationPosition, OtpValidationState, OtpVariant } from "./otp-types.js";
|
|
3
|
+
import { MonoOtp } from "./mono-otp.js";
|
|
4
|
+
import { OTP_DEFAULT_LENGTH, OtpEdit, backspaceOtp, clampCaret, normaliseOtpValue, parseOtpGroups, removeOtpChar, resolveOtpLength, sanitizeOtpChar, sanitizeOtpText, spliceOtpValue } from "./otp-utils.js";
|
|
5
|
+
export { MonoOtp, OTP_DEFAULT_LENGTH, type OtpColor, type OtpCssClass, type OtpEdit, type OtpEvents, type OtpGroups, type OtpLabelPosition, type OtpModelEvent, type OtpModelEventDetail, type OtpProps, type OtpSize, type OtpType, type OtpValidationPosition, type OtpValidationState, type OtpVariant, backspaceOtp, clampCaret, normaliseOtpValue, parseOtpGroups, removeOtpChar, resolveOtpLength, sanitizeOtpChar, sanitizeOtpText, spliceOtpValue };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference path="../../../vue.d.ts" />
|
|
2
|
+
import { OtpColor, OtpCssClass, OtpEvents, OtpGroups, OtpLabelPosition, OtpModelEvent, OtpModelEventDetail, OtpProps, OtpSize, OtpType, OtpValidationPosition, OtpValidationState, OtpVariant } from "./otp-types.js";
|
|
3
|
+
import { MonoOtpCore, OtpSlotName } from "./otp-core.js";
|
|
4
|
+
import { OTP_DEFAULT_LENGTH, OtpEdit, backspaceOtp, clampCaret, normaliseOtpValue, parseOtpGroups, removeOtpChar, resolveOtpLength, sanitizeOtpChar, sanitizeOtpText, spliceOtpValue } from "./otp-utils.js";
|
|
5
|
+
import { MonoOtpShadow } from "./mono-otp.shadow.js";
|
|
6
|
+
export { MonoOtpCore, MonoOtpShadow, OTP_DEFAULT_LENGTH, type OtpColor, type OtpCssClass, type OtpEdit, type OtpEvents, type OtpGroups, type OtpLabelPosition, type OtpModelEvent, type OtpModelEventDetail, type OtpProps, type OtpSize, type OtpSlotName, type OtpType, type OtpValidationPosition, type OtpValidationState, type OtpVariant, backspaceOtp, clampCaret, normaliseOtpValue, parseOtpGroups, removeOtpChar, resolveOtpLength, sanitizeOtpChar, sanitizeOtpText, spliceOtpValue };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
|
+
import { MonoOtpCoreInterface, OtpIconName } from "./otp-core.js";
|
|
3
|
+
import { LitElement, TemplateResult } from "lit";
|
|
4
|
+
//#region src/components/otp/mono-otp.d.ts
|
|
5
|
+
declare const MonoOtp_base: Constructor<MonoOtpCoreInterface> & typeof LitElement;
|
|
6
|
+
/**
|
|
7
|
+
* Light-DOM `mono-otp` (default build, `@mono-lit/helper/ui/otp`).
|
|
8
|
+
*
|
|
9
|
+
* Renders into the host (styled by the global `dist/ui/index.css`). `slot="prefix|suffix|label|helper"`
|
|
10
|
+
* children are captured on connect and re-placed into `[data-mono-slot]` placeholders after each
|
|
11
|
+
* render — the same strategy as mono-input. Everything else lives in `MonoOtpCore`; the shadow
|
|
12
|
+
* build (`mono-shadow-otp`) shares it with native `<slot>`s.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MonoOtp extends MonoOtp_base {
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
protected createRenderRoot(): HTMLElement;
|
|
17
|
+
private _slots;
|
|
18
|
+
private _slotObserver?;
|
|
19
|
+
/** Capture `slot="…"` children. Safe to re-run: captured nodes lose `slot` and leave the host. */
|
|
20
|
+
private _captureSlots;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
24
|
+
protected renderIcon(_name: OtpIconName): TemplateResult;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'mono-otp': MonoOtp;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Constructor } from "../../composables/hybird-prop.js";
|
|
2
|
+
import { MonoOtpCoreInterface, OtpIconName } from "./otp-core.js";
|
|
3
|
+
import { LitElement, TemplateResult } from "lit";
|
|
4
|
+
//#region src/components/otp/mono-otp.shadow.d.ts
|
|
5
|
+
declare const MonoOtpShadow_base: Constructor<MonoOtpCoreInterface> & typeof LitElement;
|
|
6
|
+
/**
|
|
7
|
+
* Shadow-DOM `mono-otp` (SSR build, `@mono-lit/helper/ui/shadow/otp`, tag `mono-shadow-otp`).
|
|
8
|
+
*
|
|
9
|
+
* Shares every behaviour with the light build through `MonoOtpCore`; only the slot regions
|
|
10
|
+
* differ: native `<slot name="prefix|suffix|label|helper">` (label / helper carry the prop text as
|
|
11
|
+
* fallback). Slot presence is unknown during SSR, so both sides default to "empty" and
|
|
12
|
+
* `firstUpdated()` scans the assigned nodes (Declarative Shadow DOM assigns slotted content at
|
|
13
|
+
* parse time, so `slotchange` never fires after hydration — same as mono-input).
|
|
14
|
+
*/
|
|
15
|
+
export declare class MonoOtpShadow extends MonoOtpShadow_base {
|
|
16
|
+
static styles: import("lit").CSSResult[];
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
firstUpdated(changed: Map<string, unknown>): void;
|
|
19
|
+
private _slotHasContent;
|
|
20
|
+
private _setSlotState;
|
|
21
|
+
private _onSlotChange;
|
|
22
|
+
protected _renderLabelText(): TemplateResult;
|
|
23
|
+
/** Always rendered (the slot must exist to be scanned); hidden with `mono-empty` when empty. */
|
|
24
|
+
protected _renderLabel(): TemplateResult;
|
|
25
|
+
protected _renderHelperText(base: string): TemplateResult;
|
|
26
|
+
protected _renderAffix(name: 'prefix' | 'suffix'): TemplateResult;
|
|
27
|
+
protected renderIcon(_name: OtpIconName): TemplateResult;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export {};
|