@bagelink/vue 0.0.218 → 0.0.226-beta.0
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/AccordionItem.vue.d.ts +23 -0
- package/dist/components/AccordionItem.vue.d.ts.map +1 -0
- package/dist/components/Avatar.vue.d.ts +20 -0
- package/dist/components/Avatar.vue.d.ts.map +1 -0
- package/dist/components/Card.vue.d.ts +27 -0
- package/dist/components/Card.vue.d.ts.map +1 -0
- package/dist/components/DataPreview.vue.d.ts +18 -18
- package/dist/components/DataPreview.vue.d.ts.map +1 -1
- package/dist/components/Drop.vue.d.ts +34 -0
- package/dist/components/Drop.vue.d.ts.map +1 -0
- package/dist/components/FileUploader.vue.d.ts +60 -0
- package/dist/components/FileUploader.vue.d.ts.map +1 -0
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalBglForm.vue.d.ts +50 -31
- package/dist/components/ModalBglForm.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts +17 -12
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts +5 -4
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/Title.vue.d.ts +31 -0
- package/dist/components/Title.vue.d.ts.map +1 -0
- package/dist/components/form/BglField.vue.d.ts +19 -5
- package/dist/components/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/BglForm.vue.d.ts +38 -27
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/ItemRef.vue.d.ts +1 -0
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/index.d.ts +0 -3
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +36 -38
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts +25 -15
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts +1 -4
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts +37 -0
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/TableField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ToggleInput.vue.d.ts +46 -0
- package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/index.d.ts +2 -3
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/components/formkit/index.d.ts +1 -2
- package/dist/components/formkit/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +5 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +14523 -13691
- package/dist/index.mjs +14524 -13692
- package/dist/plugins/bagel.d.ts +1 -1
- package/dist/plugins/bagel.d.ts.map +1 -1
- package/dist/plugins/modal.d.ts +1 -3
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +744 -404
- package/dist/types/BagelForm.d.ts +8 -0
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/components/AccordionItem.vue +100 -0
- package/src/components/Avatar.vue +47 -0
- package/src/components/Card.vue +13 -0
- package/src/components/Comments.vue +75 -75
- package/src/components/ContactArray.vue +10 -39
- package/src/components/DataPreview.vue +22 -49
- package/src/components/{DropDown.vue → Drop.vue} +55 -29
- package/src/components/FormKitTable.vue +121 -125
- package/src/components/Modal.vue +6 -23
- package/src/components/ModalBglForm.vue +10 -24
- package/src/components/NavBar.vue +33 -17
- package/src/components/RTXEditor.vue +69 -69
- package/src/components/TableSchema.vue +26 -72
- package/src/components/Title.vue +19 -0
- package/src/components/form/BglField.vue +29 -26
- package/src/components/form/BglForm.vue +19 -14
- package/src/components/form/index.ts +0 -3
- package/src/components/form/inputs/CheckInput.vue +20 -18
- package/src/components/form/inputs/DateInput.vue +16 -34
- package/src/components/form/inputs/FileUpload.vue +139 -19
- package/src/components/form/inputs/SelectField.vue +80 -138
- package/src/components/form/inputs/SelectInput.vue +517 -0
- package/src/components/form/inputs/TableField.vue +1 -5
- package/src/components/form/inputs/index.ts +2 -3
- package/src/components/formkit/index.ts +0 -3
- package/src/components/index.ts +5 -4
- package/src/plugins/bagel.ts +2 -2
- package/src/plugins/modal.ts +7 -13
- package/src/styles/inputs.css +2 -2
- package/src/styles/layout.css +1 -1
- package/src/styles/modal.css +3 -2
- package/src/styles/theme.css +7 -6
- package/src/types/BagelForm.ts +5 -0
- package/src/types/index.ts +1 -1
- package/src/utils/index.ts +26 -6
- package/src/components/ContactSubmissions.vue +0 -45
- package/src/components/PersonPreview.vue +0 -199
- package/src/components/PersonPreviewFormkit.vue +0 -178
- package/src/components/form/ItemRef.vue +0 -44
- package/src/components/form/MaterialIcon.vue +0 -19
- package/src/components/form/PlainInputField.vue +0 -79
- package/src/components/form/inputs/DynamicLinkField.vue +0 -137
- package/src/components/form/inputs/EmailInput.vue +0 -58
- package/src/types/Person.ts +0 -51
|
@@ -9,9 +9,17 @@ export type Field<T = Record<string, any>> = {
|
|
|
9
9
|
label?: string;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
children?: Field<T>[];
|
|
12
|
+
class?: AttributeValue | AttributeFn<T>;
|
|
13
|
+
options?: string | ({
|
|
14
|
+
label: string;
|
|
15
|
+
value: string | number;
|
|
16
|
+
} | string | number)[];
|
|
12
17
|
attrs?: Attributes<T>;
|
|
13
18
|
required?: boolean;
|
|
14
19
|
hint?: string;
|
|
20
|
+
defaultValue?: any;
|
|
21
|
+
transform?: (val?: any, rowData?: Record<string, any>) => any;
|
|
22
|
+
onUpdate?: (val: any, fieldData?: any, rowData?: Record<string, any>) => void;
|
|
15
23
|
'v-if'?: string | boolean | ((val: any, row: T) => boolean);
|
|
16
24
|
};
|
|
17
25
|
export interface SelectBagelField {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BagelForm.d.ts","sourceRoot":"","sources":["../../src/types/BagelForm.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhG,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,cAAc,CAAC;AAE1F,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;CAC/C;AAED,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IAC3C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC;CAC7D,CAAA;AAED,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"BagelForm.d.ts","sourceRoot":"","sources":["../../src/types/BagelForm.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhG,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,cAAc,CAAC;AAE1F,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;CAC/C;AAED,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IAC3C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAC,MAAM,GAAC,MAAM,CAAC,EAAE,CAAC;IAC/E,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC;IAC7D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,EAAC,GAAG,EAAE,OAAO,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC5E,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC;CAC7D,CAAA;AAED,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { MaterialIcons } from './materialIcons';
|
|
2
|
-
export type { BankDetailsInterface, NewPerson, Person } from './Person';
|
|
3
2
|
export type { Tables, TableToTypeMapping } from '@bagelink/sdk';
|
|
4
3
|
export type { StorageFile } from './file';
|
|
4
|
+
export type { NavLink } from '../components/NavBar.vue';
|
|
5
5
|
export * from './BtnOptions';
|
|
6
6
|
export * from './BagelForm';
|
|
7
7
|
export type ThemeType = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green' | 'primary' | 'blue';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,YAAY,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,MAAM,MAAM,SAAS,GACpB,OAAO,GACL,KAAK,GACL,MAAM,GACN,YAAY,GACZ,OAAO,GACP,OAAO,GACP,SAAS,GACT,MAAM,CAAA"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Attributes } from '../types';
|
|
2
2
|
export declare const debounce: (fn: () => void, delay?: number) => void;
|
|
3
|
-
export declare const keyToLabel: (key
|
|
3
|
+
export declare const keyToLabel: (key?: string) => string | undefined;
|
|
4
4
|
export declare const copyText: (text: string, cb?: ((msg: string) => void) | undefined) => Promise<void>;
|
|
5
5
|
export declare const useFormkit: () => unknown;
|
|
6
6
|
export declare const initials: (...strArr: string[]) => string;
|
|
7
7
|
export declare function useEscape(event: KeyboardEvent, closeModel: () => void): void;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function classify(fieldVal?: any, row?: any, ...classes: any[]): string;
|
|
9
|
+
export declare function bindAttrs<T = Record<string, any>>(attrs?: Attributes, fieldVal?: any, row?: T): any;
|
|
10
|
+
export declare const iffer: (field: any, itemData: any) => any;
|
|
11
|
+
export declare const denullify: (itemData?: Record<string, any>, fieldID?: string) => any;
|
|
9
12
|
export { formatString } from './strings';
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,QAAQ,OAAQ,MAAM,IAAI,yBAGtC,CAAC;AAEF,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,QAAQ,OAAQ,MAAM,IAAI,yBAGtC,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,MAAM,GAAG,SAEjC,CAAC;AAEnB,eAAO,MAAM,QAAQ,SACd,MAAM,cAED,MAAM,KAAK,IAAI,+BAI1B,CAAC;AAEF,eAAO,MAAM,UAAU,eAGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,cAAe,MAAM,EAAE,WAG3C,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAKpE;AAED,wBAAgB,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,OAS7F;AAED,eAAO,MAAM,KAAK,UAAW,GAAG,YAAY,GAAG,QAK9C,CAAC;AAEF,eAAO,MAAM,SAAS,cAAe,OAAO,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,QAAqD,CAAC;AAEhI,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.226-beta.0",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Neveh Allon",
|
|
@@ -50,19 +50,15 @@
|
|
|
50
50
|
"./tsconfig.json",
|
|
51
51
|
"./vite.config.ts"
|
|
52
52
|
],
|
|
53
|
-
"dependencies": {},
|
|
54
53
|
"devDependencies": {
|
|
55
|
-
"vue": "^
|
|
56
|
-
"
|
|
54
|
+
"@vue-macros/reactivity-transform": "^0.4.1",
|
|
55
|
+
"vue": "^3.4.3"
|
|
57
56
|
},
|
|
58
57
|
"peerDependencies": {
|
|
59
58
|
"@bagelink/sdk": "*",
|
|
60
|
-
"vue-router": "*",
|
|
61
|
-
"vue": "*",
|
|
62
|
-
"vue3-charts": "^1.1.33",
|
|
63
|
-
"@formkit/vue": "^1.3.0",
|
|
64
59
|
"@formkit/core": "1.3.0",
|
|
65
|
-
"vue
|
|
60
|
+
"@formkit/vue": "^1.3.0",
|
|
61
|
+
"@vuepic/vue-datepicker": "^7.4.0",
|
|
66
62
|
"prosemirror-commands": "^1.5.2",
|
|
67
63
|
"prosemirror-history": "^1.3.2",
|
|
68
64
|
"prosemirror-keymap": "^1.2.2",
|
|
@@ -70,7 +66,10 @@
|
|
|
70
66
|
"prosemirror-schema-basic": "^1.2.2",
|
|
71
67
|
"prosemirror-state": "^1.4.3",
|
|
72
68
|
"prosemirror-view": "^1.32.4",
|
|
73
|
-
"
|
|
69
|
+
"vue": "*",
|
|
70
|
+
"vue-draggable-next": "^2.2.1",
|
|
71
|
+
"vue-router": "*",
|
|
72
|
+
"vue3-charts": "^1.1.33"
|
|
74
73
|
},
|
|
75
74
|
"peerDependenciesMeta": {
|
|
76
75
|
"@vuepic/vue-datepicker": {
|
|
@@ -113,6 +112,9 @@
|
|
|
113
112
|
"publishConfig": {
|
|
114
113
|
"access": "public"
|
|
115
114
|
},
|
|
115
|
+
"dependencies": {
|
|
116
|
+
"vue-multiselect": "3.0.0-beta.3"
|
|
117
|
+
},
|
|
116
118
|
"scripts": {
|
|
117
119
|
"dev": "tsx watch src/index.ts",
|
|
118
120
|
"build": "vite build",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="accordion-item">
|
|
3
|
+
<div class="accordion-title" @click="toggle()">
|
|
4
|
+
{{ label }}
|
|
5
|
+
<div class="accordion-icon" :class="{open}" >
|
|
6
|
+
<MaterialIcon icon="keyboard_arrow_down" />
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-if="open" class="accordion-content" >
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { MaterialIcon } from '@bagelink/vue';
|
|
17
|
+
|
|
18
|
+
defineProps<{
|
|
19
|
+
label: string,
|
|
20
|
+
}>();
|
|
21
|
+
|
|
22
|
+
let open = $ref(false);
|
|
23
|
+
|
|
24
|
+
function toggle() {
|
|
25
|
+
open = !open;
|
|
26
|
+
console.log('toggle', open);
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
.accordion-item {
|
|
32
|
+
border-top: 1px solid var(--bgl-gray);
|
|
33
|
+
border-bottom: 1px solid var(--bgl-gray);
|
|
34
|
+
width: 100%;
|
|
35
|
+
max-width: 100%;
|
|
36
|
+
margin: -1 auto 0;
|
|
37
|
+
border-radius: 0;
|
|
38
|
+
background: transparent;
|
|
39
|
+
color: #000;
|
|
40
|
+
font-size: 1rem;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
text-align: left;
|
|
43
|
+
transition: all 0.2s ease;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.accordion-title {
|
|
48
|
+
width: 100%;
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
margin: 0 auto;
|
|
51
|
+
padding: 0;
|
|
52
|
+
border: 0;
|
|
53
|
+
border-radius: 0;
|
|
54
|
+
background: transparent;
|
|
55
|
+
color: #000;
|
|
56
|
+
font-size: 1rem;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
line-height: 1.5;
|
|
59
|
+
text-align: left;
|
|
60
|
+
transition: all 0.2s ease;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
height: var( --input-height);
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.accordion-icon {
|
|
69
|
+
transition: all 0.2s ease;
|
|
70
|
+
}
|
|
71
|
+
.accordion-icon.open {
|
|
72
|
+
transform: rotate(180deg);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.accordion-content {
|
|
76
|
+
width: 100%;
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
margin: 0 auto;
|
|
79
|
+
padding: 0;
|
|
80
|
+
border: 0;
|
|
81
|
+
border-radius: 0;
|
|
82
|
+
background: transparent;
|
|
83
|
+
color: #000;
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
line-height: 1.5;
|
|
87
|
+
text-align: left;
|
|
88
|
+
transition: all 0.2s ease;
|
|
89
|
+
max-height: 0;
|
|
90
|
+
animation: expand 1s ease forwards;
|
|
91
|
+
}
|
|
92
|
+
@keyframes expand {
|
|
93
|
+
0% {
|
|
94
|
+
max-height: 0;
|
|
95
|
+
}
|
|
96
|
+
100% {
|
|
97
|
+
max-height: 100vh;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="avatar">
|
|
3
|
+
<img
|
|
4
|
+
v-if="src"
|
|
5
|
+
:src="src"
|
|
6
|
+
:alt="name"
|
|
7
|
+
>
|
|
8
|
+
<p v-else>
|
|
9
|
+
{{ fallback || initials(name || '') }}
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { initials } from '@bagelink/vue';
|
|
16
|
+
|
|
17
|
+
defineProps<{
|
|
18
|
+
fallback?: string;
|
|
19
|
+
src?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
}>();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
.avatar{
|
|
26
|
+
border-radius: 100%;
|
|
27
|
+
width: 50px;
|
|
28
|
+
height: 50px;
|
|
29
|
+
background-color: var(--bgl-primary-tint);
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
text-align: center;
|
|
32
|
+
padding: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.avatar p {
|
|
36
|
+
font-size: 1.5rem;
|
|
37
|
+
line-height: 50px;
|
|
38
|
+
margin: 0;
|
|
39
|
+
font-weight: 200;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.avatar img{
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
object-fit: cover;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
2
|
+
<div class="comments-wrap">
|
|
3
|
+
<div class="comment-list">
|
|
4
|
+
<div
|
|
5
|
+
:class="{
|
|
6
|
+
editable: editComment?.id === comment.id,
|
|
7
|
+
me: comment.sender.id === bagel.auth.user?.id,
|
|
8
|
+
}"
|
|
9
|
+
class="comment"
|
|
10
|
+
v-for="comment in comments"
|
|
11
|
+
:key="comment.id"
|
|
12
|
+
>
|
|
13
|
+
<div class="comment-top">
|
|
14
|
+
<div class="comment-owner">
|
|
15
|
+
{{ comment.sender.first_name }} {{ comment.sender.last_name }}
|
|
16
|
+
</div>
|
|
17
|
+
<div class="comment-time">
|
|
18
|
+
{{ comment.updated_at.split("T")[0] }}
|
|
19
|
+
</div>
|
|
20
|
+
<div class="comment-actions">
|
|
21
|
+
<MaterialIcon
|
|
22
|
+
:size="1"
|
|
23
|
+
class="edit"
|
|
24
|
+
icon="edit"
|
|
25
|
+
@click="editComment = comment"
|
|
26
|
+
/>
|
|
27
|
+
<MaterialIcon
|
|
28
|
+
:size="1.2"
|
|
29
|
+
class="delete"
|
|
30
|
+
icon="delete"
|
|
31
|
+
@click="deleteComment(comment.id)"
|
|
32
|
+
/>
|
|
33
|
+
<MaterialIcon :size="1.2" class="save" icon="save" @click="save" />
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<RTXEditor
|
|
37
|
+
v-model="editComment.body_html"
|
|
38
|
+
@keydown.meta.enter="save"
|
|
39
|
+
v-if="editComment !== null && editComment?.id === comment.id"
|
|
40
|
+
/>
|
|
41
|
+
<div class="editor-wrapper" v-html="comment.body_html" v-else />
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="new-comment">
|
|
45
|
+
<RTXEditor
|
|
46
|
+
class="comment-input"
|
|
47
|
+
v-model="bodyHtml"
|
|
48
|
+
@keydown.meta.enter="newComment"
|
|
49
|
+
/>
|
|
50
|
+
<Btn icon="send" @click="newComment">
|
|
51
|
+
{{ sendBtnLabel }}
|
|
52
|
+
</Btn>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
57
|
<script lang="ts" setup>
|
|
58
|
-
import { onMounted, watch } from
|
|
59
|
-
import { Btn, MaterialIcon, RTXEditor } from
|
|
60
|
-
import { useBagel } from
|
|
58
|
+
import { onMounted, watch } from 'vue';
|
|
59
|
+
import { Btn, MaterialIcon, RTXEditor } from '@bagelink/vue';
|
|
60
|
+
import { useBagel } from '..';
|
|
61
61
|
|
|
62
62
|
const bagel = useBagel();
|
|
63
63
|
let comments = $ref<Record<string, any>>([]);
|
|
@@ -67,7 +67,7 @@ interface Comment {
|
|
|
67
67
|
ref_table: string;
|
|
68
68
|
ref_id: string;
|
|
69
69
|
body_html: string;
|
|
70
|
-
type:
|
|
70
|
+
type: 'Comment';
|
|
71
71
|
created_at: string;
|
|
72
72
|
updated_at: string;
|
|
73
73
|
}
|
|
@@ -80,37 +80,37 @@ const props = defineProps<{
|
|
|
80
80
|
}>();
|
|
81
81
|
|
|
82
82
|
const fetchData = async () => {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
comments = [];
|
|
84
|
+
comments = await bagel.get(`comments/${props.ref_table}/${props.ref_id}`);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
onMounted(fetchData);
|
|
88
88
|
watch(() => props.ref_id, fetchData);
|
|
89
89
|
|
|
90
90
|
const save = async () => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
if (!editComment) return;
|
|
92
|
+
await bagel.put(`comments/${editComment.id}`, editComment);
|
|
93
|
+
void fetchData(); // TODO: Nati: should be awaited?
|
|
94
|
+
editComment = null;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
let bodyHtml = $ref(
|
|
97
|
+
let bodyHtml = $ref('');
|
|
98
98
|
|
|
99
99
|
const deleteComment = async (id: string) => {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
await bagel.delete(`comments/${id}`);
|
|
101
|
+
void fetchData(); // TODO: Nati: should be awaited?
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
const newComment = async () => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
if (!bodyHtml) return;
|
|
106
|
+
await bagel.post('comments', {
|
|
107
|
+
ref_table: props.ref_table,
|
|
108
|
+
ref_id: props.ref_id,
|
|
109
|
+
body_html: bodyHtml,
|
|
110
|
+
type: 'Comment',
|
|
111
|
+
});
|
|
112
|
+
bodyHtml = '';
|
|
113
|
+
void fetchData(); // TODO: Nati: should be awaited?
|
|
114
114
|
};
|
|
115
115
|
</script>
|
|
116
116
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="bagel-input mt-2">
|
|
3
|
-
{{
|
|
3
|
+
{{ label }}
|
|
4
4
|
<div class="mb-2 mt-1">
|
|
5
5
|
<div
|
|
6
6
|
class="bglform-contact"
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
v-model="contact.email"
|
|
12
12
|
:placeholder="placeholders.email"
|
|
13
13
|
type="email"
|
|
14
|
-
v-if="
|
|
14
|
+
v-if="id === 'email'"
|
|
15
15
|
>
|
|
16
16
|
<input
|
|
17
17
|
v-model="contact.phone"
|
|
18
18
|
:placeholder="placeholders.phone"
|
|
19
19
|
type="tel"
|
|
20
|
-
v-if="
|
|
20
|
+
v-if="id === 'phone'"
|
|
21
21
|
>
|
|
22
22
|
<input
|
|
23
23
|
v-if="contact.email || contact.phone"
|
|
@@ -28,15 +28,11 @@
|
|
|
28
28
|
<div class="bglform-contact-opt">
|
|
29
29
|
<!-- <input v-model="contact.primary" id="primary" type="checkbox" > -->
|
|
30
30
|
<CheckInput
|
|
31
|
-
|
|
32
|
-
id: 'primary',
|
|
33
|
-
inputType: 'CheckInput',
|
|
34
|
-
label: 'primary',
|
|
35
|
-
}"
|
|
31
|
+
label = "Primary"
|
|
36
32
|
v-model="contact.primary"
|
|
37
33
|
/>
|
|
38
34
|
<MaterialIcon
|
|
39
|
-
@click="
|
|
35
|
+
@click="val.splice(i, 1)"
|
|
40
36
|
icon="delete"
|
|
41
37
|
class="btn-float"
|
|
42
38
|
/>
|
|
@@ -55,20 +51,16 @@
|
|
|
55
51
|
</template>
|
|
56
52
|
|
|
57
53
|
<script setup lang="ts">
|
|
58
|
-
import {
|
|
59
|
-
import type { BagelField } from '@bagelink/vue';
|
|
60
|
-
import MaterialIcon from './MaterialIcon.vue';
|
|
61
|
-
import Btn from './Btn.vue';
|
|
62
|
-
import CheckInput from './form/inputs/CheckInput.vue';
|
|
54
|
+
import { MaterialIcon, Btn, CheckInput } from '.';
|
|
63
55
|
|
|
64
|
-
|
|
56
|
+
withDefaults(
|
|
65
57
|
defineProps<{
|
|
66
|
-
|
|
58
|
+
label?: string;
|
|
67
59
|
modelValue: any;
|
|
68
60
|
editMode?: boolean;
|
|
69
61
|
small?: boolean;
|
|
62
|
+
id: string;
|
|
70
63
|
placeholders: {
|
|
71
|
-
|
|
72
64
|
email: string
|
|
73
65
|
phone: string
|
|
74
66
|
label: string
|
|
@@ -80,28 +72,7 @@ const props = withDefaults(
|
|
|
80
72
|
},
|
|
81
73
|
);
|
|
82
74
|
|
|
83
|
-
const val =
|
|
84
|
-
|
|
85
|
-
const del = (i: number) => {
|
|
86
|
-
val.value.splice(i, 1);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const emit = defineEmits(['update:modelValue']);
|
|
90
|
-
|
|
91
|
-
watch(
|
|
92
|
-
() => props.modelValue,
|
|
93
|
-
() => {
|
|
94
|
-
val.value = [...props.modelValue];
|
|
95
|
-
},
|
|
96
|
-
{ immediate: true },
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
watch(
|
|
100
|
-
() => val,
|
|
101
|
-
() => {
|
|
102
|
-
emit('update:modelValue', val.value);
|
|
103
|
-
},
|
|
104
|
-
);
|
|
75
|
+
const val = defineModel<any[]>('modelValue', { default: [] });
|
|
105
76
|
</script>
|
|
106
77
|
<!--
|
|
107
78
|
<style>
|
|
@@ -1,48 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="
|
|
4
|
-
class="data"
|
|
5
|
-
>
|
|
6
|
-
<h3
|
|
7
|
-
class="mb-3 mt-0"
|
|
8
|
-
v-if="title"
|
|
9
|
-
>
|
|
2
|
+
<div v-if="data" class="data">
|
|
3
|
+
<h3 class="mb-3 mt-0" v-if="title">
|
|
10
4
|
{{ title }}
|
|
11
5
|
</h3>
|
|
12
|
-
<template
|
|
13
|
-
v-
|
|
14
|
-
:key="field.id"
|
|
15
|
-
>
|
|
16
|
-
<div class="data-row" v-if="field['v-if'] ? field['v-if'](itemData[field.id], itemData) : true">
|
|
6
|
+
<template v-for="field in schema" :key="field.id">
|
|
7
|
+
<div class="data-row" v-if="iffer(field, itemData)">
|
|
17
8
|
<div class="key">
|
|
18
9
|
{{ field?.label || keyToLabel(field.id) }}
|
|
19
10
|
</div>
|
|
20
|
-
<component
|
|
21
|
-
:
|
|
22
|
-
|
|
23
|
-
v-model="itemData[field.id]"
|
|
24
|
-
@update:modelValue="($event:any)=>field?.onUpdate?.($event, data[field.id], itemData)"
|
|
25
|
-
v-bind="bindAttrs(field.attrs, itemData[field.id], itemData)"
|
|
26
|
-
>
|
|
11
|
+
<component :is="field.$el || 'div'" class="value" :modelValue="denullify(itemData, field.id)"
|
|
12
|
+
@update:modelValue="($event: any) => field?.onUpdate?.($event, denullify(data, field.id), itemData)"
|
|
13
|
+
v-bind="bindAttrs(field.attrs, field.id ? itemData[field.id] : null, itemData)">
|
|
27
14
|
{{
|
|
28
|
-
field?.transform?.(itemData
|
|
15
|
+
field?.transform?.(denullify(itemData, field.id)
|
|
29
16
|
|| field.defaultValue, itemData)
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
|| denullify(itemData, field.id)
|
|
18
|
+
|| ''
|
|
32
19
|
}}
|
|
33
20
|
</component>
|
|
34
21
|
</div>
|
|
35
22
|
</template>
|
|
36
23
|
<div v-if="!schema?.length">
|
|
37
|
-
<div
|
|
38
|
-
class="data-row"
|
|
39
|
-
v-for="[key, value] in Object.entries(itemData).filter(
|
|
40
|
-
([key]) => !keysToIgnore.includes(key),
|
|
41
|
-
)"
|
|
42
|
-
:key="key"
|
|
43
|
-
>
|
|
24
|
+
<div class="data-row" v-for="[key, value] in Object.entries(itemData)" :key="key">
|
|
44
25
|
<div class="key">
|
|
45
|
-
{{
|
|
26
|
+
{{ keyToLabel(key) }}
|
|
46
27
|
</div>
|
|
47
28
|
<div class="vlue">
|
|
48
29
|
{{ value }}
|
|
@@ -54,28 +35,20 @@
|
|
|
54
35
|
</template>
|
|
55
36
|
|
|
56
37
|
<script lang="ts" setup>
|
|
57
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
type BglFormSchemaT,
|
|
40
|
+
keyToLabel,
|
|
41
|
+
bindAttrs,
|
|
42
|
+
iffer,
|
|
43
|
+
denullify,
|
|
44
|
+
} from '@bagelink/vue';
|
|
58
45
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const keysToIgnore = ['id', 'person_id', 'person', 'created_at', 'updated_at'];
|
|
62
|
-
|
|
63
|
-
const props = defineProps<{
|
|
64
|
-
data: Record<string, any>,
|
|
65
|
-
schema?: Record<string, any>[],
|
|
46
|
+
defineProps<{
|
|
47
|
+
schema?: BglFormSchemaT,
|
|
66
48
|
title?: string,
|
|
67
49
|
}>();
|
|
68
50
|
|
|
69
|
-
const itemData =
|
|
70
|
-
|
|
71
|
-
const bindAttrs = (attrs: Record<string, any>, field: any, row: any) => {
|
|
72
|
-
const arr = Object.entries(attrs || {}).map(([key, value]) => [
|
|
73
|
-
key,
|
|
74
|
-
typeof value === 'function' ? value(field, row) : value,
|
|
75
|
-
]);
|
|
76
|
-
const resolvedAttrs = Object.fromEntries(arr);
|
|
77
|
-
return resolvedAttrs;
|
|
78
|
-
};
|
|
51
|
+
const itemData = defineModel<Record<string, any>>('data', { default: {} });
|
|
79
52
|
</script>
|
|
80
53
|
|
|
81
54
|
<style scoped>
|