@bagelink/vue 0.0.1155 → 0.0.1161

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 +1 @@
1
- {"version":3,"file":"ListView.vue.d.ts","sourceRoot":"","sources":["../../src/components/ListView.vue"],"names":[],"mappings":"AA8BA,iBAAS,cAAc;WAqCT,OAAO,IAA6B;;wBAXtB,GAAG;yBACF,GAAG;;;;EAe/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ListView.vue.d.ts","sourceRoot":"","sources":["../../src/components/ListView.vue"],"names":[],"mappings":"AAwBA,iBAAS,cAAc;WAmCT,OAAO,IAA6B;;wBAXtB,GAAG;yBACF,GAAG;;;;EAe/B;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -3,21 +3,26 @@ export interface RadioOption<T> {
3
3
  imgSrc?: string;
4
4
  subLabel?: string;
5
5
  label?: string;
6
+ id?: string;
7
+ contextObj?: T;
6
8
  value: any;
7
- id: string;
8
- contextObj: T;
9
9
  }
10
10
  declare const _default: <ContextObjType extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
11
11
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
12
12
  readonly onDelete?: ((...args: any[]) => any) | undefined;
13
13
  readonly "onUpdate:modelValue"?: ((value: any) => any) | undefined;
14
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onDelete"> & ({
14
+ readonly onFocus?: ((...args: any[]) => any) | undefined;
15
+ readonly onBlur?: ((...args: any[]) => any) | undefined;
16
+ readonly onChange?: ((...args: any[]) => any) | undefined;
17
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:modelValue" | "onDelete"> & ({
15
18
  modelValue?: any;
16
19
  } & {
17
- groupName: string;
20
+ groupName?: string;
18
21
  options: RadioOption<ContextObjType>[];
19
22
  deletable?: boolean;
20
23
  required?: boolean;
24
+ error?: string;
25
+ disabled?: boolean;
21
26
  }) & Partial<{}>> & import('vue').PublicProps;
22
27
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
23
28
  attrs: any;
@@ -27,12 +32,12 @@ declare const _default: <ContextObjType extends Record<string, any>>(__VLS_props
27
32
  imgSrc?: string;
28
33
  subLabel?: string;
29
34
  label?: string;
35
+ id?: string;
36
+ contextObj?: ContextObjType | undefined;
30
37
  value: any;
31
- id: string;
32
- contextObj: ContextObjType;
33
38
  }): any;
34
39
  };
35
- emit: ((event: "delete", ...args: any[]) => void) & ((evt: "update:modelValue", value: any) => void);
40
+ emit: ((event: "delete" | "focus" | "blur" | "change", ...args: any[]) => void) & ((evt: "update:modelValue", value: any) => void);
36
41
  }>) => import('vue').VNode & {
37
42
  __ctx?: Awaited<typeof __VLS_setup>;
38
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/RadioGroup.vue"],"names":[],"mappings":"AAkFA,MAAM,WAAW,WAAW,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,GAAG,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,CAAC,CAAA;CACb;yBAEgB,cAAc,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAC7C,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAsJ1D,mBAAmB,CAAC;;;;qBA7Hb,GAAG;;mBAtBN,MAAM;iBACR,WAAW,CAAC,cAAc,CAAC,EAAE;oBAC1B,OAAO;mBACR,OAAO;oBAgJ2E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;qBApKD,MAAM;qBACN,MAAM;uBACJ,MAAM;oBACT,MAAM;mBACP,GAAG;gBACN,MAAM;;YA8HoB,GAAG;;UAmC3B,8FAA0C;OAGrC,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhKzE,wBAgK4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"RadioGroup.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/RadioGroup.vue"],"names":[],"mappings":"AAuHA,MAAM,WAAW,WAAW,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,KAAK,EAAE,GAAG,CAAA;CACV;yBAEgB,cAAc,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAC7C,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA2L1D,mBAAmB,CAAC;;;;;;;qBAzIb,GAAG;;oBA/CL,MAAM;iBACT,WAAW,CAAC,cAAc,CAAC,EAAE;oBAC1B,OAAO;mBACR,OAAO;gBACV,MAAM;mBACH,OAAO;oBAmL2E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;qBAzMD,MAAM;qBACN,MAAM;uBACJ,MAAM;oBACT,MAAM;iBACT,MAAM;;mBAEJ,GAAG;YA6JoB,GAAG;;UAwC3B,4HAAoC;OAG/B,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AArMzE,wBAqM4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -203,7 +203,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
203
203
  }, null, 8, ["modelValue"])
