@loafacto/ui 0.12.2 → 0.12.4

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.
@@ -10,6 +10,8 @@ type __VLS_Props = {
10
10
  accent?: boolean;
11
11
  danger?: boolean;
12
12
  disabled?: boolean;
13
+ /** 진행 중 표시. 아이콘이 스피너로 바뀌고 입력을 막는다. */
14
+ loading?: boolean;
13
15
  href?: string;
14
16
  external?: boolean;
15
17
  };
package/dist/index.js CHANGED
@@ -1085,10 +1085,13 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1085
1085
  accent: { type: Boolean },
1086
1086
  danger: { type: Boolean },
1087
1087
  disabled: { type: Boolean },
1088
+ loading: { type: Boolean },
1088
1089
  href: {},
1089
1090
  external: { type: Boolean }
1090
1091
  },
1091
1092
  setup(__props) {
1093
+ const props = __props;
1094
+ const iconSize = computed(() => props.size === "sm" ? "1.125rem" : "1.375rem");
1092
1095
  return (_ctx, _cache) => {
1093
1096
  return openBlock(), createBlock(resolveDynamicComponent(__props.href ? "a" : "button"), {
1094
1097
  class: normalizeClass(["lf-icon-btn", [`lf-icon-btn--${__props.size}`, { "lf-icon-btn--accent": __props.accent, "lf-icon-btn--danger": __props.danger }]]),
@@ -1096,23 +1099,28 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1096
1099
  href: __props.href,
1097
1100
  target: __props.href && __props.external ? "_blank" : void 0,
1098
1101
  rel: __props.href && __props.external ? "noopener noreferrer" : void 0,
1099
- disabled: __props.href ? void 0 : __props.disabled,
1102
+ disabled: __props.href ? void 0 : __props.disabled || __props.loading,
1103
+ "aria-busy": __props.loading ? "true" : void 0,
1100
1104
  "aria-label": __props.label,
1101
1105
  title: __props.label
1102
1106
  }, {
1103
1107
  default: withCtx(() => [
1104
- createVNode(LfIcon, {
1108
+ __props.loading ? (openBlock(), createBlock(LfSpinner, {
1109
+ key: 0,
1110
+ size: iconSize.value
1111
+ }, null, 8, ["size"])) : (openBlock(), createBlock(LfIcon, {
1112
+ key: 1,
1105
1113
  name: __props.icon,
1106
1114
  path: __props.iconPath,
1107
- size: __props.size === "sm" ? "1.125rem" : "1.375rem"
1108
- }, null, 8, ["name", "path", "size"])
1115
+ size: iconSize.value
1116
+ }, null, 8, ["name", "path", "size"]))
1109
1117
  ]),
1110
1118
  _: 1
1111
- }, 8, ["class", "type", "href", "target", "rel", "disabled", "aria-label", "title"]);
1119
+ }, 8, ["class", "type", "href", "target", "rel", "disabled", "aria-busy", "aria-label", "title"]);
1112
1120
  };
1113
1121
  }
1114
1122
  });
1115
- const LfIconButton = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-843c9770"]]);
1123
+ const LfIconButton = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-e86ee99c"]]);
1116
1124
  const _hoisted_1$l = ["for"];
1117
1125
  const _hoisted_2$k = {
1118
1126
  key: 0,