@webx-ui/core 0.0.1 → 0.1.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 (70) hide show
  1. package/LICENSE +21 -21
  2. package/dist/components/Card/Card.d.ts +3 -1
  3. package/dist/components/Card/types.d.ts +2 -2
  4. package/dist/components/Checkbox/Checkbox.d.ts +41 -0
  5. package/dist/components/Checkbox/index.d.ts +2 -0
  6. package/dist/components/Checkbox/types.d.ts +18 -0
  7. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +37 -0
  8. package/dist/components/CheckboxGroup/index.d.ts +2 -0
  9. package/dist/components/CheckboxGroup/types.d.ts +23 -0
  10. package/dist/components/ColorPicker/ColorPicker.d.ts +25 -0
  11. package/dist/components/ColorPicker/index.d.ts +2 -0
  12. package/dist/components/ColorPicker/types.d.ts +21 -0
  13. package/dist/components/DatePicker/DatePicker.d.ts +54 -0
  14. package/dist/components/DatePicker/index.d.ts +2 -0
  15. package/dist/components/DatePicker/types.d.ts +47 -0
  16. package/dist/components/DateRangePicker/DateRangePicker.d.ts +51 -0
  17. package/dist/components/DateRangePicker/index.d.ts +2 -0
  18. package/dist/components/DateRangePicker/types.d.ts +37 -0
  19. package/dist/components/DateTimePicker/DateTimePicker.d.ts +52 -0
  20. package/dist/components/DateTimePicker/index.d.ts +1 -0
  21. package/dist/components/Form/Form.d.ts +32 -0
  22. package/dist/components/Form/index.d.ts +2 -0
  23. package/dist/components/Form/types.d.ts +22 -0
  24. package/dist/components/FormItem/FormItem.d.ts +33 -0
  25. package/dist/components/FormItem/index.d.ts +2 -0
  26. package/dist/components/FormItem/types.d.ts +24 -0
  27. package/dist/components/Input/Input.d.ts +11 -10
  28. package/dist/components/Input/types.d.ts +2 -0
  29. package/dist/components/InputNumber/InputNumber.d.ts +41 -0
  30. package/dist/components/InputNumber/index.d.ts +2 -0
  31. package/dist/components/InputNumber/types.d.ts +34 -0
  32. package/dist/components/Radio/Radio.d.ts +36 -0
  33. package/dist/components/Radio/index.d.ts +2 -0
  34. package/dist/components/Radio/types.d.ts +16 -0
  35. package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
  36. package/dist/components/RadioGroup/index.d.ts +2 -0
  37. package/dist/components/RadioGroup/types.d.ts +19 -0
  38. package/dist/components/Rate/Rate.d.ts +24 -0
  39. package/dist/components/Rate/index.d.ts +2 -0
  40. package/dist/components/Rate/types.d.ts +22 -0
  41. package/dist/components/RichText/RichText.d.ts +38 -0
  42. package/dist/components/RichText/ToolbarButton.d.ts +20 -0
  43. package/dist/components/RichText/icons.d.ts +6 -0
  44. package/dist/components/RichText/index.d.ts +2 -0
  45. package/dist/components/RichText/tools.d.ts +48 -0
  46. package/dist/components/RichText/types.d.ts +42 -0
  47. package/dist/components/Select/Select.d.ts +50 -0
  48. package/dist/components/Select/index.d.ts +2 -0
  49. package/dist/components/Select/types.d.ts +41 -0
  50. package/dist/components/Slider/Slider.d.ts +26 -0
  51. package/dist/components/Slider/index.d.ts +2 -0
  52. package/dist/components/Slider/types.d.ts +24 -0
  53. package/dist/components/Switch/Switch.d.ts +38 -0
  54. package/dist/components/Switch/index.d.ts +2 -0
  55. package/dist/components/Switch/types.d.ts +18 -0
  56. package/dist/components/TagsInput/TagsInput.d.ts +32 -0
  57. package/dist/components/TagsInput/index.d.ts +2 -0
  58. package/dist/components/TagsInput/types.d.ts +26 -0
  59. package/dist/components/Textarea/Textarea.d.ts +39 -0
  60. package/dist/components/Textarea/index.d.ts +2 -0
  61. package/dist/components/Textarea/types.d.ts +31 -0
  62. package/dist/components/TimePicker/TimePicker.d.ts +52 -0
  63. package/dist/components/TimePicker/index.d.ts +1 -0
  64. package/dist/components/index.d.ts +20 -1
  65. package/dist/composables/useFormField.d.ts +64 -0
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.js +2418 -164
  68. package/dist/index.js.map +1 -1
  69. package/dist/style.css +1 -1
  70. package/package.json +12 -2
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 webx-ui
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 webx-ui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -4,6 +4,8 @@ declare function __VLS_template(): {
4
4
  slots: {
5
5
  header?(_: {}): any;
6
6
  extra?(_: {}): any;
7
+ sidebar?(_: {}): any;
8
+ default?(_: {}): any;
7
9
  default?(_: {}): any;
8
10
  footer?(_: {}): any;
9
11
  };
@@ -15,7 +17,7 @@ declare const __VLS_component: import('vue').DefineComponent<CardProps, {}, {},
15
17
  title: string;
16
18
  shadow: import('./types').CardShadow;
17
19
  padding: import('./types').CardPadding;
18
- borderless: boolean;
20
+ bordered: boolean;
19
21
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
20
22
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
23
  export default _default;
@@ -7,6 +7,6 @@ export interface CardProps {
7
7
  shadow?: CardShadow;
8
8
  /** Inner padding of the body (and of header/footer). */
9
9
  padding?: CardPadding;
10
- /** Removes the outer border, keeping only the surface colour. */
11
- borderless?: boolean;
10
+ /** Adds an outline. Cards are borderless by default and separate by shadow alone. */
11
+ bordered?: boolean;
12
12
  }
@@ -0,0 +1,41 @@
1
+ import { CheckboxProps } from './types';
2
+ type __VLS_Props = CheckboxProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: boolean;
5
+ } & __VLS_Props;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {
12
+ inputRef: HTMLInputElement;
13
+ };
14
+ rootEl: any;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ change: (checked: boolean) => any;
19
+ "update:modelValue": (value: boolean) => any;
20
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
+ onChange?: ((checked: boolean) => any) | undefined;
22
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
23
+ }>, {
24
+ name: string;
25
+ size: import('../..').ControlSize;
26
+ disabled: boolean;
27
+ label: string;
28
+ value: import('../../composables/useFormField').ChoiceValue;
29
+ indeterminate: boolean;
30
+ id: string;
31
+ ariaLabel: string;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
33
+ inputRef: HTMLInputElement;
34
+ }, any>;
35
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
36
+ export default _default;
37
+ type __VLS_WithTemplateSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxCheckbox } from './Checkbox';
2
+ export type * from './types';
@@ -0,0 +1,18 @@
1
+ import { ChoiceValue, ControlSize } from '../../composables/useFormField';
2
+ export interface CheckboxProps {
3
+ /** Value contributed to a `WxCheckboxGroup`. Ignored when used standalone. */
4
+ value?: ChoiceValue;
5
+ /** Label text. Use the default slot for anything richer. */
6
+ label?: string;
7
+ /** Third visual state: neither checked nor unchecked. */
8
+ indeterminate?: boolean;
9
+ disabled?: boolean;
10
+ size?: ControlSize;
11
+ id?: string;
12
+ name?: string;
13
+ /** Accessible label used when there is no visible one. */
14
+ ariaLabel?: string;
15
+ }
16
+ export interface CheckboxEmits {
17
+ change: [checked: boolean];
18
+ }
@@ -0,0 +1,37 @@
1
+ import { ChoiceValue } from '../../composables/useFormField';
2
+ import { CheckboxGroupProps } from './types';
3
+ type __VLS_Props = CheckboxGroupProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: ChoiceValue[];
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ change: (value: ChoiceValue[]) => any;
18
+ "update:modelValue": (value: ChoiceValue[]) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onChange?: ((value: ChoiceValue[]) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((value: ChoiceValue[]) => any) | undefined;
22
+ }>, {
23
+ name: string;
24
+ size: import('../..').ControlSize;
25
+ disabled: boolean;
26
+ options: import('./types').CheckboxOption[];
27
+ inline: boolean;
28
+ min: number;
29
+ max: number;
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
31
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
32
+ export default _default;
33
+ type __VLS_WithTemplateSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxCheckboxGroup } from './CheckboxGroup';
2
+ export type * from './types';
@@ -0,0 +1,23 @@
1
+ import { ChoiceValue, ControlSize } from '../../composables/useFormField';
2
+ export interface CheckboxOption {
3
+ label: string;
4
+ value: ChoiceValue;
5
+ disabled?: boolean;
6
+ }
7
+ export interface CheckboxGroupProps {
8
+ /** Renders the children for you. Omit it and pass `WxCheckbox`es in the slot instead. */
9
+ options?: CheckboxOption[];
10
+ disabled?: boolean;
11
+ size?: ControlSize;
12
+ /** Shared `name` for the underlying inputs. */
13
+ name?: string;
14
+ /** Lay the boxes out in a row instead of a column. */
15
+ inline?: boolean;
16
+ /** Smallest number of checked values the user may end up with. */
17
+ min?: number;
18
+ /** Largest number of checked values the user may end up with. */
19
+ max?: number;
20
+ }
21
+ export interface CheckboxGroupEmits {
22
+ change: [value: ChoiceValue[]];
23
+ }
@@ -0,0 +1,25 @@
1
+ import { ColorPickerProps } from './types';
2
+ type __VLS_Props = ColorPickerProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: string | null;
5
+ } & __VLS_Props;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ change: (value: string | null) => any;
8
+ "update:modelValue": (value: string | null) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
10
+ onChange?: ((value: string | null) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
12
+ }>, {
13
+ name: string;
14
+ size: import('../..').ControlSize;
15
+ disabled: boolean;
16
+ id: string;
17
+ ariaLabel: string;
18
+ presets: string[];
19
+ clearable: boolean;
20
+ placeholder: string;
21
+ teleport: boolean;
22
+ readonly: boolean;
23
+ status: import('../..').ControlStatus;
24
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as WxColorPicker } from './ColorPicker';
2
+ export type * from './types';
@@ -0,0 +1,21 @@
1
+ import { ControlSize, ControlStatus } from '../../composables/useFormField';
2
+ export interface ColorPickerProps {
3
+ /** Swatches offered under the picker, as hex strings. */
4
+ presets?: string[];
5
+ /** Show a button that empties the field. */
6
+ clearable?: boolean;
7
+ placeholder?: string;
8
+ /** Render the panel in a portal so it escapes `overflow: hidden`. */
9
+ teleport?: boolean;
10
+ disabled?: boolean;
11
+ readonly?: boolean;
12
+ size?: ControlSize;
13
+ status?: ControlStatus;
14
+ id?: string;
15
+ name?: string;
16
+ /** Accessible label used when the field has no visible `<label>`. */
17
+ ariaLabel?: string;
18
+ }
19
+ export interface ColorPickerEmits {
20
+ change: [value: string | null];
21
+ }
@@ -0,0 +1,54 @@
1
+ import { DatePickerModelValue, DatePickerProps } from './types';
2
+ type __VLS_Props = DatePickerProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: DatePickerModelValue;
5
+ } & __VLS_Props;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: any;
9
+ refs: {};
10
+ rootEl: any;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ change: (value: DatePickerModelValue) => any;
15
+ "update:modelValue": (value: DatePickerModelValue) => any;
16
+ open: () => any;
17
+ clear: () => any;
18
+ close: () => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onChange?: ((value: DatePickerModelValue) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((value: DatePickerModelValue) => any) | undefined;
22
+ onOpen?: (() => any) | undefined;
23
+ onClear?: (() => any) | undefined;
24
+ onClose?: (() => any) | undefined;
25
+ }>, {
26
+ name: string;
27
+ type: import('./types').DatePickerType;
28
+ size: import('../..').ControlSize;
29
+ disabled: boolean;
30
+ id: string;
31
+ ariaLabel: string;
32
+ clearable: boolean;
33
+ placeholder: string;
34
+ teleport: boolean | string;
35
+ readonly: boolean;
36
+ status: import('../..').ControlStatus;
37
+ valueFormat: string;
38
+ format: string;
39
+ minDate: string | Date;
40
+ maxDate: string | Date;
41
+ seconds: boolean;
42
+ minutesIncrement: number;
43
+ is24: boolean;
44
+ weekStart: number;
45
+ autoApply: boolean;
46
+ textInput: boolean;
47
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
48
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
49
+ export default _default;
50
+ type __VLS_WithTemplateSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxDatePicker } from './DatePicker';
2
+ export type * from './types';
@@ -0,0 +1,47 @@
1
+ import { ControlSize, ControlStatus } from '../../composables/useFormField';
2
+ export type DatePickerType = 'date' | 'datetime' | 'time';
3
+ export type DatePickerModelValue = string | Date | null;
4
+ export interface DatePickerProps {
5
+ /** What the picker asks for. `WxTimePicker` and `WxDateTimePicker` are presets of this. */
6
+ type?: DatePickerType;
7
+ /**
8
+ * Format the value is *stored* in. Defaults to what a Laravel column expects:
9
+ * `yyyy-MM-dd`, `yyyy-MM-dd HH:mm:ss` or `HH:mm:ss`. Pass `'date'` to keep the
10
+ * model as a `Date` object instead of a string.
11
+ */
12
+ valueFormat?: string;
13
+ /** Format the value is *shown* in. Defaults to `dd.MM.yyyy`, plus the time part. */
14
+ format?: string;
15
+ placeholder?: string;
16
+ clearable?: boolean;
17
+ minDate?: string | Date;
18
+ maxDate?: string | Date;
19
+ /** Include seconds in the time part. */
20
+ seconds?: boolean;
21
+ /** Step of the minutes column. */
22
+ minutesIncrement?: number;
23
+ /** 24-hour clock. Off means AM/PM. */
24
+ is24?: boolean;
25
+ /** First day of the week: 0 is Sunday, 1 is Monday. */
26
+ weekStart?: number;
27
+ /** Apply the value as soon as it is picked, with no confirm button. */
28
+ autoApply?: boolean;
29
+ /** Let the value be typed as well as picked. */
30
+ textInput?: boolean;
31
+ /** Render the menu in a portal so it escapes `overflow: hidden` containers. */
32
+ teleport?: boolean | string;
33
+ disabled?: boolean;
34
+ readonly?: boolean;
35
+ size?: ControlSize;
36
+ status?: ControlStatus;
37
+ id?: string;
38
+ name?: string;
39
+ /** Accessible label used when the field has no visible `<label>`. */
40
+ ariaLabel?: string;
41
+ }
42
+ export interface DatePickerEmits {
43
+ change: [value: DatePickerModelValue];
44
+ clear: [];
45
+ open: [];
46
+ close: [];
47
+ }
@@ -0,0 +1,51 @@
1
+ import { DateRangePickerModelValue, DateRangePickerProps } from './types';
2
+ type __VLS_Props = DateRangePickerProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: DateRangePickerModelValue;
5
+ } & __VLS_Props;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: any;
9
+ refs: {};
10
+ rootEl: any;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ change: (value: DateRangePickerModelValue) => any;
15
+ "update:modelValue": (value: DateRangePickerModelValue) => any;
16
+ open: () => any;
17
+ clear: () => any;
18
+ close: () => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onChange?: ((value: DateRangePickerModelValue) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((value: DateRangePickerModelValue) => any) | undefined;
22
+ onOpen?: (() => any) | undefined;
23
+ onClear?: (() => any) | undefined;
24
+ onClose?: (() => any) | undefined;
25
+ }>, {
26
+ name: string;
27
+ size: import('../..').ControlSize;
28
+ disabled: boolean;
29
+ id: string;
30
+ ariaLabel: string;
31
+ clearable: boolean;
32
+ placeholder: string;
33
+ teleport: boolean;
34
+ readonly: boolean;
35
+ status: import('../..').ControlStatus;
36
+ valueFormat: string;
37
+ format: string;
38
+ minDate: string | Date;
39
+ maxDate: string | Date;
40
+ weekStart: number;
41
+ autoApply: boolean;
42
+ textInput: boolean;
43
+ months: number;
44
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
45
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
46
+ export default _default;
47
+ type __VLS_WithTemplateSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxDateRangePicker } from './DateRangePicker';
2
+ export type * from './types';
@@ -0,0 +1,37 @@
1
+ import { ControlSize, ControlStatus } from '../../composables/useFormField';
2
+ /** `[start, end]`, or `null` while nothing is picked. */
3
+ export type DateRangePickerModelValue = string[] | Date[] | null;
4
+ export interface DateRangePickerProps {
5
+ /** Format each end is stored in. Defaults to `yyyy-MM-dd`; `'date'` keeps `Date` objects. */
6
+ valueFormat?: string;
7
+ /** Format the field shows. */
8
+ format?: string;
9
+ placeholder?: string;
10
+ clearable?: boolean;
11
+ minDate?: string | Date;
12
+ maxDate?: string | Date;
13
+ /** How many months to show side by side. Two makes picking across a boundary easy. */
14
+ months?: number;
15
+ /** First day of the week: 0 is Sunday, 1 is Monday. */
16
+ weekStart?: number;
17
+ /** Apply as soon as the second date is picked, with no confirm button. */
18
+ autoApply?: boolean;
19
+ /** Let the range be typed as well as picked. */
20
+ textInput?: boolean;
21
+ /** Render the calendar in a portal so it escapes `overflow: hidden`. */
22
+ teleport?: boolean;
23
+ disabled?: boolean;
24
+ readonly?: boolean;
25
+ size?: ControlSize;
26
+ status?: ControlStatus;
27
+ id?: string;
28
+ name?: string;
29
+ /** Accessible label used when the field has no visible `<label>`. */
30
+ ariaLabel?: string;
31
+ }
32
+ export interface DateRangePickerEmits {
33
+ change: [value: DateRangePickerModelValue];
34
+ clear: [];
35
+ open: [];
36
+ close: [];
37
+ }
@@ -0,0 +1,52 @@
1
+ import { DatePickerModelValue, DatePickerProps } from '../DatePicker/types';
2
+ /**
3
+ * Every prop defaults to `undefined` on purpose. Vue casts an absent boolean prop
4
+ * to `false`, and this preset forwards its whole prop object — without these the
5
+ * preset would hand `WxDatePicker` an explicit `false` for `is24`, `clearable`,
6
+ * `autoApply` and `teleport`, overriding that component's own defaults. Passing
7
+ * `undefined` lets each default apply as if the prop had never been written.
8
+ */
9
+ type __VLS_Props = Omit<DatePickerProps, 'type'>;
10
+ type __VLS_PublicProps = {
11
+ modelValue?: DatePickerModelValue;
12
+ } & __VLS_Props;
13
+ declare function __VLS_template(): {
14
+ attrs: Partial<{}>;
15
+ slots: any;
16
+ refs: {};
17
+ rootEl: any;
18
+ };
19
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
21
+ "update:modelValue": (value: DatePickerModelValue) => any;
22
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:modelValue"?: ((value: DatePickerModelValue) => any) | undefined;
24
+ }>, {
25
+ name: string;
26
+ size: import('../..').ControlSize;
27
+ disabled: boolean;
28
+ id: string;
29
+ ariaLabel: string;
30
+ clearable: boolean;
31
+ placeholder: string;
32
+ teleport: boolean | string;
33
+ readonly: boolean;
34
+ status: import('../..').ControlStatus;
35
+ valueFormat: string;
36
+ format: string;
37
+ minDate: string | Date;
38
+ maxDate: string | Date;
39
+ seconds: boolean;
40
+ minutesIncrement: number;
41
+ is24: boolean;
42
+ weekStart: number;
43
+ autoApply: boolean;
44
+ textInput: boolean;
45
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
46
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
47
+ export default _default;
48
+ type __VLS_WithTemplateSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1 @@
1
+ export { default as WxDateTimePicker } from './DateTimePicker';
@@ -0,0 +1,32 @@
1
+ import { ValidationErrors } from '../../composables/useFormField';
2
+ import { FormProps } from './types';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: {
6
+ default?(_: {}): any;
7
+ };
8
+ refs: {};
9
+ rootEl: HTMLFormElement;
10
+ };
11
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
+ declare const __VLS_component: import('vue').DefineComponent<FormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ submit: (event: SubmitEvent) => any;
14
+ reset: (event: Event) => any;
15
+ }, string, import('vue').PublicProps, Readonly<FormProps> & Readonly<{
16
+ onSubmit?: ((event: SubmitEvent) => any) | undefined;
17
+ onReset?: ((event: Event) => any) | undefined;
18
+ }>, {
19
+ size: import('../..').ControlSize;
20
+ disabled: boolean;
21
+ errors: ValidationErrors;
22
+ labelPosition: "top" | "left";
23
+ labelWidth: string;
24
+ gap: "sm" | "md" | "lg";
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLFormElement>;
26
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
27
+ export default _default;
28
+ type __VLS_WithTemplateSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxForm } from './Form';
2
+ export type * from './types';
@@ -0,0 +1,22 @@
1
+ import { ControlSize, ValidationErrors } from '../../composables/useFormField';
2
+ export interface FormProps {
3
+ /**
4
+ * Server-side validation errors, keyed by field name — the shape Laravel's 422
5
+ * responses use. `WxFormItem` picks up the messages for its own `name`.
6
+ */
7
+ errors?: ValidationErrors;
8
+ /** Disables every control inside the form. */
9
+ disabled?: boolean;
10
+ /** Default size for controls that do not set their own. */
11
+ size?: ControlSize;
12
+ /** Where labels sit relative to their control. */
13
+ labelPosition?: 'top' | 'left';
14
+ /** Label column width when `labelPosition` is `left`, e.g. `"160px"`. */
15
+ labelWidth?: string;
16
+ /** Space between form items. */
17
+ gap?: 'sm' | 'md' | 'lg';
18
+ }
19
+ export interface FormEmits {
20
+ submit: [event: SubmitEvent];
21
+ reset: [event: Event];
22
+ }
@@ -0,0 +1,33 @@
1
+ import { ControlSize } from '../../composables/useFormField';
2
+ import { FormItemProps } from './types';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: {
6
+ label?(_: {}): any;
7
+ default?(_: {}): any;
8
+ };
9
+ refs: {};
10
+ rootEl: HTMLDivElement;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<FormItemProps, {
14
+ messages: import('vue').ComputedRef<string[]>;
15
+ hasError: import('vue').ComputedRef<boolean>;
16
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FormItemProps> & Readonly<{}>, {
17
+ name: string;
18
+ size: ControlSize;
19
+ disabled: boolean;
20
+ label: string;
21
+ error: string | string[];
22
+ required: boolean;
23
+ labelWidth: string;
24
+ help: string;
25
+ reserveErrorSpace: boolean;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
27
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
+ export default _default;
29
+ type __VLS_WithTemplateSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxFormItem } from './FormItem';
2
+ export type * from './types';
@@ -0,0 +1,24 @@
1
+ import { ControlSize } from '../../composables/useFormField';
2
+ export interface FormItemProps {
3
+ /** Visible label. Use the `label` slot for anything richer than text. */
4
+ label?: string;
5
+ /**
6
+ * Field name. When the enclosing `WxForm` has `errors`, messages for this name
7
+ * are shown automatically.
8
+ */
9
+ name?: string;
10
+ /** Marks the label with an asterisk. Does not validate anything by itself. */
11
+ required?: boolean;
12
+ /** Error message(s) shown under the control; overrides the form's errors. */
13
+ error?: string | string[];
14
+ /** Hint shown under the control while there is no error. */
15
+ help?: string;
16
+ /** Disables every control inside this item. */
17
+ disabled?: boolean;
18
+ /** Size for controls inside this item. */
19
+ size?: ControlSize;
20
+ /** Label column width when the form uses `labelPosition="left"`. */
21
+ labelWidth?: string;
22
+ /** Renders the error slot area even when empty, so rows do not jump. */
23
+ reserveErrorSpace?: boolean;
24
+ }