204
204
  ]),
205
205
  default: vue.withCtx(() => [
206
- vue.createVNode(vue.unref(_sfc_main$e), { class: "-mt-2 hm-300px" }, {
206
+ vue.createVNode(vue.unref(ListView), { class: "-mt-2 hm-300px" }, {
207
207
  default: vue.withCtx(() => [
208
208
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(searchResults), (result2, index2) => {
209
209
  return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$f), {
@@ -21946,7 +21946,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
21946
21946
  }
21947
21947
  });
21948
21948
  const _hoisted_1$w = ["for"];
21949
- const _hoisted_2$l = ["id", "name", "value", "required"];
21949
+ const _hoisted_2$l = ["id", "disabled", "name", "value", "required"];
21950
21950
  const _hoisted_3$h = { class: "flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025" };
21951
21951
  const _hoisted_4$a = ["src", "alt"];
21952
21952
  const _hoisted_5$a = { class: "" };
@@ -21964,31 +21964,59 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
21964
21964
  groupName: {},
21965
21965
  options: {},
21966
21966
  deletable: { type: Boolean },
21967
- required: { type: Boolean }
21967
+ required: { type: Boolean },
21968
+ error: {},
21969
+ disabled: { type: Boolean }
21968
21970
  }, {
21969
21971
  "modelValue": {},
21970
21972
  "modelModifiers": {}
21971
21973
  }),
21972
- emits: /* @__PURE__ */ vue.mergeModels(["delete"], ["update:modelValue"]),
21973
- setup(__props) {
21974
+ emits: /* @__PURE__ */ vue.mergeModels(["delete", "focus", "blur", "change"], ["update:modelValue"]),
21975
+ setup(__props, { emit: __emit }) {
21976
+ const props2 = __props;
21977
+ const emit2 = __emit;
21978
+ const name = vue.computed(() => props2.groupName || Math.random().toString(36).substring(2, 15));
21974
21979
  const selectedOption = vue.useModel(__props, "modelValue");
21980
+ let isFocused = vue.ref(false);
21981
+ const containerClasses = vue.computed(() => ({
21982
+ "has-error": !!props2.error,
21983
+ "is-disabled": props2.disabled,
21984
+ "is-focused": isFocused.value
21985
+ }));
21986
+ function handleFocus() {
21987
+ isFocused.value = true;
21988
+ emit2("focus");
21989
+ }
21990
+ function handleBlur() {
21991
+ isFocused.value = false;
21992
+ emit2("blur");
21993
+ }
21994
+ function handleChange() {
21995
+ emit2("change", selectedOption.value);
21996
+ }
21975
21997
  return (_ctx, _cache) => {
21976
- return vue.openBlock(), vue.createElementBlock("div", null, [
21977
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (opt) => {
21998
+ return vue.openBlock(), vue.createElementBlock("div", {
21999
+ class: vue.normalizeClass(containerClasses.value)
22000
+ }, [
22001
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (opt, index2) => {
21978
22002
  return vue.openBlock(), vue.createElementBlock("label", {
21979
- key: opt.id,
22003
+ key: opt.id || `${name.value}-${index2}`,
21980
22004
  class: "border rounded p-1 flex bg-gray-light mb-05 gap-075 active-list-item hover",
21981
- for: opt.id
22005
+ for: opt.id || `${name.value}-${index2}`
21982
22006
  }, [
21983
22007
  vue.withDirectives(vue.createElementVNode("input", {
21984
- id: opt.id,
22008
+ id: opt.id || `${name.value}-${index2}`,
21985
22009
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedOption.value = $event),
22010
+ disabled: _ctx.disabled,
21986
22011
  class: "radio-input-list",
21987
22012
  type: "radio",
21988
- name: _ctx.groupName,
22013
+ name: name.value,
21989
22014
  value: opt.value,
21990
- required: _ctx.required
21991
- }, null, 8, _hoisted_2$l), [
22015
+ required: _ctx.required,
22016
+ onFocus: handleFocus,
22017
+ onBlur: handleBlur,
22018
+ onChange: handleChange
22019
+ }, null, 40, _hoisted_2$l), [
21992
22020
  [vue.vModelRadio, selectedOption.value]
21993
22021
  ]),
21994
22022
  vue.createElementVNode("div", _hoisted_3$h, [
@@ -22015,11 +22043,11 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
22015
22043
  }, null, 8, ["onClick"])) : vue.createCommentVNode("", true)
22016
22044
  ], 8, _hoisted_1$w);
22017
22045
  }), 128))
22018
- ]);
22046
+ ], 2);
22019
22047
  };
22020
22048
  }
