@loafacto/ui 0.13.0 → 0.13.2

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.
@@ -1,54 +1,50 @@
1
1
  import type { LfOption } from '../types';
2
- type __VLS_Props = {
3
- options?: (LfOption | string | number)[];
4
- label?: string;
5
- hint?: string;
6
- error?: string;
7
- required?: boolean;
8
- placeholder?: string;
9
- disabled?: boolean;
10
- size?: 'sm' | 'md';
11
- /** 목록 위에 찾기 칸. 열 개를 넘는 목록에 둔다. */
12
- searchable?: boolean;
13
- /** 적은 글자가 곧 값이다. 목록은 제안일 뿐이고, 없는 값도 적을 수 있다(combobox). */
14
- editable?: boolean;
15
- clearable?: boolean;
16
- /** 목록을 아직 받는 중. 오른쪽 화살표 자리가 스피너가 된다. */
17
- loading?: boolean;
18
- emptyText?: string;
19
- searchPlaceholder?: string;
20
- clearLabel?: string;
21
- };
22
- type __VLS_ModelProps = {
23
- modelValue?: string | number | null;
24
- };
25
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
26
- declare var __VLS_13: {
27
- option: LfOption | null;
28
- }, __VLS_42: {
29
- option: LfOption;
30
- };
31
- type __VLS_Slots = {} & {
32
- selected?: (props: typeof __VLS_13) => any;
33
- } & {
34
- option?: (props: typeof __VLS_42) => any;
2
+ declare const __VLS_export: <T extends string | number | null = string | number | null>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
+ options?: (LfOption | string | number)[];
5
+ label?: string;
6
+ hint?: string;
7
+ error?: string;
8
+ required?: boolean;
9
+ placeholder?: string;
10
+ disabled?: boolean;
11
+ size?: "sm" | "md";
12
+ /** 목록 위에 찾기 칸. 열 개를 넘는 목록에 둔다. */
13
+ searchable?: boolean;
14
+ /** 적은 글자가 곧 값이다. 목록은 제안일 뿐이고, 없는 값도 적을 수 있다(combobox). */
15
+ editable?: boolean;
16
+ clearable?: boolean;
17
+ /** 목록을 아직 받는 중. 오른쪽 화살표 자리가 스피너가 된다. */
18
+ loading?: boolean;
19
+ emptyText?: string;
20
+ searchPlaceholder?: string;
21
+ clearLabel?: string;
22
+ } & {
23
+ modelValue: T;
24
+ }) & {
25
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
26
+ }> & (typeof globalThis extends {
27
+ __VLS_PROPS_FALLBACK: infer P;
28
+ } ? P : {});
29
+ expose: (exposed: {}) => void;
30
+ attrs: any;
31
+ slots: {
32
+ selected?: (props: {
33
+ option: LfOption | null;
34
+ }) => any;
35
+ } & {
36
+ option?: (props: {
37
+ option: LfOption;
38
+ }) => any;
39
+ };
40
+ emit: (event: "update:modelValue", value: T) => void;
41
+ }>) => import("vue").VNode & {
42
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
35
43
  };
36
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
- "update:modelValue": (value: string | number | null) => any;
38
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
39
- "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
40
- }>, {
41
- size: "sm" | "md";
42
- options: (LfOption | string | number)[];
43
- emptyText: string;
44
- searchPlaceholder: string;
45
- clearLabel: string;
46
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
48
44
  declare const _default: typeof __VLS_export;
49
45
  export default _default;
50
- type __VLS_WithSlots<T, S> = T & {
51
- new (): {
52
- $slots: S;
53
- };
54
- };
46
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
47
+ [K in keyof T]: T[K];
48
+ } : {
49
+ [K in keyof T as K]: T[K];
50
+ }) & {};
@@ -1,26 +1,33 @@
1
1
  import type { LfOption } from '../types';
