@bagelink/vue 0.0.116 → 0.0.122
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.
- package/dist/components/DataPreview.vue.d.ts +5 -5
- package/dist/components/FormSchema.vue.d.ts +5 -5
- package/dist/components/FormSchema.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts +0 -2
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/index.cjs +14 -15
- package/dist/index.mjs +14 -15
- package/dist/style.css +5 -5
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/DataPreview.vue +3 -3
- package/src/components/FormSchema.vue +6 -6
- package/src/components/LangText.vue +1 -1
- package/src/components/ListView.vue +0 -1
- package/src/components/ModalForm.vue +1 -1
- package/src/components/PersonPreview.vue +1 -1
- package/src/components/PersonPreviewFormkit.vue +1 -1
- package/src/utils/index.ts +2 -2
|
@@ -2,18 +2,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
2
2
|
data: Record<string, any>;
|
|
3
3
|
schema?: Record<string, any>[] | undefined;
|
|
4
4
|
title?: string | undefined;
|
|
5
|
-
|
|
5
|
+
i18nT: (str: string) => string;
|
|
6
6
|
}>, {
|
|
7
|
-
|
|
7
|
+
i18nT: (str: string) => string;
|
|
8
8
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
9
|
data: Record<string, any>;
|
|
10
10
|
schema?: Record<string, any>[] | undefined;
|
|
11
11
|
title?: string | undefined;
|
|
12
|
-
|
|
12
|
+
i18nT: (str: string) => string;
|
|
13
13
|
}>, {
|
|
14
|
-
|
|
14
|
+
i18nT: (str: string) => string;
|
|
15
15
|
}>>>, {
|
|
16
|
-
|
|
16
|
+
i18nT: (str: string) => string;
|
|
17
17
|
}, {}>, {
|
|
18
18
|
footer?(_: {}): any;
|
|
19
19
|
}>;
|
|
@@ -3,9 +3,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
3
3
|
modelValue?: any;
|
|
4
4
|
schema: FormKitSchemaDefinition;
|
|
5
5
|
onDelete?: ((id: string) => void) | undefined;
|
|
6
|
-
|
|
6
|
+
i18nT: (key: string) => string;
|
|
7
7
|
}>, {
|
|
8
|
-
|
|
8
|
+
i18nT: (key: string) => string;
|
|
9
9
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
submit: (...args: any[]) => void;
|
|
11
11
|
"update:modelValue": (...args: any[]) => void;
|
|
@@ -13,14 +13,14 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
13
13
|
modelValue?: any;
|
|
14
14
|
schema: FormKitSchemaDefinition;
|
|
15
15
|
onDelete?: ((id: string) => void) | undefined;
|
|
16
|
-
|
|
16
|
+
i18nT: (key: string) => string;
|
|
17
17
|
}>, {
|
|
18
|
-
|
|
18
|
+
i18nT: (key: string) => string;
|
|
19
19
|
}>>> & {
|
|
20
20
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
21
21
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
22
22
|
}, {
|
|
23
|
-
|
|
23
|
+
i18nT: (key: string) => string;
|
|
24
24
|
}, {}>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/FormSchema.vue"],"names":[],"mappings":"AA0BA;AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;;iBA4J/C,GAAG;YACR,uBAAuB;qBAEd,MAAM,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"FormSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/FormSchema.vue"],"names":[],"mappings":"AA0BA;AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;;iBA4J/C,GAAG;YACR,uBAAuB;qBAEd,MAAM,KAAK,IAAI;iBAEnB,MAAM,KAAK,MAAM;;;;;;;iBALjB,GAAG;YACR,uBAAuB;qBAEd,MAAM,KAAK,IAAI;iBAEnB,MAAM,KAAK,MAAM;;;;;;;iBAAjB,MAAM,KAAK,MAAM;;AAP/B,wBAcG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
2
|
enableAdd: boolean;
|
|
3
3
|
enableSearch: boolean;
|
|
4
|
-
open: boolean;
|
|
5
4
|
searchPlaceholder: string;
|
|
6
5
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
6
|
search: (...args: any[]) => void;
|
|
@@ -10,7 +9,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
10
9
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
11
10
|
enableAdd: boolean;
|
|
12
11
|
enableSearch: boolean;
|
|
13
|
-
open: boolean;
|
|
14
12
|
searchPlaceholder: string;
|
|
15
13
|
}>>> & {
|
|
16
14
|
onSearch?: ((...args: any[]) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.vue.d.ts","sourceRoot":"","sources":["../../src/components/ListView.vue"],"names":[],"mappings":"AA6BA
|
|
1
|
+
{"version":3,"file":"ListView.vue.d.ts","sourceRoot":"","sources":["../../src/components/ListView.vue"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;AA8KA,wBAAwG;AAGxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -2364,11 +2364,11 @@ const useFormkit = () => {
|
|
|
2364
2364
|
return formkit;
|
|
2365
2365
|
};
|
|
2366
2366
|
const initials = (...strArr) => strArr.map((str) => str == null ? void 0 : str.charAt(0)).join("");
|
|
2367
|
-
const parseLocale = (str,
|
|
2367
|
+
const parseLocale = (str, i18nT = (_str) => _str) => {
|
|
2368
2368
|
const [_, w] = str.split(/\$t\('?"?|'?"?\)/);
|
|
2369
2369
|
if (!w)
|
|
2370
2370
|
return str;
|
|
2371
|
-
return
|
|
2371
|
+
return i18nT(w);
|
|
2372
2372
|
};
|
|
2373
2373
|
const _hoisted_1$V = { ref: "el" };
|
|
2374
2374
|
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -14840,7 +14840,6 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
14840
14840
|
props: {
|
|
14841
14841
|
enableAdd: { type: Boolean },
|
|
14842
14842
|
enableSearch: { type: Boolean },
|
|
14843
|
-
open: { type: Boolean },
|
|
14844
14843
|
searchPlaceholder: {}
|
|
14845
14844
|
},
|
|
14846
14845
|
emits: ["search", "add", "debounce"],
|
|
@@ -15187,7 +15186,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
15187
15186
|
vue.createElementVNode("h3", _hoisted_3$z, vue.toDisplayString(_ctx.title), 1)
|
|
15188
15187
|
]),
|
|
15189
15188
|
vue.createVNode(vue.unref(_sfc_main$B), {
|
|
15190
|
-
onDelete: _ctx.onDelete ? runDelete :
|
|
15189
|
+
onDelete: _ctx.onDelete ? runDelete : void 0,
|
|
15191
15190
|
modelValue: _ctx.modelValue,
|
|
15192
15191
|
"onUpdate:modelValue": handleEmit,
|
|
15193
15192
|
onSubmit: runSubmit,
|
|
@@ -15198,7 +15197,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
15198
15197
|
};
|
|
15199
15198
|
}
|
|
15200
15199
|
});
|
|
15201
|
-
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
15200
|
+
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-665350cb"]]);
|
|
15202
15201
|
const _hoisted_1$J = {
|
|
15203
15202
|
key: 0,
|
|
15204
15203
|
class: "data"
|
|
@@ -15217,7 +15216,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
15217
15216
|
data: {},
|
|
15218
15217
|
schema: {},
|
|
15219
15218
|
title: {},
|
|
15220
|
-
|
|
15219
|
+
i18nT: { type: Function, default: (str) => str }
|
|
15221
15220
|
},
|
|
15222
15221
|
setup(__props) {
|
|
15223
15222
|
const keysToIgnore = ["id", "person_id", "person", "created_at", "updated_at"];
|
|
@@ -15247,7 +15246,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
15247
15246
|
class: "data-row",
|
|
15248
15247
|
key
|
|
15249
15248
|
}, [
|
|
15250
|
-
vue.createElementVNode("div", _hoisted_5$i, vue.toDisplayString(_ctx
|
|
15249
|
+
vue.createElementVNode("div", _hoisted_5$i, vue.toDisplayString(_ctx.i18nT(vue.unref(keyToLabel)(key))), 1),
|
|
15251
15250
|
vue.createElementVNode("div", _hoisted_6$f, vue.toDisplayString(value), 1)
|
|
15252
15251
|
]);
|
|
15253
15252
|
}), 128))
|
|
@@ -15257,14 +15256,14 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
15257
15256
|
};
|
|
15258
15257
|
}
|
|
15259
15258
|
});
|
|
15260
|
-
const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
15259
|
+
const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-d4ee3566"]]);
|
|
15261
15260
|
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
15262
15261
|
__name: "FormSchema",
|
|
15263
15262
|
props: {
|
|
15264
15263
|
modelValue: {},
|
|
15265
15264
|
schema: {},
|
|
15266
15265
|
onDelete: {},
|
|
15267
|
-
|
|
15266
|
+
i18nT: { type: Function, default: (key) => key }
|
|
15268
15267
|
},
|
|
15269
15268
|
emits: ["update:modelValue", "submit"],
|
|
15270
15269
|
setup(__props, { emit: __emit }) {
|
|
@@ -15275,13 +15274,13 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
|
15275
15274
|
const props2 = __props;
|
|
15276
15275
|
const data2 = vue.reactive({
|
|
15277
15276
|
...props2.modelValue,
|
|
15278
|
-
t: (val) => props2
|
|
15277
|
+
t: (val) => props2.i18nT(val)
|
|
15279
15278
|
});
|
|
15280
15279
|
const runDelete = () => {
|
|
15281
15280
|
showModal(
|
|
15282
15281
|
{
|
|
15283
15282
|
class: "small-modal",
|
|
15284
|
-
title: props2
|
|
15283
|
+
title: props2.i18nT("Are you sure?"),
|
|
15285
15284
|
actions: [
|
|
15286
15285
|
{
|
|
15287
15286
|
value: "Confirm",
|
|
@@ -15294,7 +15293,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
|
15294
15293
|
{ value: "Cancel", color: "gray" }
|
|
15295
15294
|
]
|
|
15296
15295
|
},
|
|
15297
|
-
{ default: props2
|
|
15296
|
+
{ default: props2.i18nT("form.deleteMessage") }
|
|
15298
15297
|
);
|
|
15299
15298
|
};
|
|
15300
15299
|
return (_ctx, _cache) => {
|
|
@@ -15307,7 +15306,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
|
15307
15306
|
modelValue: _ctx.modelValue,
|
|
15308
15307
|
"onUpdate:modelValue": handleEmit,
|
|
15309
15308
|
onSubmit: runSubmit,
|
|
15310
|
-
submitLabel: _ctx
|
|
15309
|
+
submitLabel: _ctx.i18nT("save")
|
|
15311
15310
|
}, {
|
|
15312
15311
|
default: vue.withCtx(() => [
|
|
15313
15312
|
vue.createVNode(_component_FormKitSchema, {
|
|
@@ -15564,7 +15563,7 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
15564
15563
|
schema: props2.personSchema(),
|
|
15565
15564
|
modelValue: props2.person,
|
|
15566
15565
|
onSubmit: (newPerson) => bagel.put("/person", newPerson)
|
|
15567
|
-
// .then(() => toast.success(
|
|
15566
|
+
// .then(() => toast.success(i18nT('updatedSuccessfully'))),
|
|
15568
15567
|
});
|
|
15569
15568
|
};
|
|
15570
15569
|
return (_ctx, _cache) => {
|
|
@@ -17914,7 +17913,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
17914
17913
|
schema: props2.personSchema,
|
|
17915
17914
|
modelValue: person.value,
|
|
17916
17915
|
onSubmit: (newPerson) => bagel.put("/person", newPerson)
|
|
17917
|
-
// .then(() => toast.success(
|
|
17916
|
+
// .then(() => toast.success(i18nT('updatedSuccessfully'))), // TODO: use toast
|
|
17918
17917
|
});
|
|
17919
17918
|
};
|
|
17920
17919
|
return (_ctx, _cache) => {
|
package/dist/index.mjs
CHANGED
|
@@ -2362,11 +2362,11 @@ const useFormkit = () => {
|
|
|
2362
2362
|
return formkit;
|
|
2363
2363
|
};
|
|
2364
2364
|
const initials = (...strArr) => strArr.map((str) => str == null ? void 0 : str.charAt(0)).join("");
|
|
2365
|
-
const parseLocale = (str,
|
|
2365
|
+
const parseLocale = (str, i18nT = (_str) => _str) => {
|
|
2366
2366
|
const [_, w] = str.split(/\$t\('?"?|'?"?\)/);
|
|
2367
2367
|
if (!w)
|
|
2368
2368
|
return str;
|
|
2369
|
-
return
|
|
2369
|
+
return i18nT(w);
|
|
2370
2370
|
};
|
|
2371
2371
|
const _hoisted_1$V = { ref: "el" };
|
|
2372
2372
|
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
@@ -14838,7 +14838,6 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
14838
14838
|
props: {
|
|
14839
14839
|
enableAdd: { type: Boolean },
|
|
14840
14840
|
enableSearch: { type: Boolean },
|
|
14841
|
-
open: { type: Boolean },
|
|
14842
14841
|
searchPlaceholder: {}
|
|
14843
14842
|
},
|
|
14844
14843
|
emits: ["search", "add", "debounce"],
|
|
@@ -15185,7 +15184,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
15185
15184
|
createElementVNode("h3", _hoisted_3$z, toDisplayString(_ctx.title), 1)
|
|
15186
15185
|
]),
|
|
15187
15186
|
createVNode(unref(_sfc_main$B), {
|
|
15188
|
-
onDelete: _ctx.onDelete ? runDelete :
|
|
15187
|
+
onDelete: _ctx.onDelete ? runDelete : void 0,
|
|
15189
15188
|
modelValue: _ctx.modelValue,
|
|
15190
15189
|
"onUpdate:modelValue": handleEmit,
|
|
15191
15190
|
onSubmit: runSubmit,
|
|
@@ -15196,7 +15195,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
15196
15195
|
};
|
|
15197
15196
|
}
|
|
15198
15197
|
});
|
|
15199
|
-
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
15198
|
+
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-665350cb"]]);
|
|
15200
15199
|
const _hoisted_1$J = {
|
|
15201
15200
|
key: 0,
|
|
15202
15201
|
class: "data"
|
|
@@ -15215,7 +15214,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
15215
15214
|
data: {},
|
|
15216
15215
|
schema: {},
|
|
15217
15216
|
title: {},
|
|
15218
|
-
|
|
15217
|
+
i18nT: { type: Function, default: (str) => str }
|
|
15219
15218
|
},
|
|
15220
15219
|
setup(__props) {
|
|
15221
15220
|
const keysToIgnore = ["id", "person_id", "person", "created_at", "updated_at"];
|
|
@@ -15245,7 +15244,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
15245
15244
|
class: "data-row",
|
|
15246
15245
|
key
|
|
15247
15246
|
}, [
|
|
15248
|
-
createElementVNode("div", _hoisted_5$i, toDisplayString(_ctx
|
|
15247
|
+
createElementVNode("div", _hoisted_5$i, toDisplayString(_ctx.i18nT(unref(keyToLabel)(key))), 1),
|
|
15249
15248
|
createElementVNode("div", _hoisted_6$f, toDisplayString(value), 1)
|
|
15250
15249
|
]);
|
|
15251
15250
|
}), 128))
|
|
@@ -15255,14 +15254,14 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
15255
15254
|
};
|
|
15256
15255
|
}
|
|
15257
15256
|
});
|
|
15258
|
-
const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
15257
|
+
const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-d4ee3566"]]);
|
|
15259
15258
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
15260
15259
|
__name: "FormSchema",
|
|
15261
15260
|
props: {
|
|
15262
15261
|
modelValue: {},
|
|
15263
15262
|
schema: {},
|
|
15264
15263
|
onDelete: {},
|
|
15265
|
-
|
|
15264
|
+
i18nT: { type: Function, default: (key) => key }
|
|
15266
15265
|
},
|
|
15267
15266
|
emits: ["update:modelValue", "submit"],
|
|
15268
15267
|
setup(__props, { emit: __emit }) {
|
|
@@ -15273,13 +15272,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
15273
15272
|
const props2 = __props;
|
|
15274
15273
|
const data2 = reactive({
|
|
15275
15274
|
...props2.modelValue,
|
|
15276
|
-
t: (val) => props2
|
|
15275
|
+
t: (val) => props2.i18nT(val)
|
|
15277
15276
|
});
|
|
15278
15277
|
const runDelete = () => {
|
|
15279
15278
|
showModal(
|
|
15280
15279
|
{
|
|
15281
15280
|
class: "small-modal",
|
|
15282
|
-
title: props2
|
|
15281
|
+
title: props2.i18nT("Are you sure?"),
|
|
15283
15282
|
actions: [
|
|
15284
15283
|
{
|
|
15285
15284
|
value: "Confirm",
|
|
@@ -15292,7 +15291,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
15292
15291
|
{ value: "Cancel", color: "gray" }
|
|
15293
15292
|
]
|
|
15294
15293
|
},
|
|
15295
|
-
{ default: props2
|
|
15294
|
+
{ default: props2.i18nT("form.deleteMessage") }
|
|
15296
15295
|
);
|
|
15297
15296
|
};
|
|
15298
15297
|
return (_ctx, _cache) => {
|
|
@@ -15305,7 +15304,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
15305
15304
|
modelValue: _ctx.modelValue,
|
|
15306
15305
|
"onUpdate:modelValue": handleEmit,
|
|
15307
15306
|
onSubmit: runSubmit,
|
|
15308
|
-
submitLabel: _ctx
|
|
15307
|
+
submitLabel: _ctx.i18nT("save")
|
|
15309
15308
|
}, {
|
|
15310
15309
|
default: withCtx(() => [
|
|
15311
15310
|
createVNode(_component_FormKitSchema, {
|
|
@@ -15562,7 +15561,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
15562
15561
|
schema: props2.personSchema(),
|
|
15563
15562
|
modelValue: props2.person,
|
|
15564
15563
|
onSubmit: (newPerson) => bagel.put("/person", newPerson)
|
|
15565
|
-
// .then(() => toast.success(
|
|
15564
|
+
// .then(() => toast.success(i18nT('updatedSuccessfully'))),
|
|
15566
15565
|
});
|
|
15567
15566
|
};
|
|
15568
15567
|
return (_ctx, _cache) => {
|
|
@@ -17912,7 +17911,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
17912
17911
|
schema: props2.personSchema,
|
|
17913
17912
|
modelValue: person.value,
|
|
17914
17913
|
onSubmit: (newPerson) => bagel.put("/person", newPerson)
|
|
17915
|
-
// .then(() => toast.success(
|
|
17914
|
+
// .then(() => toast.success(i18nT('updatedSuccessfully'))), // TODO: use toast
|
|
17916
17915
|
});
|
|
17917
17916
|
};
|
|
17918
17917
|
return (_ctx, _cache) => {
|
package/dist/style.css
CHANGED
|
@@ -748,21 +748,21 @@
|
|
|
748
748
|
border-radius: var(--btn-border-radius);
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
.modal-title[data-v-
|
|
751
|
+
.modal-title[data-v-665350cb] {
|
|
752
752
|
margin-top: 0.5rem;
|
|
753
753
|
}
|
|
754
754
|
@media screen and (max-width: 910px) {
|
|
755
|
-
.modal-title[data-v-
|
|
755
|
+
.modal-title[data-v-665350cb] {
|
|
756
756
|
margin-top: 1rem;
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
759
|
|
|
760
|
-
.data[data-v-
|
|
760
|
+
.data[data-v-d4ee3566] {
|
|
761
761
|
border: 1.1px solid var(--border-color);
|
|
762
762
|
padding: 20px;
|
|
763
763
|
border-radius: var(--input-border-radius);
|
|
764
764
|
}
|
|
765
|
-
.data-row[data-v-
|
|
765
|
+
.data-row[data-v-d4ee3566] {
|
|
766
766
|
display: flex;
|
|
767
767
|
justify-content: space-between;
|
|
768
768
|
padding-bottom: 0.5rem;
|
|
@@ -770,7 +770,7 @@
|
|
|
770
770
|
opacity: 0.8;
|
|
771
771
|
border-bottom: 1px solid var(--border-color);
|
|
772
772
|
}
|
|
773
|
-
.data-link[data-v-
|
|
773
|
+
.data-link[data-v-d4ee3566] {
|
|
774
774
|
display: block;
|
|
775
775
|
font-size: var(--input-font-size);
|
|
776
776
|
margin-bottom: 2px;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export declare function computeFields(modelValue: Record<string, any>): BagelFie
|
|
|
5
5
|
export declare const copyText: (text: string, cb?: ((msg: string) => void) | undefined) => Promise<void>;
|
|
6
6
|
export declare const useFormkit: () => unknown;
|
|
7
7
|
export declare const initials: (...strArr: string[]) => string;
|
|
8
|
-
export declare const parseLocale: (str: string,
|
|
8
|
+
export declare const parseLocale: (str: string, i18nT?: (_str: string) => string) => string;
|
|
9
9
|
export { formatString } from './strings';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,QAAQ,OAAQ,MAAM,IAAI,yBAGtC,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,WAG3B,CAAC;AAEZ,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU,EAAE,CAmB3E;AAED,eAAO,MAAM,QAAQ,SACd,MAAM,cAED,MAAM,KAAK,IAAI,+BAI1B,CAAC;AAEF,eAAO,MAAM,UAAU,eAGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,cAAe,MAAM,EAAE,WAAiD,CAAC;AAE9F,eAAO,MAAM,WAAW,QAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,QAAQ,OAAQ,MAAM,IAAI,yBAGtC,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,WAG3B,CAAC;AAEZ,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU,EAAE,CAmB3E;AAED,eAAO,MAAM,QAAQ,SACd,MAAM,cAED,MAAM,KAAK,IAAI,+BAI1B,CAAC;AAEF,eAAO,MAAM,UAAU,eAGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,cAAe,MAAM,EAAE,WAAiD,CAAC;AAE9F,eAAO,MAAM,WAAW,QAAS,MAAM,iBAAiB,MAAM,sBAK7D,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
:key="key"
|
|
34
34
|
>
|
|
35
35
|
<div class="key">
|
|
36
|
-
{{
|
|
36
|
+
{{ i18nT(keyToLabel(key)) }}
|
|
37
37
|
</div>
|
|
38
38
|
<div class="vlue">
|
|
39
39
|
{{ value }}
|
|
@@ -54,9 +54,9 @@ withDefaults(defineProps<{
|
|
|
54
54
|
data: Record<string, any>,
|
|
55
55
|
schema?: Record<string, any>[],
|
|
56
56
|
title?: string,
|
|
57
|
-
|
|
57
|
+
i18nT: (str: string) => string,
|
|
58
58
|
}>(), {
|
|
59
|
-
|
|
59
|
+
i18nT: (str: string) => str,
|
|
60
60
|
});
|
|
61
61
|
</script>
|
|
62
62
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:modelValue="modelValue"
|
|
6
6
|
@update:modelValue="handleEmit"
|
|
7
7
|
@submit="runSubmit"
|
|
8
|
-
:submitLabel="
|
|
8
|
+
:submitLabel="i18nT('save')"
|
|
9
9
|
>
|
|
10
10
|
<FormKitSchema
|
|
11
11
|
:schema="schema"
|
|
@@ -43,21 +43,21 @@ const props = withDefaults(defineProps<{
|
|
|
43
43
|
// eslint-disable-next-line no-unused-vars
|
|
44
44
|
onDelete?: ((id: string) => void);
|
|
45
45
|
// eslint-disable-next-line no-unused-vars
|
|
46
|
-
|
|
46
|
+
i18nT: (key: string) => string;
|
|
47
47
|
}>(), {
|
|
48
|
-
|
|
48
|
+
i18nT: (key: string) => key,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
const data = reactive({
|
|
52
52
|
...props.modelValue,
|
|
53
|
-
t: (val: string) => props
|
|
53
|
+
t: (val: string) => props.i18nT(val),
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
const runDelete = () => {
|
|
57
57
|
showModal(
|
|
58
58
|
{
|
|
59
59
|
class: 'small-modal',
|
|
60
|
-
title: props
|
|
60
|
+
title: props.i18nT('Are you sure?'),
|
|
61
61
|
actions: [
|
|
62
62
|
{
|
|
63
63
|
value: 'Confirm',
|
|
@@ -67,7 +67,7 @@ const runDelete = () => {
|
|
|
67
67
|
{ value: 'Cancel', color: 'gray' },
|
|
68
68
|
],
|
|
69
69
|
},
|
|
70
|
-
{ default: props
|
|
70
|
+
{ default: props.i18nT('form.deleteMessage') },
|
|
71
71
|
);
|
|
72
72
|
};
|
|
73
73
|
</script>
|
|
@@ -100,7 +100,7 @@ const showEditForm = async () => {
|
|
|
100
100
|
modelValue: props.person,
|
|
101
101
|
onSubmit: (newPerson) => bagel
|
|
102
102
|
.put('/person', newPerson),
|
|
103
|
-
// .then(() => toast.success(
|
|
103
|
+
// .then(() => toast.success(i18nT('updatedSuccessfully'))),
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
106
|
</script>
|
|
@@ -102,7 +102,7 @@ const showEditForm = async () => {
|
|
|
102
102
|
schema: props.personSchema,
|
|
103
103
|
modelValue: person,
|
|
104
104
|
onSubmit: (newPerson) => bagel.put('/person', newPerson),
|
|
105
|
-
// .then(() => toast.success(
|
|
105
|
+
// .then(() => toast.success(i18nT('updatedSuccessfully'))), // TODO: use toast
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
108
|
</script>
|
package/src/utils/index.ts
CHANGED
|
@@ -50,11 +50,11 @@ export const useFormkit = () => {
|
|
|
50
50
|
|
|
51
51
|
export const initials = (...strArr: string[]) => strArr.map((str) => str?.charAt(0)).join('');
|
|
52
52
|
|
|
53
|
-
export const parseLocale = (str: string,
|
|
53
|
+
export const parseLocale = (str: string, i18nT = (_str: string) => _str) => {
|
|
54
54
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
55
55
|
const [_, w] = str.split(/\$t\('?"?|'?"?\)/);
|
|
56
56
|
if (!w) return str;
|
|
57
|
-
return
|
|
57
|
+
return i18nT(w);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export { formatString } from './strings';
|