22021
22049
  });
22022
- const RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-3c77be46"]]);
22050
+ const RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-a692c596"]]);
22023
22051
  const _hoisted_1$v = { class: "bagel-input" };
22024
22052
  const _hoisted_2$k = { class: "pb-025" };
22025
22053
  const _hoisted_3$g = { class: "flex gap-05 flex-wrap" };
@@ -32116,10 +32144,10 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
32116
32144
  let inputVal = vue.ref();
32117
32145
  const input = vue.ref();
32118
32146
  const inputRows = vue.computed(() => {
32119
- if (props2.autoheight) return `${inputVal.value}`.split("\n").length || props2.rows || 1;
32120
- if (props2.rows) return props2.rows;
32121
- if (props2.multiline || props2.code) return 4;
32122
- return 1;
32147
+ let rows = Number(props2.rows) || 1;
32148
+ if (props2.autoheight) rows = Math.max(rows, String(inputVal.value).split("\n").length);
32149
+ if (props2.multiline || props2.code) rows = Math.max(rows, 4);
32150
+ return rows;
32123
32151
  });
32124
32152
  const debouncedEmit = useDebounceFn(() => {
32125
32153
  emit2("debounce", inputVal.value);
@@ -32222,7 +32250,7 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
32222
32250
  };
32223
32251
  }
32224
32252
  });
32225
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-c2bd3e03"]]);
32253
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-54de82a7"]]);
32226
32254
  const _hoisted_1$l = ["title"];
32227
32255
  const _hoisted_2$b = ["id", "required"];
32228
32256
  const _hoisted_3$8 = ["for"];
@@ -37799,28 +37827,21 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
37799
37827
  };
37800
37828
  }
37801
37829
  });
37802
- const _hoisted_1$b = { class: "list-wrap bgl_card thin grid overflow-hidden h-100 pt-0 pb-05 px-0 m_pb-0" };
37803
- const _hoisted_2$6 = {
37804
- key: 0,
37805
- class: "p-1"
37806
- };
37830
+ const _sfc_main$e = {};
37831
+ const _hoisted_1$b = { class: "list-wrap bgl_card thin grid overflow-hidden pt-0 pb-05 px-0 m_pb-0" };
37832
+ const _hoisted_2$6 = { class: "p-0" };
37807
37833
  const _hoisted_3$4 = { class: "list-content auto-flow-rows align-items-start overflow-y h-100" };
37808
- const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
37809
- __name: "ListView",
37810
- setup(__props) {
37811
- const slots = vue.useSlots();
37812
- return (_ctx, _cache) => {
37813
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
37814
- vue.unref(slots).header ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
37815
- vue.renderSlot(_ctx.$slots, "header")
37816
- ])) : vue.createCommentVNode("", true),
37817
- vue.createElementVNode("div", _hoisted_3$4, [
37818
- vue.renderSlot(_ctx.$slots, "default")
37819
- ])
37820
- ]);
37821
- };
37822
- }
37823
- });
37834
+ function _sfc_render$3(_ctx, _cache) {
37835
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
37836
+ vue.createElementVNode("div", _hoisted_2$6, [
37837
+ vue.renderSlot(_ctx.$slots, "header")
37838
+ ]),
37839
+ vue.createElementVNode("div", _hoisted_3$4, [
37840
+ vue.renderSlot(_ctx.$slots, "default")
37841
+ ])
37842
+ ]);
37843
+ }
37844
+ const ListView = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$3]]);
37824
37845
  const _hoisted_1$a = { class: "flex-center" };
