@cocoar/vue-ui 2.12.0 → 2.13.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.
@@ -0,0 +1,29 @@
1
+ import { Ref } from 'vue';
2
+ import { Temporal } from '@js-temporal/polyfill';
3
+ /**
4
+ * Conversion hooks for an "either a date, or a date-with-time" picker. The
5
+ * date side is always a `Temporal.PlainDate`; `TDateTime` is the with-time type
6
+ * (`ZonedDateTime` or `PlainDateTime`) supplied by the concrete component.
7
+ */
8
+ export interface DateOrTimeConverters<TDateTime> {
9
+ /** Runtime type-guard separating the date-time value from a plain date. */
10
+ isDateTime: (value: unknown) => value is TDateTime;
11
+ /** Promote a date to a date-time (e.g. attach a default time / zone). */
12
+ toDateTime: (date: Temporal.PlainDate) => TDateTime;
13
+ /** Drop the time (and zone) back to a plain date. */
14
+ toDate: (dateTime: TDateTime) => Temporal.PlainDate;
15
+ }
16
+ /**
17
+ * Shared state for `CoarZonedDateTimeOrDatePicker` / `CoarPlainDateTimeOrDatePicker`.
18
+ * Keeps a single union `modelValue` (`PlainDate | TDateTime | null`) and a
19
+ * `withTime` flag in sync, splits the value for the two child pickers, and
20
+ * converts it when the clock toggle flips the mode.
21
+ */
22
+ export declare function useDateOrTime<TDateTime>(modelValue: Ref<Temporal.PlainDate | TDateTime | null>, withTime: Ref<boolean>, conv: DateOrTimeConverters<TDateTime>): {
23
+ dateValue: import('vue').ComputedRef<Temporal.PlainDate | null>;
24
+ dateTimeValue: import('vue').ComputedRef<TDateTime | null>;
25
+ setDate: (value: Temporal.PlainDate | null) => void;
26
+ setDateTime: (value: TDateTime | null) => void;
27
+ toggle: () => void;
28
+ };
29
+ //# sourceMappingURL=use-date-or-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-date-or-time.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/_shared/use-date-or-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,SAAS;IAC7C,2EAA2E;IAC3E,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,SAAS,CAAC;IACnD,yEAAyE;IACzE,UAAU,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,KAAK,SAAS,CAAC;IACpD,qDAAqD;IACrD,MAAM,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,QAAQ,CAAC,SAAS,CAAC;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EACrC,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC,EACtD,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EACtB,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC;;;qBAsBb,QAAQ,CAAC,SAAS,GAAG,IAAI,KAAG,IAAI;yBAG5B,SAAS,GAAG,IAAI,KAAG,IAAI;kBAKhC,IAAI;EAgBxB"}
@@ -0,0 +1,54 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ export type CoarPlainDateTimeOrDatePickerSize = 'xs' | 's' | 'm' | 'l';
3
+ type __VLS_Props = {
4
+ placeholder?: string;
5
+ size?: CoarPlainDateTimeOrDatePickerSize;
6
+ disabled?: boolean;
7
+ readonly?: boolean;
8
+ required?: boolean;
9
+ error?: boolean;
10
+ clearable?: boolean;
11
+ locale?: string;
12
+ /** Min/max are given as the with-time type; the date mode uses their date part. */
13
+ min?: Temporal.PlainDateTime | null;
14
+ max?: Temporal.PlainDateTime | null;
15
+ minuteStep?: 1 | 5 | 10 | 15;
16
+ /** Clock toggle side, relative to the input. */
17
+ togglePosition?: 'start' | 'end';
18
+ /** Tooltip + accessible label for the toggle while time is OFF (adds time). */
19
+ addTimeLabel?: string;
20
+ /** Tooltip + accessible label for the toggle while time is ON (removes time). */
21
+ removeTimeLabel?: string;
22
+ };
23
+ type __VLS_PublicProps = {
24
+ modelValue?: Temporal.PlainDateTime | Temporal.PlainDate | null;
25
+ 'withTime'?: boolean;
26
+ } & __VLS_Props;
27
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
+ closed: () => any;
29
+ "update:modelValue": (value: Temporal.PlainDate | Temporal.PlainDateTime | null) => any;
30
+ opened: () => any;
31
+ "update:withTime": (value: boolean) => any;
32
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
33
+ onClosed?: (() => any) | undefined;
34
+ "onUpdate:modelValue"?: ((value: Temporal.PlainDate | Temporal.PlainDateTime | null) => any) | undefined;
35
+ onOpened?: (() => any) | undefined;
36
+ "onUpdate:withTime"?: ((value: boolean) => any) | undefined;
37
+ }>, {
38
+ error: boolean;
39
+ size: CoarPlainDateTimeOrDatePickerSize;
40
+ required: boolean;
41
+ disabled: boolean;
42
+ placeholder: string;
43
+ max: Temporal.PlainDateTime | null;
44
+ readonly: boolean;
45
+ clearable: boolean;
46
+ min: Temporal.PlainDateTime | null;
47
+ locale: string;
48
+ minuteStep: 1 | 5 | 10 | 15;
49
+ togglePosition: "start" | "end";
50
+ addTimeLabel: string;
51
+ removeTimeLabel: string;
52
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
53
+ export default _default;
54
+ //# sourceMappingURL=CoarPlainDateTimeOrDatePicker.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoarPlainDateTimeOrDatePicker.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/plain-date-time-or-date-picker/CoarPlainDateTimeOrDatePicker.vue"],"names":[],"mappings":"AAkKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjD,OAAO,6B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,GAAG,KAAK;kBAEjB,MAAM;qBAEH,MAAM;;AAqR5B,wBASG"}
@@ -0,0 +1,3 @@
1
+ export { default as CoarPlainDateTimeOrDatePicker } from './CoarPlainDateTimeOrDatePicker.vue';
2
+ export type { CoarPlainDateTimeOrDatePickerSize } from './CoarPlainDateTimeOrDatePicker.vue';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/plain-date-time-or-date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAC/F,YAAY,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ export type CoarZonedDateTimeOrDatePickerSize = 'xs' | 's' | 'm' | 'l';
3
+ type __VLS_Props = {
4
+ placeholder?: string;
5
+ size?: CoarZonedDateTimeOrDatePickerSize;
6
+ disabled?: boolean;
7
+ readonly?: boolean;
8
+ required?: boolean;
9
+ error?: boolean;
10
+ clearable?: boolean;
11
+ locale?: string;
12
+ /** Min/max are given as the with-time type; the date mode uses their date part. */
13
+ min?: Temporal.ZonedDateTime | null;
14
+ max?: Temporal.ZonedDateTime | null;
15
+ minuteStep?: 1 | 5 | 10 | 15;
16
+ /** Default timezone for a value gaining a time (IANA id). */
17
+ timeZone?: string | null;
18
+ timezoneFilter?: string[];
19
+ /** Clock toggle side, relative to the input. */
20
+ togglePosition?: 'start' | 'end';
21
+ /** Tooltip + accessible label for the toggle while time is OFF (adds time). */
22
+ addTimeLabel?: string;
23
+ /** Tooltip + accessible label for the toggle while time is ON (removes time). */
24
+ removeTimeLabel?: string;
25
+ };
26
+ type __VLS_PublicProps = {
27
+ modelValue?: Temporal.ZonedDateTime | Temporal.PlainDate | null;
28
+ 'withTime'?: boolean;
29
+ } & __VLS_Props;
30
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
31
+ closed: () => any;
32
+ "update:modelValue": (value: Temporal.PlainDate | Temporal.ZonedDateTime | null) => any;
33
+ opened: () => any;
34
+ "update:withTime": (value: boolean) => any;
35
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
36
+ onClosed?: (() => any) | undefined;
37
+ "onUpdate:modelValue"?: ((value: Temporal.PlainDate | Temporal.ZonedDateTime | null) => any) | undefined;
38
+ onOpened?: (() => any) | undefined;
39
+ "onUpdate:withTime"?: ((value: boolean) => any) | undefined;
40
+ }>, {
41
+ error: boolean;
42
+ size: CoarZonedDateTimeOrDatePickerSize;
43
+ required: boolean;
44
+ disabled: boolean;
45
+ placeholder: string;
46
+ max: Temporal.ZonedDateTime | null;
47
+ readonly: boolean;
48
+ clearable: boolean;
49
+ min: Temporal.ZonedDateTime | null;
50
+ locale: string;
51
+ minuteStep: 1 | 5 | 10 | 15;
52
+ timeZone: string | null;
53
+ timezoneFilter: string[];
54
+ togglePosition: "start" | "end";
55
+ addTimeLabel: string;
56
+ removeTimeLabel: string;
57
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
58
+ export default _default;
59
+ //# sourceMappingURL=CoarZonedDateTimeOrDatePicker.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoarZonedDateTimeOrDatePicker.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/zoned-date-time-or-date-picker/CoarZonedDateTimeOrDatePicker.vue"],"names":[],"mappings":"AA6KA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjD,OAAO,6BAA6B,CAAC;AAErC,MAAM,MAAM,iCAAiC,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEvE,KAAK,WAAW,GAAG;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;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AAG,KAAK;kBAEjB,MAAM;qBAEH,MAAM;;AAiS5B,wBASG"}
@@ -0,0 +1,3 @@
1
+ export { default as CoarZonedDateTimeOrDatePicker } from './CoarZonedDateTimeOrDatePicker.vue';
2
+ export type { CoarZonedDateTimeOrDatePickerSize } from './CoarZonedDateTimeOrDatePicker.vue';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/zoned-date-time-or-date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAC/F,YAAY,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC"}
@@ -42,6 +42,7 @@ export declare const CORE_ICONS: {
42
42
  'circle-help': string;
43
43
  'clipboard-check': string;
44
44
  clipboard: string;
45
+ 'clock-off': string;
45
46
  clock: string;
46
47
  code: string;
47
48
  columns: string;
@@ -1 +1 @@
1
- {"version":3,"file":"core-icons.d.ts","sourceRoot":"","sources":["../../../src/components/icon/core-icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuItB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"core-icons.d.ts","sourceRoot":"","sources":["../../../src/components/icon/core-icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwItB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}