2
- type __VLS_Props = {
3
- options?: (LfOption | string)[];
4
- size?: 'sm' | 'md';
5
- /** 아이콘만 보인다. 라벨은 aria-label·title 로 남는다. */
6
- labelHidden?: boolean;
7
- /** 부모 폭을 채우고 칸을 같은 폭으로 나눈다. */
8
- block?: boolean;
9
- disabled?: boolean;
10
- /** 묶음의 접근성 이름. 「보기 방식」처럼 무엇을 고르는 자리인지. */
11
- ariaLabel?: string;
2
+ declare const __VLS_export: <T extends string | number | null = string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
+ options?: (LfOption | string)[];
5
+ size?: "sm" | "md";
6
+ /** 아이콘만 보인다. 라벨은 aria-label·title 로 남는다. */
7
+ labelHidden?: boolean;
8
+ /** 부모 폭을 채우고 칸을 같은 폭으로 나눈다. */
9
+ block?: boolean;
10
+ disabled?: boolean;
11
+ /** 묶음의 접근성 이름. 「보기 방식」처럼 무엇을 고르는 자리인지. */
12
+ ariaLabel?: string;
13
+ } & {
14
+ modelValue: T;
15
+ }) & {
16
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
17
+ }> & (typeof globalThis extends {
18
+ __VLS_PROPS_FALLBACK: infer P;
19
+ } ? P : {});
20
+ expose: (exposed: {}) => void;
21
+ attrs: any;
22
+ slots: {};
23
+ emit: (event: "update:modelValue", value: T) => void;
24
+ }>) => import("vue").VNode & {
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
12
26
  };
13
- type __VLS_ModelProps = {
14
- modelValue?: string | number | null;
15
- };
16
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
17
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- "update:modelValue": (value: string | number | null) => any;
19
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
- "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
21
- }>, {
22
- size: "sm" | "md";
23
- options: (LfOption | string)[];
24
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
27
  declare const _default: typeof __VLS_export;
26
28
  export default _default;
29
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
30
+ [K in keyof T]: T[K];
31
+ } : {
32
+ [K in keyof T as K]: T[K];
33
+ }) & {};
@@ -1,34 +1,41 @@
1
1
  import type { LfOption } from '../types';
2
- type __VLS_Props = {
3
- /** 문자열·숫자 배열도 받는다 — 값과 표시가 같을 때 `{value,label}` 을 두 번 쓰지 않으려고. */
4
- options?: (LfOption | string | number)[];
5
- label?: string;
6
- hint?: string;
7
- error?: string;
8
- required?: boolean;
9
- /** 값이 비었을 때 보이는 안내 문구. 목록 맨 위 옵션으로 들어간다. */
10
- placeholder?: string;
11
- /** placeholder 옵션을 다시 고를 수 있게 한다(= 선택 해제). */
12
- clearable?: boolean;
13
- disabled?: boolean;
14
- size?: 'sm' | 'md';
2
+ declare const __VLS_export: <T extends string | number | null = string | number | null>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
+ /** 문자열·숫자 배열도 받는다 — 값과 표시가 같을 때 `{value,label}` 을 두 번 쓰지 않으려고. */
5
+ options?: (LfOption | string | number)[];
6
+ label?: string;
7
+ hint?: string;
8
+ error?: string;
9
+ required?: boolean;
10
+ /** 값이 비었을 때 보이는 안내 문구. 목록 맨 위 옵션으로 들어간다. */
11
+ placeholder?: string;
12
+ /** placeholder 옵션을 다시 고를 수 있게 한다(= 선택 해제). */
13
+ clearable?: boolean;
14
+ disabled?: boolean;
15
+ size?: "sm" | "md";
16
+ } & {
17
+ /**
18
+ * `v-model.number` 를 받는다. 컴포넌트의 v-model 에 붙은 수식어는 브라우저가 아니라
19
+ * 컴포넌트가 처리해야 한다 — 그냥 두면 `<LfTextField v-model.number="n">` 이 문자열을
20
+ * 돌려주고, 저장 직전에야 "1" + 1 = "11" 로 드러난다.
21
+ */
22
+ modelValue: T;
23
+ }) & {
24
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
25
+ }> & (typeof globalThis extends {
26
+ __VLS_PROPS_FALLBACK: infer P;
27
+ } ? P : {});
28
+ expose: (exposed: {}) => void;
29
+ attrs: any;
30
+ slots: {};
31
+ emit: (event: "update:modelValue", value: T) => void;
32
+ }>) => import("vue").VNode & {
33
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
15
34
  };
16
- type __VLS_ModelProps = {
17
- /**
18
- * `v-model.number` 를 받는다. 컴포넌트의 v-model 에 붙은 수식어는 브라우저가 아니라
19
- * 컴포넌트가 처리해야 한다 — 그냥 두면 `<LfTextField v-model.number="n">` 이 문자열을
20
- * 돌려주고, 저장 직전에야 "1" + 1 = "11" 로 드러난다.
21
- */
22
- modelValue?: string | number | null;
23
- };
24
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
25
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
- "update:modelValue": (value: string | number | null) => any;
27
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
28
- "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
29
- }>, {
30
- size: "sm" | "md";
31
- options: (LfOption | string | number)[];
32
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
35
  declare const _default: typeof __VLS_export;
34
36
  export default _default;
37
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
38
+ [K in keyof T]: T[K];
39
+ } : {
40
+ [K in keyof T as K]: T[K];
41
+ }) & {};
package/dist/index.js CHANGED
@@ -1394,7 +1394,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1394
1394
  size: { default: "md" }