37825
37846
  const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
37826
37847
  __name: "Loading",
@@ -40782,7 +40803,7 @@ exports.JSONInput = JSONInput;
40782
40803
  exports.Layout = Layout;
40783
40804
  exports.Lineart = _sfc_main$Y;
40784
40805
  exports.ListItem = _sfc_main$f;
40785
- exports.ListView = _sfc_main$e;
40806
+ exports.ListView = ListView;
40786
40807
  exports.Loading = Loading;
40787
40808
  exports.MapEmbed = _sfc_main$c;
40788
40809
  exports.Modal = _sfc_main$b;
package/dist/index.mjs CHANGED
@@ -201,7 +201,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
201
201
  }, null, 8, ["modelValue"])
202
202
  ]),
203
203
  default: withCtx(() => [
204
- createVNode(unref(_sfc_main$e), { class: "-mt-2 hm-300px" }, {
204
+ createVNode(unref(ListView), { class: "-mt-2 hm-300px" }, {
205
205
  default: withCtx(() => [
206
206
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(searchResults), (result2, index2) => {
207
207
  return openBlock(), createBlock(unref(_sfc_main$f), {
@@ -21944,7 +21944,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
21944
21944
  }
21945
21945
  });
21946
21946
  const _hoisted_1$w = ["for"];
21947
- const _hoisted_2$l = ["id", "name", "value", "required"];
21947
+ const _hoisted_2$l = ["id", "disabled", "name", "value", "required"];
21948
21948
  const _hoisted_3$h = { class: "flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025" };
21949
21949
  const _hoisted_4$a = ["src", "alt"];
21950
21950
  const _hoisted_5$a = { class: "" };
@@ -21962,31 +21962,59 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
21962
21962
  groupName: {},
21963
21963
  options: {},
21964
21964
  deletable: { type: Boolean },
21965
- required: { type: Boolean }
21965
+ required: { type: Boolean },
21966
+ error: {},
21967
+ disabled: { type: Boolean }
21966
21968
  }, {
21967
21969
  "modelValue": {},
21968
21970
  "modelModifiers": {}
21969
21971
  }),
21970
- emits: /* @__PURE__ */ mergeModels(["delete"], ["update:modelValue"]),
21971
- setup(__props) {
21972
+ emits: /* @__PURE__ */ mergeModels(["delete", "focus", "blur", "change"], ["update:modelValue"]),
21973
+ setup(__props, { emit: __emit }) {
21974
+ const props2 = __props;
21975
+ const emit2 = __emit;
21976
+ const name = computed(() => props2.groupName || Math.random().toString(36).substring(2, 15));
21972
21977
  const selectedOption = useModel(__props, "modelValue");
21978
+ let isFocused = ref(false);
21979
+ const containerClasses = computed(() => ({
21980
+ "has-error": !!props2.error,
21981
+ "is-disabled": props2.disabled,
21982
+ "is-focused": isFocused.value
21983
+ }));
21984
+ function handleFocus() {
21985
+ isFocused.value = true;
21986
+ emit2("focus");
21987
+ }
21988
+ function handleBlur() {
21989
+ isFocused.value = false;
21990
+ emit2("blur");
21991
+ }
21992
+ function handleChange() {
21993
+ emit2("change", selectedOption.value);
21994
+ }
21973
21995
  return (_ctx, _cache) => {
21974
- return openBlock(), createElementBlock("div", null, [
21975
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (opt) => {
21996
+ return openBlock(), createElementBlock("div", {
21997
+ class: normalizeClass(containerClasses.value)
21998
+ }, [
21999
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (opt, index2) => {
21976
22000
  return openBlock(), createElementBlock("label", {
21977
- key: opt.id,
22001
+ key: opt.id || `${name.value}-${index2}`,
21978
22002
  class: "border rounded p-1 flex bg-gray-light mb-05 gap-075 active-list-item hover",
21979
- for: opt.id
22003
+ for: opt.id || `${name.value}-${index2}`
21980
22004
  }, [
21981
22005
  withDirectives(createElementVNode("input", {
21982
- id: opt.id,
22006
+ id: opt.id || `${name.value}-${index2}`,
21983
22007
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedOption.value = $event),
22008
+ disabled: _ctx.disabled,
21984
22009
  class: "radio-input-list",
21985
22010
  type: "radio",
21986
- name: _ctx.groupName,
22011
+ name: name.value,
21987
22012
  value: opt.value,
21988
- required: _ctx.required
21989
- }, null, 8, _hoisted_2$l), [
22013
+ required: _ctx.required,
22014
+ onFocus: handleFocus,
22015
+ onBlur: handleBlur,
22016
+ onChange: handleChange
22017
+ }, null, 40, _hoisted_2$l), [
21990
22018
  [vModelRadio, selectedOption.value]
21991
22019
  ]),
21992
22020
  createElementVNode("div", _hoisted_3$h, [
@@ -22013,11 +22041,11 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
22013
22041
  }, null, 8, ["onClick"])) : createCommentVNode("", true)
22014
22042
  ], 8, _hoisted_1$w);
22015
22043
  }), 128))
22016
- ]);
22044
+ ], 2);
22017
22045
  };
22018
22046
  }
22019
22047
  });
