@bagelink/vue 0.0.556 → 0.0.560
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/TableSchema.vue.d.ts +1 -50
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/Toolbar.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/formatting.d.ts.map +1 -1
- package/dist/index.cjs +40 -39
- package/dist/index.mjs +40 -39
- package/dist/style.css +507 -112
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +2 -2
- package/src/components/TableSchema.vue +9 -9
- package/src/components/form/BglField.vue +16 -19
- package/src/components/form/inputs/RichText2/Toolbar.vue +1 -0
- package/src/components/form/inputs/RichText2/formatting.ts +18 -12
- package/src/styles/layout.css +230 -1
- package/src/styles/mobilLayout.css +264 -40
- package/src/utils/index.ts +1 -0
|
@@ -2,56 +2,7 @@ import { BglFormSchemaT } from '..';
|
|
|
2
2
|
|
|
3
3
|
declare function __VLS_template(): Partial<Record<string, (_: {
|
|
4
4
|
row: Record<string, any>;
|
|
5
|
-
field:
|
|
6
|
-
transform: undefined;
|
|
7
|
-
$el?: any;
|
|
8
|
-
id?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
children?: import('..').Field<Record<string, any>>[] | undefined;
|
|
12
|
-
class?: import('..').AttributeValue | import('..').AttributeFn<Record<string, any>>;
|
|
13
|
-
attrs?: import('..').Attributes<Record<string, any>> | undefined;
|
|
14
|
-
required?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
helptext?: string;
|
|
17
|
-
options?: import('..').BagelFieldOptions;
|
|
18
|
-
defaultValue?: any;
|
|
19
|
-
onUpdate?: (val: any, rowData?: Record<string, any>) => void;
|
|
20
|
-
'v-if'?: string | boolean | ((val: any, row: Record<string, any>) => boolean) | undefined;
|
|
21
|
-
} | {
|
|
22
|
-
transform: undefined;
|
|
23
|
-
$el: "text" | typeof import('..').TextInput;
|
|
24
|
-
id: string;
|
|
25
|
-
type?: string;
|
|
26
|
-
label?: string;
|
|
27
|
-
placeholder?: string;
|
|
28
|
-
children?: import('..').Field<Record<string, any>>[] | undefined;
|
|
29
|
-
class?: import('..').AttributeValue | import('..').AttributeFn<Record<string, any>>;
|
|
30
|
-
attrs?: import('..').Attributes<Record<string, any>> | undefined;
|
|
31
|
-
required?: boolean;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
helptext?: string;
|
|
34
|
-
options?: import('..').BagelFieldOptions;
|
|
35
|
-
defaultValue?: any;
|
|
36
|
-
onUpdate?: (val: any, rowData?: Record<string, any>) => void;
|
|
37
|
-
'v-if'?: string | boolean | ((val: any, row: Record<string, any>) => boolean) | undefined;
|
|
38
|
-
} | {
|
|
39
|
-
transform: undefined;
|
|
40
|
-
$el: "select" | typeof import('..').SelectInput;
|
|
41
|
-
id: string;
|
|
42
|
-
label?: string;
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
children?: import('..').Field<Record<string, any>>[] | undefined;
|
|
45
|
-
class?: import('..').AttributeValue | import('..').AttributeFn<Record<string, any>>;
|
|
46
|
-
attrs?: import('..').Attributes<Record<string, any>> | undefined;
|
|
47
|
-
required?: boolean;
|
|
48
|
-
disabled?: boolean;
|
|
49
|
-
helptext?: string;
|
|
50
|
-
options?: import('..').BagelFieldOptions;
|
|
51
|
-
defaultValue?: any;
|
|
52
|
-
onUpdate?: (val: any, rowData?: Record<string, any>) => void;
|
|
53
|
-
'v-if'?: string | boolean | ((val: any, row: Record<string, any>) => boolean) | undefined;
|
|
54
|
-
};
|
|
5
|
+
field: import('..').Field<Record<string, any>>;
|
|
55
6
|
}) => any>>;
|
|
56
7
|
declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
57
8
|
selectedItems?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,cAAc,EAGnB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,cAAc,EAGnB,MAAM,eAAe,CAAA;AAwHtB,iBAAS,cAAc;;;MA6O+D,GAAG,GAIxF;AAyBD,QAAA,MAAM,eAAe;oBAMJ,MAAM,EAAE;UAClB,GAAG,EAAE;aACF,cAAc,GAAG,CAAC,MAAM,cAAc,CAAC;iBACnC,MAAM,EAAE;;;;;;oBAHL,MAAM,EAAE;UAClB,GAAG,EAAE;aACF,cAAc,GAAG,CAAC,MAAM,cAAc,CAAC;iBACnC,MAAM,EAAE;;;;;UAGpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BglField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/form/BglField.vue"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,KAAK,EAOV,MAAM,eAAe,CAAA;;
|
|
1
|
+
{"version":3,"file":"BglField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/form/BglField.vue"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,KAAK,EAOV,MAAM,eAAe,CAAA;;WA4Jb,KAAK;gBACA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;WADxB,KAAK;gBACA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;gBAAnB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;AAPjC,wBAUG;AACH,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/Toolbar.vue"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAA;;
|
|
1
|
+
{"version":3,"file":"Toolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/Toolbar.vue"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAA;;YA0KrB,aAAa;;;;YAAb,aAAa;;;;AALlE,wBAOG;AACH,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/formatting.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,QAyFlE;AAoDD,wBAAgB,UAAU,SAWzB;AAED,wBAAgB,WAAW,SAgB1B;AAED,wBAAgB,WAAW,SAyB1B"}
|
package/dist/index.cjs
CHANGED
|
@@ -5516,8 +5516,8 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
5516
5516
|
},
|
|
5517
5517
|
setup(__props) {
|
|
5518
5518
|
vue.useCssVars((_ctx) => ({
|
|
5519
|
-
"
|
|
5520
|
-
"
|
|
5519
|
+
"5113a6cf": computedBackgroundColor.value,
|
|
5520
|
+
"ae07d62c": cumputedTextColor.value
|
|
5521
5521
|
}));
|
|
5522
5522
|
const props2 = __props;
|
|
5523
5523
|
const isComponent = vue.computed(() => {
|
|
@@ -5559,13 +5559,13 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
5559
5559
|
const cumputedTextColor = vue.computed(
|
|
5560
5560
|
() => {
|
|
5561
5561
|
var _a2;
|
|
5562
|
-
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.color)
|
|
5562
|
+
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.color) ?? computedDefaultColors.value.color;
|
|
5563
5563
|
}
|
|
5564
5564
|
);
|
|
5565
5565
|
const computedBackgroundColor = vue.computed(
|
|
5566
5566
|
() => {
|
|
5567
5567
|
var _a2;
|
|
5568
|
-
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.backgroundColor)
|
|
5568
|
+
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.backgroundColor) ?? computedDefaultColors.value.backgroundColor;
|
|
5569
5569
|
}
|
|
5570
5570
|
);
|
|
5571
5571
|
return (_ctx, _cache) => {
|
|
@@ -5606,7 +5606,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
5606
5606
|
};
|
|
5607
5607
|
}
|
|
5608
5608
|
});
|
|
5609
|
-
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-
|
|
5609
|
+
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-65a6e961"]]);
|
|
5610
5610
|
const _hoisted_1$H = {
|
|
5611
5611
|
key: 0,
|
|
5612
5612
|
class: "tool-bar"
|
|
@@ -6023,6 +6023,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
6023
6023
|
}
|
|
6024
6024
|
let sortDirection = vue.ref("ASC");
|
|
6025
6025
|
let sortField = vue.ref("");
|
|
6026
|
+
const computedSortField = vue.computed(() => `_transformed_${sortField.value}`);
|
|
6026
6027
|
function getFallbackSchema() {
|
|
6027
6028
|
const keys4 = [
|
|
6028
6029
|
...new Set((props2.data || []).map(Object.keys).flat())
|
|
@@ -6033,7 +6034,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
6033
6034
|
}));
|
|
6034
6035
|
return props2.showFields ? schema.filter((f2) => {
|
|
6035
6036
|
var _a2;
|
|
6036
|
-
return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id))
|
|
6037
|
+
return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id)) ?? !f2.id;
|
|
6037
6038
|
}) : schema;
|
|
6038
6039
|
}
|
|
6039
6040
|
const computedSchema = vue.computed(() => {
|
|
@@ -6055,9 +6056,10 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
6055
6056
|
const fields = computedSchema.value.filter((f2) => f2.id);
|
|
6056
6057
|
for (const field of fields) {
|
|
6057
6058
|
const fieldData = rowData[`${field.id}`];
|
|
6058
|
-
const newFieldVal = (
|
|
6059
|
+
const newFieldVal = (_a2 = field.transform) == null ? void 0 : _a2.call(field, fieldData, rowData);
|
|
6059
6060
|
Object.assign(obj, {
|
|
6060
|
-
[`${field.id}`]:
|
|
6061
|
+
[`${field.id}`]: fieldData,
|
|
6062
|
+
[`_transformed_${field.id}`]: newFieldVal
|
|
6061
6063
|
});
|
|
6062
6064
|
}
|
|
6063
6065
|
return obj;
|
|
@@ -6066,8 +6068,8 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
6066
6068
|
const dta = [...props2.data].map(transform);
|
|
6067
6069
|
if (sortField.value) {
|
|
6068
6070
|
return dta.sort((a2, b2) => {
|
|
6069
|
-
const aValue = a2[
|
|
6070
|
-
const bValue = b2[
|
|
6071
|
+
const aValue = a2[computedSortField.value] ?? "";
|
|
6072
|
+
const bValue = b2[computedSortField.value] ?? "";
|
|
6071
6073
|
const numAValue = Number.parseInt(aValue, 10);
|
|
6072
6074
|
const numBValue = Number.parseInt(bValue, 10);
|
|
6073
6075
|
if (!Number.isNaN(numAValue) && !Number.isNaN(numBValue)) {
|
|
@@ -6128,10 +6130,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
6128
6130
|
class: "row row-item position-relative",
|
|
6129
6131
|
onClick: ($event) => selectElement(row)
|
|
6130
6132
|
}, [
|
|
6131
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value
|
|
6132
|
-
...c2,
|
|
6133
|
-
transform: void 0
|
|
6134
|
-
})), (field) => {
|
|
6133
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
|
|
6135
6134
|
return vue.openBlock(), vue.createElementBlock("td", {
|
|
6136
6135
|
key: `${field.id}-${row.id}`,
|
|
6137
6136
|
class: "col"
|
|
@@ -6158,7 +6157,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
6158
6157
|
};
|
|
6159
6158
|
}
|
|
6160
6159
|
});
|
|
6161
|
-
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-
|
|
6160
|
+
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-9d32d080"]]);
|
|
6162
6161
|
const _sfc_main$E = {};
|
|
6163
6162
|
const _hoisted_1$B = { class: "flex space-between" };
|
|
6164
6163
|
function _sfc_render$1(_ctx, _cache) {
|
|
@@ -16524,7 +16523,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
16524
16523
|
if (props2.field.$el === "check") return CheckInput;
|
|
16525
16524
|
if (props2.field.$el === "richtext") return _sfc_main$c;
|
|
16526
16525
|
if (props2.field.$el === "date") return _sfc_main$n;
|
|
16527
|
-
return props2.field.$el
|
|
16526
|
+
return props2.field.$el ?? "div";
|
|
16528
16527
|
});
|
|
16529
16528
|
const formData = vue.computed({
|
|
16530
16529
|
get: () => props2.modelValue,
|
|
@@ -16553,35 +16552,43 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
16553
16552
|
}
|
|
16554
16553
|
return true;
|
|
16555
16554
|
});
|
|
16556
|
-
const badTransform = /undefined|NaN|Invalid Date/;
|
|
16557
16555
|
const computedFieldData = vue.computed(
|
|
16558
16556
|
() => {
|
|
16559
16557
|
var _a2, _b;
|
|
16560
|
-
|
|
16561
|
-
|
|
16562
|
-
|
|
16558
|
+
return ((_b = (_a2 = props2.field).transform) == null ? void 0 : _b.call(_a2, fieldData.value, props2.modelValue)) ?? fieldData.value;
|
|
16559
|
+
}
|
|
16560
|
+
);
|
|
16561
|
+
const computedOptions = vue.computed(
|
|
16562
|
+
() => bindAttrs({ options: props2.field.options }, fieldData.value, props2.modelValue).options
|
|
16563
|
+
);
|
|
16564
|
+
const computedAttrs = vue.computed(
|
|
16565
|
+
() => bindAttrs(props2.field.attrs || {}, fieldData.value, props2.modelValue)
|
|
16566
|
+
);
|
|
16567
|
+
const computedClass = vue.computed(
|
|
16568
|
+
() => {
|
|
16569
|
+
var _a2;
|
|
16570
|
+
return classify(fieldData.value, props2.modelValue, props2.field.class, (_a2 = props2.field.attrs) == null ? void 0 : _a2.class);
|
|
16563
16571
|
}
|
|
16564
16572
|
);
|
|
16565
16573
|
return (_ctx, _cache) => {
|
|
16566
|
-
var _a2, _b;
|
|
16567
16574
|
const _component_BglField = vue.resolveComponent("BglField", true);
|
|
16568
|
-
return vIf.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(is4.value), vue.mergeProps({ key: 0 },
|
|
16575
|
+
return vIf.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(is4.value), vue.mergeProps({ key: 0 }, computedAttrs.value, {
|
|
16569
16576
|
id: _ctx.field.id,
|
|
16570
16577
|
modelValue: fieldData.value,
|
|
16571
16578
|
"onUpdate:modelValue": [
|
|
16572
16579
|
_cache[1] || (_cache[1] = ($event) => fieldData.value = $event),
|
|
16573
16580
|
_cache[2] || (_cache[2] = ($event) => {
|
|
16574
|
-
var
|
|
16575
|
-
return (
|
|
16581
|
+
var _a2, _b;
|
|
16582
|
+
return (_b = (_a2 = _ctx.field) == null ? void 0 : _a2.onUpdate) == null ? void 0 : _b.call(_a2, $event, formData.value);
|
|
16576
16583
|
})
|
|
16577
16584
|
],
|
|
16578
16585
|
required: _ctx.field.required,
|
|
16579
|
-
class:
|
|
16586
|
+
class: computedClass.value,
|
|
16580
16587
|
label: _ctx.field.label,
|
|
16581
16588
|
placeholder: _ctx.field.placeholder || _ctx.field.label,
|
|
16582
16589
|
defaultValue: _ctx.field.defaultValue,
|
|
16583
16590
|
disabled: _ctx.field.disabled,
|
|
16584
|
-
options:
|
|
16591
|
+
options: computedOptions.value,
|
|
16585
16592
|
helptext: _ctx.field.helptext
|
|
16586
16593
|
}), {
|
|
16587
16594
|
default: vue.withCtx(() => [
|
|
@@ -55695,7 +55702,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
55695
55702
|
};
|
|
55696
55703
|
}
|
|
55697
55704
|
});
|
|
55698
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-
|
|
55705
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-4c741194"]]);
|
|
55699
55706
|
function applyFormatting(command2, value = "") {
|
|
55700
55707
|
const selection = window.getSelection();
|
|
55701
55708
|
if (selection && selection.rangeCount > 0) {
|
|
@@ -55770,7 +55777,7 @@ function applyFormatting(command2, value = "") {
|
|
|
55770
55777
|
case "insertLink":
|
|
55771
55778
|
insertLink();
|
|
55772
55779
|
break;
|
|
55773
|
-
case "
|
|
55780
|
+
case "image":
|
|
55774
55781
|
insertImage();
|
|
55775
55782
|
break;
|
|
55776
55783
|
case "createTable":
|
|
@@ -55838,17 +55845,11 @@ function insertLink() {
|
|
|
55838
55845
|
}
|
|
55839
55846
|
}
|
|
55840
55847
|
function insertImage() {
|
|
55841
|
-
|
|
55842
|
-
|
|
55843
|
-
|
|
55844
|
-
|
|
55845
|
-
|
|
55846
|
-
const img = document.createElement("img");
|
|
55847
|
-
img.src = url;
|
|
55848
|
-
range2.deleteContents();
|
|
55849
|
-
range2.insertNode(img);
|
|
55850
|
-
}
|
|
55851
|
-
}
|
|
55848
|
+
console.log("image");
|
|
55849
|
+
const { showModalForm } = useModal();
|
|
55850
|
+
console.log(showModalForm);
|
|
55851
|
+
showModalForm({ title: "Upload Image", schema: [{ id: "image", type: "file" }], onSubmit: (data2) => {
|
|
55852
|
+
} });
|
|
55852
55853
|
}
|
|
55853
55854
|
function createTable() {
|
|
55854
55855
|
const rows = prompt("Enter the number of rows:");
|
package/dist/index.mjs
CHANGED
|
@@ -5514,8 +5514,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5514
5514
|
},
|
|
5515
5515
|
setup(__props) {
|
|
5516
5516
|
useCssVars((_ctx) => ({
|
|
5517
|
-
"
|
|
5518
|
-
"
|
|
5517
|
+
"5113a6cf": computedBackgroundColor.value,
|
|
5518
|
+
"ae07d62c": cumputedTextColor.value
|
|
5519
5519
|
}));
|
|
5520
5520
|
const props2 = __props;
|
|
5521
5521
|
const isComponent = computed(() => {
|
|
@@ -5557,13 +5557,13 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5557
5557
|
const cumputedTextColor = computed(
|
|
5558
5558
|
() => {
|
|
5559
5559
|
var _a2;
|
|
5560
|
-
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.color)
|
|
5560
|
+
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.color) ?? computedDefaultColors.value.color;
|
|
5561
5561
|
}
|
|
5562
5562
|
);
|
|
5563
5563
|
const computedBackgroundColor = computed(
|
|
5564
5564
|
() => {
|
|
5565
5565
|
var _a2;
|
|
5566
|
-
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.backgroundColor)
|
|
5566
|
+
return ((_a2 = themes[computedTheme.value]) == null ? void 0 : _a2.backgroundColor) ?? computedDefaultColors.value.backgroundColor;
|
|
5567
5567
|
}
|
|
5568
5568
|
);
|
|
5569
5569
|
return (_ctx, _cache) => {
|
|
@@ -5604,7 +5604,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5604
5604
|
};
|
|
5605
5605
|
}
|
|
5606
5606
|
});
|
|
5607
|
-
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-
|
|
5607
|
+
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-65a6e961"]]);
|
|
5608
5608
|
const _hoisted_1$H = {
|
|
5609
5609
|
key: 0,
|
|
5610
5610
|
class: "tool-bar"
|
|
@@ -6021,6 +6021,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6021
6021
|
}
|
|
6022
6022
|
let sortDirection = ref("ASC");
|
|
6023
6023
|
let sortField = ref("");
|
|
6024
|
+
const computedSortField = computed(() => `_transformed_${sortField.value}`);
|
|
6024
6025
|
function getFallbackSchema() {
|
|
6025
6026
|
const keys4 = [
|
|
6026
6027
|
...new Set((props2.data || []).map(Object.keys).flat())
|
|
@@ -6031,7 +6032,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6031
6032
|
}));
|
|
6032
6033
|
return props2.showFields ? schema.filter((f2) => {
|
|
6033
6034
|
var _a2;
|
|
6034
|
-
return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id))
|
|
6035
|
+
return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id)) ?? !f2.id;
|
|
6035
6036
|
}) : schema;
|
|
6036
6037
|
}
|
|
6037
6038
|
const computedSchema = computed(() => {
|
|
@@ -6053,9 +6054,10 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6053
6054
|
const fields = computedSchema.value.filter((f2) => f2.id);
|
|
6054
6055
|
for (const field of fields) {
|
|
6055
6056
|
const fieldData = rowData[`${field.id}`];
|
|
6056
|
-
const newFieldVal = (
|
|
6057
|
+
const newFieldVal = (_a2 = field.transform) == null ? void 0 : _a2.call(field, fieldData, rowData);
|
|
6057
6058
|
Object.assign(obj, {
|
|
6058
|
-
[`${field.id}`]:
|
|
6059
|
+
[`${field.id}`]: fieldData,
|
|
6060
|
+
[`_transformed_${field.id}`]: newFieldVal
|
|
6059
6061
|
});
|
|
6060
6062
|
}
|
|
6061
6063
|
return obj;
|
|
@@ -6064,8 +6066,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6064
6066
|
const dta = [...props2.data].map(transform);
|
|
6065
6067
|
if (sortField.value) {
|
|
6066
6068
|
return dta.sort((a2, b2) => {
|
|
6067
|
-
const aValue = a2[
|
|
6068
|
-
const bValue = b2[
|
|
6069
|
+
const aValue = a2[computedSortField.value] ?? "";
|
|
6070
|
+
const bValue = b2[computedSortField.value] ?? "";
|
|
6069
6071
|
const numAValue = Number.parseInt(aValue, 10);
|
|
6070
6072
|
const numBValue = Number.parseInt(bValue, 10);
|
|
6071
6073
|
if (!Number.isNaN(numAValue) && !Number.isNaN(numBValue)) {
|
|
@@ -6126,10 +6128,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6126
6128
|
class: "row row-item position-relative",
|
|
6127
6129
|
onClick: ($event) => selectElement(row)
|
|
6128
6130
|
}, [
|
|
6129
|
-
(openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value
|
|
6130
|
-
...c2,
|
|
6131
|
-
transform: void 0
|
|
6132
|
-
})), (field) => {
|
|
6131
|
+
(openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (field) => {
|
|
6133
6132
|
return openBlock(), createElementBlock("td", {
|
|
6134
6133
|
key: `${field.id}-${row.id}`,
|
|
6135
6134
|
class: "col"
|
|
@@ -6156,7 +6155,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6156
6155
|
};
|
|
6157
6156
|
}
|
|
6158
6157
|
});
|
|
6159
|
-
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-
|
|
6158
|
+
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-9d32d080"]]);
|
|
6160
6159
|
const _sfc_main$E = {};
|
|
6161
6160
|
const _hoisted_1$B = { class: "flex space-between" };
|
|
6162
6161
|
function _sfc_render$1(_ctx, _cache) {
|
|
@@ -16522,7 +16521,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
16522
16521
|
if (props2.field.$el === "check") return CheckInput;
|
|
16523
16522
|
if (props2.field.$el === "richtext") return _sfc_main$c;
|
|
16524
16523
|
if (props2.field.$el === "date") return _sfc_main$n;
|
|
16525
|
-
return props2.field.$el
|
|
16524
|
+
return props2.field.$el ?? "div";
|
|
16526
16525
|
});
|
|
16527
16526
|
const formData = computed({
|
|
16528
16527
|
get: () => props2.modelValue,
|
|
@@ -16551,35 +16550,43 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
16551
16550
|
}
|
|
16552
16551
|
return true;
|
|
16553
16552
|
});
|
|
16554
|
-
const badTransform = /undefined|NaN|Invalid Date/;
|
|
16555
16553
|
const computedFieldData = computed(
|
|
16556
16554
|
() => {
|
|
16557
16555
|
var _a2, _b;
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16556
|
+
return ((_b = (_a2 = props2.field).transform) == null ? void 0 : _b.call(_a2, fieldData.value, props2.modelValue)) ?? fieldData.value;
|
|
16557
|
+
}
|
|
16558
|
+
);
|
|
16559
|
+
const computedOptions = computed(
|
|
16560
|
+
() => bindAttrs({ options: props2.field.options }, fieldData.value, props2.modelValue).options
|
|
16561
|
+
);
|
|
16562
|
+
const computedAttrs = computed(
|
|
16563
|
+
() => bindAttrs(props2.field.attrs || {}, fieldData.value, props2.modelValue)
|
|
16564
|
+
);
|
|
16565
|
+
const computedClass = computed(
|
|
16566
|
+
() => {
|
|
16567
|
+
var _a2;
|
|
16568
|
+
return classify(fieldData.value, props2.modelValue, props2.field.class, (_a2 = props2.field.attrs) == null ? void 0 : _a2.class);
|
|
16561
16569
|
}
|
|
16562
16570
|
);
|
|
16563
16571
|
return (_ctx, _cache) => {
|
|
16564
|
-
var _a2, _b;
|
|
16565
16572
|
const _component_BglField = resolveComponent("BglField", true);
|
|
16566
|
-
return vIf.value ? (openBlock(), createBlock(resolveDynamicComponent(is4.value), mergeProps({ key: 0 },
|
|
16573
|
+
return vIf.value ? (openBlock(), createBlock(resolveDynamicComponent(is4.value), mergeProps({ key: 0 }, computedAttrs.value, {
|
|
16567
16574
|
id: _ctx.field.id,
|
|
16568
16575
|
modelValue: fieldData.value,
|
|
16569
16576
|
"onUpdate:modelValue": [
|
|
16570
16577
|
_cache[1] || (_cache[1] = ($event) => fieldData.value = $event),
|
|
16571
16578
|
_cache[2] || (_cache[2] = ($event) => {
|
|
16572
|
-
var
|
|
16573
|
-
return (
|
|
16579
|
+
var _a2, _b;
|
|
16580
|
+
return (_b = (_a2 = _ctx.field) == null ? void 0 : _a2.onUpdate) == null ? void 0 : _b.call(_a2, $event, formData.value);
|
|
16574
16581
|
})
|
|
16575
16582
|
],
|
|
16576
16583
|
required: _ctx.field.required,
|
|
16577
|
-
class:
|
|
16584
|
+
class: computedClass.value,
|
|
16578
16585
|
label: _ctx.field.label,
|
|
16579
16586
|
placeholder: _ctx.field.placeholder || _ctx.field.label,
|
|
16580
16587
|
defaultValue: _ctx.field.defaultValue,
|
|
16581
16588
|
disabled: _ctx.field.disabled,
|
|
16582
|
-
options:
|
|
16589
|
+
options: computedOptions.value,
|
|
16583
16590
|
helptext: _ctx.field.helptext
|
|
16584
16591
|
}), {
|
|
16585
16592
|
default: withCtx(() => [
|
|
@@ -55693,7 +55700,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
55693
55700
|
};
|
|
55694
55701
|
}
|
|
55695
55702
|
});
|
|
55696
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-
|
|
55703
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-4c741194"]]);
|
|
55697
55704
|
function applyFormatting(command2, value = "") {
|
|
55698
55705
|
const selection = window.getSelection();
|
|
55699
55706
|
if (selection && selection.rangeCount > 0) {
|
|
@@ -55768,7 +55775,7 @@ function applyFormatting(command2, value = "") {
|
|
|
55768
55775
|
case "insertLink":
|
|
55769
55776
|
insertLink();
|
|
55770
55777
|
break;
|
|
55771
|
-
case "
|
|
55778
|
+
case "image":
|
|
55772
55779
|
insertImage();
|
|
55773
55780
|
break;
|
|
55774
55781
|
case "createTable":
|
|
@@ -55836,17 +55843,11 @@ function insertLink() {
|
|
|
55836
55843
|
}
|
|
55837
55844
|
}
|
|
55838
55845
|
function insertImage() {
|
|
55839
|
-
|
|
55840
|
-
|
|
55841
|
-
|
|
55842
|
-
|
|
55843
|
-
|
|
55844
|
-
const img = document.createElement("img");
|
|
55845
|
-
img.src = url;
|
|
55846
|
-
range2.deleteContents();
|
|
55847
|
-
range2.insertNode(img);
|
|
55848
|
-
}
|
|
55849
|
-
}
|
|
55846
|
+
console.log("image");
|
|
55847
|
+
const { showModalForm } = useModal();
|
|
55848
|
+
console.log(showModalForm);
|
|
55849
|
+
showModalForm({ title: "Upload Image", schema: [{ id: "image", type: "file" }], onSubmit: (data2) => {
|
|
55850
|
+
} });
|
|
55850
55851
|
}
|
|
55851
55852
|
function createTable() {
|
|
55852
55853
|
const rows = prompt("Enter the number of rows:");
|