1395
1395
  }, {
1396
1396
  "modelValue": {
1397
- default: ""
1397
+ required: true
1398
1398
  },
1399
1399
  "modelModifiers": {}
1400
1400
  }),
@@ -1458,7 +1458,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1458
1458
  };
1459
1459
  }
1460
1460
  });
1461
- const LfSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-e0d9d182"]]);
1461
+ const LfSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-01fa2b3e"]]);
1462
1462
  const _hoisted_1$j = ["disabled", "value"];
1463
1463
  const _hoisted_2$i = {
1464
1464
  class: "lf-check__box",
@@ -2774,7 +2774,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2774
2774
  disabled: { type: Boolean },
2775
2775
  ariaLabel: {}
2776
2776
  }, {
2777
- "modelValue": { default: "" },
2777
+ "modelValue": { required: true },
2778
2778
  "modelModifiers": {}
2779
2779
  }),
2780
2780
  emits: ["update:modelValue"],
@@ -2818,7 +2818,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2818
2818
  };
2819
2819
  }
2820
2820
  });
2821
- const LfSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-4b9d64cc"]]);
2821
+ const LfSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-49d1dec4"]]);
2822
2822
  const _hoisted_1$1 = { class: "lf-control-wrap" };
2823
2823
  const _hoisted_2$1 = {
2824
2824
  key: 0,
@@ -2864,7 +2864,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2864
2864
  searchPlaceholder: { default: "찾기" },
2865
2865
  clearLabel: { default: "지우기" }
2866
2866
  }, {
2867
- "modelValue": { default: "" },
2867
+ "modelValue": { required: true },
2868
2868
  "modelModifiers": {}
2869
2869
  }),
2870
2870
  emits: ["update:modelValue"],
@@ -2954,13 +2954,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2954
2954
  }
2955
2955
  function onKeydown(e2) {
2956
2956
  var _a, _b;
2957
- if (e2.key === "Escape") {
2958
- if (open.value) {
2959
- e2.stopPropagation();
2960
- hide();
2961
- }
2962
- return;
2963
- }
2964
2957
  if (e2.key === "ArrowDown" || e2.key === "ArrowUp") {
2965
2958
  e2.preventDefault();
2966
2959
  if (!open.value) {
@@ -2998,6 +2991,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2998
2991
  const t = e2.target;
2999
2992
  if (!((_a = root.value) == null ? void 0 : _a.contains(t)) && !((_b = list.value) == null ? void 0 : _b.contains(t))) hide();
3000
2993
  }
2994
+ function onDocKeydown(e2) {
2995
+ var _a;
2996
+ if (e2.key !== "Escape") return;
2997
+ e2.stopPropagation();
2998
+ hide();
2999
+ (_a = control.value) == null ? void 0 : _a.focus();
3000
+ }
3001
3001
  function onScroll(e2) {
3002
3002
  if (list.value && list.value.contains(e2.target)) return;
3003
3003
  hide();
@@ -3005,10 +3005,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3005
3005
  watch(open, (isOpen) => {
3006
3006
  if (isOpen) {
3007
3007
  document.addEventListener("pointerdown", onPointerDown);
3008
+ document.addEventListener("keydown", onDocKeydown, true);
3008
3009
  document.addEventListener("scroll", onScroll, true);
3009
3010
  window.addEventListener("resize", hide);
3010
3011
  } else {
3011
3012
  document.removeEventListener("pointerdown", onPointerDown);
3013
+ document.removeEventListener("keydown", onDocKeydown, true);
3012
3014
  document.removeEventListener("scroll", onScroll, true);
3013
3015
  window.removeEventListener("resize", hide);
3014
3016
  }
@@ -3021,6 +3023,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3021
3023
  });
3022
3024
  onBeforeUnmount(() => {
3023
3025
  document.removeEventListener("pointerdown", onPointerDown);
3026
+ document.removeEventListener("keydown", onDocKeydown, true);
3024
3027
  document.removeEventListener("scroll", onScroll, true);
3025
3028
  window.removeEventListener("resize", hide);
3026
3029
  });
@@ -3179,7 +3182,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3179
3182
  };
3180
3183
  }
3181
3184
  });
3182
- const LfListSelect = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-60c3b796"]]);
3185
+ const LfListSelect = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-bdf6d912"]]);
3183
3186
  const _hoisted_1 = {
3184
3187
  key: 0,
3185
3188
  class: "lf-divider lf-divider--labeled",