22020
- const RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-3c77be46"]]);
22048
+ const RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-a692c596"]]);
22021
22049
  const _hoisted_1$v = { class: "bagel-input" };
22022
22050
  const _hoisted_2$k = { class: "pb-025" };
22023
22051
  const _hoisted_3$g = { class: "flex gap-05 flex-wrap" };
@@ -32114,10 +32142,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32114
32142
  let inputVal = ref();
32115
32143
  const input = ref();
32116
32144
  const inputRows = computed(() => {
32117
- if (props2.autoheight) return `${inputVal.value}`.split("\n").length || props2.rows || 1;
32118
- if (props2.rows) return props2.rows;
32119
- if (props2.multiline || props2.code) return 4;
32120
- return 1;
32145
+ let rows = Number(props2.rows) || 1;
32146
+ if (props2.autoheight) rows = Math.max(rows, String(inputVal.value).split("\n").length);
32147
+ if (props2.multiline || props2.code) rows = Math.max(rows, 4);
32148
+ return rows;
32121
32149
  });
32122
32150
  const debouncedEmit = useDebounceFn(() => {
32123
32151
  emit2("debounce", inputVal.value);
@@ -32220,7 +32248,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32220
32248
  };
32221
32249
  }
32222
32250
  });
32223
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-c2bd3e03"]]);
32251
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-54de82a7"]]);
32224
32252
  const _hoisted_1$l = ["title"];
32225
32253
  const _hoisted_2$b = ["id", "required"];
32226
32254
  const _hoisted_3$8 = ["for"];
@@ -37797,28 +37825,21 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
37797
37825
  };
37798
37826
  }
37799
37827
  });
37800
- const _hoisted_1$b = { class: "list-wrap bgl_card thin grid overflow-hidden h-100 pt-0 pb-05 px-0 m_pb-0" };
37801
- const _hoisted_2$6 = {
37802
- key: 0,
37803
- class: "p-1"
37804
- };
37828
+ const _sfc_main$e = {};
37829
+ const _hoisted_1$b = { class: "list-wrap bgl_card thin grid overflow-hidden pt-0 pb-05 px-0 m_pb-0" };
37830
+ const _hoisted_2$6 = { class: "p-0" };
37805
37831
  const _hoisted_3$4 = { class: "list-content auto-flow-rows align-items-start overflow-y h-100" };
37806
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
37807
- __name: "ListView",
37808
- setup(__props) {
37809
- const slots = useSlots();
37810
- return (_ctx, _cache) => {
37811
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
37812
- unref(slots).header ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
37813
- renderSlot(_ctx.$slots, "header")
37814
- ])) : createCommentVNode("", true),
37815
- createElementVNode("div", _hoisted_3$4, [
37816
- renderSlot(_ctx.$slots, "default")
37817
- ])
37818
- ]);
37819
- };
37820
- }
37821
- });
37832
+ function _sfc_render$3(_ctx, _cache) {
37833
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
37834
+ createElementVNode("div", _hoisted_2$6, [
37835
+ renderSlot(_ctx.$slots, "header")
37836
+ ]),
37837
+ createElementVNode("div", _hoisted_3$4, [
37838
+ renderSlot(_ctx.$slots, "default")
37839
+ ])
37840
+ ]);
37841
+ }
37842
+ const ListView = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$3]]);
37822
37843
  const _hoisted_1$a = { class: "flex-center" };
37823
37844
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
37824
37845
  __name: "Loading",
@@ -40781,7 +40802,7 @@ export {
40781
40802
  Layout,
40782
40803
  _sfc_main$Y as Lineart,
40783
40804
  _sfc_main$f as ListItem,
40784
- _sfc_main$e as ListView,
40805
+ ListView,
40785
40806
  Loading,
40786
40807
  _sfc_main$c as MapEmbed,
40787
40808
  _sfc_main$b as Modal,
package/dist/style.css CHANGED
@@ -1313,16 +1313,22 @@ pre code.hljs{
1313
1313
  height: var(--input-height) !important;
1314
1314
  }
1315
1315
 
1316
- .radio-input-list[data-v-3c77be46]{
1316
+ .radio-input-list[data-v-a692c596]{
1317
1317
  width: auto;
1318
1318
  transform: scale(1.4);
1319
1319
  margin-inline-end: 0.6rem;
1320
1320
  }
1321
- .active-list-item[data-v-3c77be46]:has(:checked){
1321
+ .active-list-item[data-v-a692c596]:has(:checked){
1322
1322
  background: var(--bgl-primary-light) !important;
1323
1323
  border-color: var(--bgl-primary) !important;
1324
1324
  accent-color: var(--bgl-accent-color);
1325
1325
  }
1326
+ .has-error .active-list-item[data-v-a692c596] {
1327
+ border-color: var(--bgl-red) !important;
1328
+ }
1329
+ .has-error[data-v-a692c596] :is(input[type="radio"]) {
1330
+ accent-color: var(--bgl-red);
1331
+ }
1326
1332
 
1327
1333
  .radio-pill label[data-v-cf892d71] {
1328
1334
  color: var(--bgl-primary);
@@ -1791,58 +1797,58 @@ line-height: 1.65;
1791
1797
  font-size: var(--label-font-size);
1792
1798
  }
1793
1799
 
1794
- .bagel-input textarea[data-v-c2bd3e03] {
1800
+ .bagel-input textarea[data-v-54de82a7] {
1795
1801
  min-height: unset;
1796
1802
  font-size: var(--input-font-size);
1797
1803
  }
1798
- .bagel-input.text-input textarea[data-v-c2bd3e03] {
1804
+ .bagel-input.text-input textarea[data-v-54de82a7] {
1799
1805
  resize: none;
1800
1806
  }
1801
- .code textarea[data-v-c2bd3e03] {
1807
+ .code textarea[data-v-54de82a7] {
1802
1808
  font-family: 'Inconsolata', monospace;
1803
1809
  background: var(--bgl-code-bg) !important;
1804
1810
  color: var(--bgl-light-text) !important;
1805
1811
  }
1806
- .code textarea[data-v-c2bd3e03]::placeholder {
1812
+ .code textarea[data-v-54de82a7]::placeholder {
1807
1813
  color: var(--bgl-light-text) !important;
1808
1814
  opacity: 0.3;
1809
1815
  }
1810
- .bagel-input.small[data-v-c2bd3e03] {
1816
+ .bagel-input.small[data-v-54de82a7] {
1811
1817
  margin-bottom: 0;
1812
1818
  height: 30px;
1813
1819
  }
1814
- .bagel-input.dense label[data-v-c2bd3e03] {
1820
+ .bagel-input.dense label[data-v-54de82a7] {
1815
1821
  display: flex;
1816
1822
  align-items: center;
1817
1823
  gap: 0.5rem;
1818
1824
  }
1819
- .bagel-input input[data-v-c2bd3e03]:disabled {
1825
+ .bagel-input input[data-v-54de82a7]:disabled {
1820
1826
  background: #f5f5f5;
1821
1827
  }
1822
- .bagel-input label[data-v-c2bd3e03] {
1828
+ .bagel-input label[data-v-54de82a7] {
1823
1829
  font-size: var(--label-font-size);
1824
1830
  }
1825
- .textInputIconWrap .bgl_icon-font[data-v-c2bd3e03] {
1831
+ .textInputIconWrap .bgl_icon-font[data-v-54de82a7] {
1826
1832
  color: var(--input-color);
1827
1833
  position: absolute;
1828
1834
  inset-inline-end:calc(var(--input-height) / 3 - 0.25rem);
1829
1835
  margin-top: calc(var(--input-height) / 2 + 0.1rem);
1830
1836
  line-height: 0;
1831
1837
  }
1832
- .textInputIconWrap input[data-v-c2bd3e03]{
1838
+ .textInputIconWrap input[data-v-54de82a7]{
1833
1839
  padding-inline-end: calc(var(--input-height) / 3 + 1.5rem);
1834
1840
  }
1835
- .txtInputIconStart .iconStart[data-v-c2bd3e03] {
1841
+ .txtInputIconStart .iconStart[data-v-54de82a7] {
1836
1842
  color: var(--input-color);
1837
1843
  position: absolute;
1838
1844
  inset-inline-start:calc(var(--input-height) / 3 - 0.25rem);
1839
1845
  margin-top: calc(var(--input-height) / 2 );
1840
1846
  line-height: 0;
1841
1847
  }
1842
- .txtInputIconStart input[data-v-c2bd3e03], .txtInputIconStart textarea[data-v-c2bd3e03]{
1848
+ .txtInputIconStart input[data-v-54de82a7], .txtInputIconStart textarea[data-v-54de82a7]{
1843
1849
  padding-inline-start: calc(var(--input-height) / 3 + 1.5rem);
1844
1850
  }
1845
- .bagel-input.small textarea[data-v-c2bd3e03] {
1851
+ .bagel-input.small textarea[data-v-54de82a7] {
1846
1852
  height: 30px;
1847
1853
  }
1848
1854
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.1155",
4
+ "version": "0.0.1161",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -139,14 +139,14 @@ export function useDraggable(options: DraggableOptions = {}) {
139
139
  return 2
140
140
  }
141
141
 
142
- function resetDragStyles(dragEl: DraggableElement) {
143
- if (defaultOptions.mode === 'ghost') {
144
- dragEl.style.opacity = ''
145
- dragEl.style.transform = ''
146
- } else {
147
- dragEl.style.opacity = ''
148
- }
149
- }
142
+ // function resetDragStyles(dragEl: DraggableElement) {
143
+ // if (defaultOptions.mode === 'ghost') {
144
+ // dragEl.style.opacity = ''
145
+ // dragEl.style.transform = ''
146
+ // } else {
147
+ // dragEl.style.opacity = ''
148
+ // }
149
+ // }
150
150
 
151
151
  function cacheElementPositions(draggedList: DraggableElement[]) {
152
152
  POSITION_CACHE.clear()
@@ -1,12 +1,9 @@
1
1
  <script lang="ts" setup>
2
- import { useSlots } from 'vue'
3
-
4
- const slots = useSlots()
5
2
  </script>
6
3
 
7
4
  <template>
8
- <div class="list-wrap bgl_card thin grid overflow-hidden h-100 pt-0 pb-05 px-0 m_pb-0">
9
- <div v-if="slots.header" class="p-1">
5
+ <div class="list-wrap bgl_card thin grid overflow-hidden pt-0 pb-05 px-0 m_pb-0">
6
+ <div class="p-0">
10
7
  <slot name="header" />
11
8
  </div>
12
9
  <div class="list-content auto-flow-rows align-items-start overflow-y h-100">
@@ -6,38 +6,67 @@ export interface RadioOption<T> {
6
6
  imgSrc?: string
7
7
  subLabel?: string
8
8
  label?: string
9
+ id?: string
10
+ contextObj?: T
9
11
  value: any
10
- id: string
11
- contextObj: T
12
12
  }
13
13
 
14
- defineProps<{
15
- groupName: string
14
+ const props = defineProps<{
15
+ groupName?: string
16
16
  options: RadioOption<ContextObjType>[]
17
17
  deletable?: boolean
18
18
  required?: boolean
19
+ error?: string
20
+ disabled?: boolean
19
21
  }>()
20
- defineEmits(['delete'])
21
22
 
23
+ const emit = defineEmits(['delete', 'focus', 'blur', 'change'])
24
+
25
+ const name = $computed(() => props.groupName || Math.random().toString(36).substring(2, 15))
22
26
  const selectedOption = defineModel('modelValue')
27
+ let isFocused = $ref(false)
28
+
29
+ const containerClasses = $computed(() => ({
30
+ 'has-error': !!props.error,
31
+ 'is-disabled': props.disabled,
32
+ 'is-focused': isFocused
33
+ }))
34
+
35
+ function handleFocus() {
36
+ isFocused = true
37
+ emit('focus')
38
+ }
39
+
40
+ function handleBlur() {
41
+ isFocused = false
42
+ emit('blur')
43
+ }
44
+
45
+ function handleChange() {
46
+ emit('change', selectedOption.value)
47
+ }
23
48
  </script>
24
49
 
25
50
  <template>
26
- <div>
51
+ <div :class="containerClasses">
27
52
  <label
28
- v-for="opt in options"
29
- :key="opt.id"
53
+ v-for="(opt, index) in options"
54
+ :key="opt.id || `${name}-${index}`"
30
55
  class="border rounded p-1 flex bg-gray-light mb-05 gap-075 active-list-item hover"
31
- :for="opt.id"
56
+ :for="opt.id || `${name}-${index}`"
32
57
  >
33
58
  <input
34
- :id="opt.id"
59
+ :id="opt.id || `${name}-${index}`"
35
60
  v-model="selectedOption"
61
+ :disabled="disabled"
36
62
  class="radio-input-list"
37
63
  type="radio"
38
- :name="groupName"
64
+ :name="name"
39
65
  :value="opt.value"
40
66
  :required="required"
67
+ @focus="handleFocus"
68
+ @blur="handleBlur"
69
+ @change="handleChange"
41
70
  >
42
71
  <div class="flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025">
43
72
  <img
@@ -75,4 +104,12 @@ const selectedOption = defineModel('modelValue')
75
104
  border-color: var(--bgl-primary) !important;
76
105
  accent-color: var(--bgl-accent-color);
77
106
  }
107
+
108
+ .has-error .active-list-item {
109
+ border-color: var(--bgl-red) !important;
110
+ }
111
+
112
+ .has-error :is(input[type="radio"]) {
113
+ accent-color: var(--bgl-red);
114
+ }
78
115
  </style>
@@ -44,10 +44,10 @@ let inputVal = $ref<string | number>()
44
44
  const input = $ref<HTMLInputElement>()
45
45
 
46
46
  const inputRows = $computed(() => {
47
- if (props.autoheight) return `${inputVal}`.split('\n').length || props.rows || 1
48
- if (props.rows) return props.rows
49
- if (props.multiline || props.code) return 4
50
- return 1
47
+ let rows = Number(props.rows) || 1
48
+ if (props.autoheight) rows = Math.max(rows, String(inputVal).split('\n').length)
49
+ if (props.multiline || props.code) rows = Math.max(rows, 4)
50
+ return rows
51
51
  })
52
52
 
53
53
  const debouncedEmit = useDebounceFn(() => { emit('debounce', inputVal as string) }, 700)