@zeedhi/zd-user-info-vue 1.0.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.
@@ -0,0 +1,336 @@
1
+ import { Prop, Component } from 'vue-property-decorator';
2
+ import { PropWatch, ZdComponentRender } from '@zeedhi/vuetify';
3
+ import { UserInfo } from '@zeedhi/zd-user-info-common';
4
+
5
+ /*! *****************************************************************************
6
+ Copyright (c) Microsoft Corporation.
7
+
8
+ Permission to use, copy, modify, and/or distribute this software for any
9
+ purpose with or without fee is hereby granted.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ PERFORMANCE OF THIS SOFTWARE.
18
+ ***************************************************************************** */
19
+
20
+ function __decorate(decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ }
26
+
27
+ function __metadata(metadataKey, metadataValue) {
28
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
29
+ }
30
+
31
+ let ZdUserInfo = class ZdUserInfo extends ZdComponentRender {
32
+ constructor() {
33
+ super(...arguments);
34
+ this.instanceType = UserInfo;
35
+ }
36
+ };
37
+ __decorate([
38
+ Prop({ type: [Object] }),
39
+ __metadata("design:type", Object)
40
+ ], ZdUserInfo.prototype, "activator", void 0);
41
+ __decorate([
42
+ Prop({ type: [Object], default: () => ({}) }),
43
+ __metadata("design:type", Object)
44
+ ], ZdUserInfo.prototype, "avatarProps", void 0);
45
+ __decorate([
46
+ Prop({ type: [Array], default: () => ([]) }),
47
+ __metadata("design:type", Array)
48
+ ], ZdUserInfo.prototype, "bottomSlot", void 0);
49
+ __decorate([
50
+ Prop({ type: [Array] }),
51
+ __metadata("design:type", Array)
52
+ ], ZdUserInfo.prototype, "centerSlot", void 0);
53
+ __decorate([
54
+ Prop({ type: [Array], default: () => ([]) }),
55
+ __metadata("design:type", Array)
56
+ ], ZdUserInfo.prototype, "topSlot", void 0);
57
+ __decorate([
58
+ Prop({ type: [Array], default: () => ([]) }),
59
+ __metadata("design:type", Array)
60
+ ], ZdUserInfo.prototype, "headerSlot", void 0);
61
+ __decorate([
62
+ PropWatch({ type: [String, Boolean], default: true }),
63
+ __metadata("design:type", Boolean)
64
+ ], ZdUserInfo.prototype, "showProfileChange", void 0);
65
+ __decorate([
66
+ PropWatch({ type: [String], default: '' }),
67
+ __metadata("design:type", String)
68
+ ], ZdUserInfo.prototype, "user", void 0);
69
+ __decorate([
70
+ PropWatch({ type: [String], default: '' }),
71
+ __metadata("design:type", String)
72
+ ], ZdUserInfo.prototype, "userImage", void 0);
73
+ __decorate([
74
+ PropWatch({ type: [Boolean, String], default: true }),
75
+ __metadata("design:type", Boolean)
76
+ ], ZdUserInfo.prototype, "closeOnClick", void 0);
77
+ __decorate([
78
+ PropWatch({ type: [Boolean, String], default: true }),
79
+ __metadata("design:type", Boolean)
80
+ ], ZdUserInfo.prototype, "closeOnContentClick", void 0);
81
+ __decorate([
82
+ PropWatch({ type: [Boolean, String], default: false }),
83
+ __metadata("design:type", Boolean)
84
+ ], ZdUserInfo.prototype, "fixed", void 0);
85
+ __decorate([
86
+ PropWatch({ type: [Object], default: () => ({}) }),
87
+ __metadata("design:type", Object)
88
+ ], ZdUserInfo.prototype, "imageProps", void 0);
89
+ __decorate([
90
+ PropWatch({ type: [Boolean, String], default: false }),
91
+ __metadata("design:type", Boolean)
92
+ ], ZdUserInfo.prototype, "offsetX", void 0);
93
+ __decorate([
94
+ PropWatch({ type: [Boolean, String], default: true }),
95
+ __metadata("design:type", Boolean)
96
+ ], ZdUserInfo.prototype, "offsetY", void 0);
97
+ __decorate([
98
+ PropWatch({ type: [Boolean, String], default: true }),
99
+ __metadata("design:type", Boolean)
100
+ ], ZdUserInfo.prototype, "openOnClick", void 0);
101
+ __decorate([
102
+ PropWatch({ type: [Boolean, String], default: false }),
103
+ __metadata("design:type", Boolean)
104
+ ], ZdUserInfo.prototype, "openOnHover", void 0);
105
+ __decorate([
106
+ PropWatch({ type: [Number, String], default: 'auto' }),
107
+ __metadata("design:type", Object)
108
+ ], ZdUserInfo.prototype, "height", void 0);
109
+ __decorate([
110
+ PropWatch({ type: [Number, String] }),
111
+ __metadata("design:type", Object)
112
+ ], ZdUserInfo.prototype, "maxHeight", void 0);
113
+ __decorate([
114
+ PropWatch({ type: [Number, String] }),
115
+ __metadata("design:type", Object)
116
+ ], ZdUserInfo.prototype, "maxWidth", void 0);
117
+ __decorate([
118
+ PropWatch({ type: [Number, String] }),
119
+ __metadata("design:type", Object)
120
+ ], ZdUserInfo.prototype, "minHeight", void 0);
121
+ __decorate([
122
+ PropWatch({ type: [Number, String] }),
123
+ __metadata("design:type", Object)
124
+ ], ZdUserInfo.prototype, "minWidth", void 0);
125
+ __decorate([
126
+ PropWatch({ default: undefined }),
127
+ __metadata("design:type", Object)
128
+ ], ZdUserInfo.prototype, "value", void 0);
129
+ ZdUserInfo = __decorate([
130
+ Component
131
+ ], ZdUserInfo);
132
+ var script = ZdUserInfo;
133
+
134
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
135
+ if (typeof shadowMode !== 'boolean') {
136
+ createInjectorSSR = createInjector;
137
+ createInjector = shadowMode;
138
+ shadowMode = false;
139
+ }
140
+ // Vue.extend constructor export interop.
141
+ const options = typeof script === 'function' ? script.options : script;
142
+ // render functions
143
+ if (template && template.render) {
144
+ options.render = template.render;
145
+ options.staticRenderFns = template.staticRenderFns;
146
+ options._compiled = true;
147
+ // functional template
148
+ if (isFunctionalTemplate) {
149
+ options.functional = true;
150
+ }
151
+ }
152
+ // scopedId
153
+ if (scopeId) {
154
+ options._scopeId = scopeId;
155
+ }
156
+ let hook;
157
+ if (moduleIdentifier) {
158
+ // server build
159
+ hook = function (context) {
160
+ // 2.3 injection
161
+ context =
162
+ context || // cached call
163
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
164
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
165
+ // 2.2 with runInNewContext: true
166
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
167
+ context = __VUE_SSR_CONTEXT__;
168
+ }
169
+ // inject component styles
170
+ if (style) {
171
+ style.call(this, createInjectorSSR(context));
172
+ }
173
+ // register component module identifier for async chunk inference
174
+ if (context && context._registeredComponents) {
175
+ context._registeredComponents.add(moduleIdentifier);
176
+ }
177
+ };
178
+ // used by ssr in case component is cached and beforeCreate
179
+ // never gets called
180
+ options._ssrRegister = hook;
181
+ }
182
+ else if (style) {
183
+ hook = shadowMode
184
+ ? function (context) {
185
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
186
+ }
187
+ : function (context) {
188
+ style.call(this, createInjector(context));
189
+ };
190
+ }
191
+ if (hook) {
192
+ if (options.functional) {
193
+ // register for functional component in vue file
194
+ const originalRender = options.render;
195
+ options.render = function renderWithStyleInjection(h, context) {
196
+ hook.call(context);
197
+ return originalRender(h, context);
198
+ };
199
+ }
200
+ else {
201
+ // inject component registration as beforeCreate hook
202
+ const existing = options.beforeCreate;
203
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
204
+ }
205
+ }
206
+ return script;
207
+ }
208
+
209
+ /* script */
210
+ const __vue_script__ = script;
211
+
212
+ /* template */
213
+ var __vue_render__ = function () {
214
+ var _vm = this;
215
+ var _h = _vm.$createElement;
216
+ var _c = _vm._self._c || _h;
217
+ return _c(
218
+ "zd-dropdown",
219
+ { attrs: { "instance-object": _vm.instance, name: "dropdown" } },
220
+ [
221
+ _vm.instance.headerSlot.length > 0 || _vm.$slots.headerSlot
222
+ ? [
223
+ _vm._l(_vm.instance.headerSlot, function (child, index) {
224
+ return _c(
225
+ child.component,
226
+ _vm._b(
227
+ { key: "top_" + index, tag: "component" },
228
+ "component",
229
+ child,
230
+ false
231
+ )
232
+ )
233
+ }),
234
+ _vm._v(" "),
235
+ _vm._t("headerSlot"),
236
+ ]
237
+ : _c("div", { staticClass: "zd-text-center text-h5 zd-pa-2" }, [
238
+ _vm._v(_vm._s(_vm.instance.user)),
239
+ ]),
240
+ _vm._v(" "),
241
+ _vm.instance.topSlot.length > 0 || _vm.$slots.topSlot
242
+ ? [
243
+ _c("v-divider"),
244
+ _vm._v(" "),
245
+ _vm._l(_vm.instance.topSlot, function (child, index) {
246
+ return _c(
247
+ child.component,
248
+ _vm._b(
249
+ { key: "top_" + index, tag: "component" },
250
+ "component",
251
+ child,
252
+ false
253
+ )
254
+ )
255
+ }),
256
+ _vm._v(" "),
257
+ _vm._t("topSlot"),
258
+ ]
259
+ : _vm._e(),
260
+ _vm._v(" "),
261
+ _vm.instance.centerSlot.length > 0 || _vm.$slots.centerSlot
262
+ ? [
263
+ _c("v-divider"),
264
+ _vm._v(" "),
265
+ _vm._l(_vm.instance.centerSlot, function (child, index) {
266
+ return _c(
267
+ child.component,
268
+ _vm._b(
269
+ { key: "center_" + index, tag: "component" },
270
+ "component",
271
+ child,
272
+ false
273
+ )
274
+ )
275
+ }),
276
+ _vm._v(" "),
277
+ _vm._t("centerSlot"),
278
+ ]
279
+ : _vm._e(),
280
+ _vm._v(" "),
281
+ _vm.instance.bottomSlot.length > 0 || _vm.$slots.bottomSlot
282
+ ? [
283
+ _c("v-divider"),
284
+ _vm._v(" "),
285
+ _vm._l(_vm.instance.bottomSlot, function (child, index) {
286
+ return _c(
287
+ child.component,
288
+ _vm._b(
289
+ { key: "bottom_" + index, tag: "component" },
290
+ "component",
291
+ child,
292
+ false
293
+ )
294
+ )
295
+ }),
296
+ _vm._v(" "),
297
+ _vm._t("bottomSlot"),
298
+ ]
299
+ : _vm._e(),
300
+ ],
301
+ 2
302
+ )
303
+ };
304
+ var __vue_staticRenderFns__ = [];
305
+ __vue_render__._withStripped = true;
306
+
307
+ /* style */
308
+ const __vue_inject_styles__ = undefined;
309
+ /* scoped */
310
+ const __vue_scope_id__ = undefined;
311
+ /* module identifier */
312
+ const __vue_module_identifier__ = undefined;
313
+ /* functional template */
314
+ const __vue_is_functional_template__ = false;
315
+ /* style inject */
316
+
317
+ /* style inject SSR */
318
+
319
+ /* style inject shadow dom */
320
+
321
+
322
+
323
+ const __vue_component__ = /*#__PURE__*/normalizeComponent(
324
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
325
+ __vue_inject_styles__,
326
+ __vue_script__,
327
+ __vue_scope_id__,
328
+ __vue_is_functional_template__,
329
+ __vue_module_identifier__,
330
+ false,
331
+ undefined,
332
+ undefined,
333
+ undefined
334
+ );
335
+
336
+ export { __vue_component__ as ZdUserInfo, script as ZdUserInfoClass };
@@ -0,0 +1,343 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue-property-decorator'), require('@zeedhi/vuetify'), require('@zeedhi/zd-user-info-common')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'vue-property-decorator', '@zeedhi/vuetify', '@zeedhi/zd-user-info-common'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/zd-user-info-vue"] = {}, global["vue-property-decorator"], global["@zeedhi/vuetify"], global["@zeedhi/zd-user-info-common"]));
5
+ })(this, (function (exports, vuePropertyDecorator, vuetify, zdUserInfoCommon) { 'use strict';
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+
22
+ function __decorate(decorators, target, key, desc) {
23
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
25
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
26
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
27
+ }
28
+
29
+ function __metadata(metadataKey, metadataValue) {
30
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
31
+ }
32
+
33
+ let ZdUserInfo = class ZdUserInfo extends vuetify.ZdComponentRender {
34
+ constructor() {
35
+ super(...arguments);
36
+ this.instanceType = zdUserInfoCommon.UserInfo;
37
+ }
38
+ };
39
+ __decorate([
40
+ vuePropertyDecorator.Prop({ type: [Object] }),
41
+ __metadata("design:type", Object)
42
+ ], ZdUserInfo.prototype, "activator", void 0);
43
+ __decorate([
44
+ vuePropertyDecorator.Prop({ type: [Object], default: () => ({}) }),
45
+ __metadata("design:type", Object)
46
+ ], ZdUserInfo.prototype, "avatarProps", void 0);
47
+ __decorate([
48
+ vuePropertyDecorator.Prop({ type: [Array], default: () => ([]) }),
49
+ __metadata("design:type", Array)
50
+ ], ZdUserInfo.prototype, "bottomSlot", void 0);
51
+ __decorate([
52
+ vuePropertyDecorator.Prop({ type: [Array] }),
53
+ __metadata("design:type", Array)
54
+ ], ZdUserInfo.prototype, "centerSlot", void 0);
55
+ __decorate([
56
+ vuePropertyDecorator.Prop({ type: [Array], default: () => ([]) }),
57
+ __metadata("design:type", Array)
58
+ ], ZdUserInfo.prototype, "topSlot", void 0);
59
+ __decorate([
60
+ vuePropertyDecorator.Prop({ type: [Array], default: () => ([]) }),
61
+ __metadata("design:type", Array)
62
+ ], ZdUserInfo.prototype, "headerSlot", void 0);
63
+ __decorate([
64
+ vuetify.PropWatch({ type: [String, Boolean], default: true }),
65
+ __metadata("design:type", Boolean)
66
+ ], ZdUserInfo.prototype, "showProfileChange", void 0);
67
+ __decorate([
68
+ vuetify.PropWatch({ type: [String], default: '' }),
69
+ __metadata("design:type", String)
70
+ ], ZdUserInfo.prototype, "user", void 0);
71
+ __decorate([
72
+ vuetify.PropWatch({ type: [String], default: '' }),
73
+ __metadata("design:type", String)
74
+ ], ZdUserInfo.prototype, "userImage", void 0);
75
+ __decorate([
76
+ vuetify.PropWatch({ type: [Boolean, String], default: true }),
77
+ __metadata("design:type", Boolean)
78
+ ], ZdUserInfo.prototype, "closeOnClick", void 0);
79
+ __decorate([
80
+ vuetify.PropWatch({ type: [Boolean, String], default: true }),
81
+ __metadata("design:type", Boolean)
82
+ ], ZdUserInfo.prototype, "closeOnContentClick", void 0);
83
+ __decorate([
84
+ vuetify.PropWatch({ type: [Boolean, String], default: false }),
85
+ __metadata("design:type", Boolean)
86
+ ], ZdUserInfo.prototype, "fixed", void 0);
87
+ __decorate([
88
+ vuetify.PropWatch({ type: [Object], default: () => ({}) }),
89
+ __metadata("design:type", Object)
90
+ ], ZdUserInfo.prototype, "imageProps", void 0);
91
+ __decorate([
92
+ vuetify.PropWatch({ type: [Boolean, String], default: false }),
93
+ __metadata("design:type", Boolean)
94
+ ], ZdUserInfo.prototype, "offsetX", void 0);
95
+ __decorate([
96
+ vuetify.PropWatch({ type: [Boolean, String], default: true }),
97
+ __metadata("design:type", Boolean)
98
+ ], ZdUserInfo.prototype, "offsetY", void 0);
99
+ __decorate([
100
+ vuetify.PropWatch({ type: [Boolean, String], default: true }),
101
+ __metadata("design:type", Boolean)
102
+ ], ZdUserInfo.prototype, "openOnClick", void 0);
103
+ __decorate([
104
+ vuetify.PropWatch({ type: [Boolean, String], default: false }),
105
+ __metadata("design:type", Boolean)
106
+ ], ZdUserInfo.prototype, "openOnHover", void 0);
107
+ __decorate([
108
+ vuetify.PropWatch({ type: [Number, String], default: 'auto' }),
109
+ __metadata("design:type", Object)
110
+ ], ZdUserInfo.prototype, "height", void 0);
111
+ __decorate([
112
+ vuetify.PropWatch({ type: [Number, String] }),
113
+ __metadata("design:type", Object)
114
+ ], ZdUserInfo.prototype, "maxHeight", void 0);
115
+ __decorate([
116
+ vuetify.PropWatch({ type: [Number, String] }),
117
+ __metadata("design:type", Object)
118
+ ], ZdUserInfo.prototype, "maxWidth", void 0);
119
+ __decorate([
120
+ vuetify.PropWatch({ type: [Number, String] }),
121
+ __metadata("design:type", Object)
122
+ ], ZdUserInfo.prototype, "minHeight", void 0);
123
+ __decorate([
124
+ vuetify.PropWatch({ type: [Number, String] }),
125
+ __metadata("design:type", Object)
126
+ ], ZdUserInfo.prototype, "minWidth", void 0);
127
+ __decorate([
128
+ vuetify.PropWatch({ default: undefined }),
129
+ __metadata("design:type", Object)
130
+ ], ZdUserInfo.prototype, "value", void 0);
131
+ ZdUserInfo = __decorate([
132
+ vuePropertyDecorator.Component
133
+ ], ZdUserInfo);
134
+ var script = ZdUserInfo;
135
+
136
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
137
+ if (typeof shadowMode !== 'boolean') {
138
+ createInjectorSSR = createInjector;
139
+ createInjector = shadowMode;
140
+ shadowMode = false;
141
+ }
142
+ // Vue.extend constructor export interop.
143
+ const options = typeof script === 'function' ? script.options : script;
144
+ // render functions
145
+ if (template && template.render) {
146
+ options.render = template.render;
147
+ options.staticRenderFns = template.staticRenderFns;
148
+ options._compiled = true;
149
+ // functional template
150
+ if (isFunctionalTemplate) {
151
+ options.functional = true;
152
+ }
153
+ }
154
+ // scopedId
155
+ if (scopeId) {
156
+ options._scopeId = scopeId;
157
+ }
158
+ let hook;
159
+ if (moduleIdentifier) {
160
+ // server build
161
+ hook = function (context) {
162
+ // 2.3 injection
163
+ context =
164
+ context || // cached call
165
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
166
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
167
+ // 2.2 with runInNewContext: true
168
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
169
+ context = __VUE_SSR_CONTEXT__;
170
+ }
171
+ // inject component styles
172
+ if (style) {
173
+ style.call(this, createInjectorSSR(context));
174
+ }
175
+ // register component module identifier for async chunk inference
176
+ if (context && context._registeredComponents) {
177
+ context._registeredComponents.add(moduleIdentifier);
178
+ }
179
+ };
180
+ // used by ssr in case component is cached and beforeCreate
181
+ // never gets called
182
+ options._ssrRegister = hook;
183
+ }
184
+ else if (style) {
185
+ hook = shadowMode
186
+ ? function (context) {
187
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
188
+ }
189
+ : function (context) {
190
+ style.call(this, createInjector(context));
191
+ };
192
+ }
193
+ if (hook) {
194
+ if (options.functional) {
195
+ // register for functional component in vue file
196
+ const originalRender = options.render;
197
+ options.render = function renderWithStyleInjection(h, context) {
198
+ hook.call(context);
199
+ return originalRender(h, context);
200
+ };
201
+ }
202
+ else {
203
+ // inject component registration as beforeCreate hook
204
+ const existing = options.beforeCreate;
205
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
206
+ }
207
+ }
208
+ return script;
209
+ }
210
+
211
+ /* script */
212
+ const __vue_script__ = script;
213
+
214
+ /* template */
215
+ var __vue_render__ = function () {
216
+ var _vm = this;
217
+ var _h = _vm.$createElement;
218
+ var _c = _vm._self._c || _h;
219
+ return _c(
220
+ "zd-dropdown",
221
+ { attrs: { "instance-object": _vm.instance, name: "dropdown" } },
222
+ [
223
+ _vm.instance.headerSlot.length > 0 || _vm.$slots.headerSlot
224
+ ? [
225
+ _vm._l(_vm.instance.headerSlot, function (child, index) {
226
+ return _c(
227
+ child.component,
228
+ _vm._b(
229
+ { key: "top_" + index, tag: "component" },
230
+ "component",
231
+ child,
232
+ false
233
+ )
234
+ )
235
+ }),
236
+ _vm._v(" "),
237
+ _vm._t("headerSlot"),
238
+ ]
239
+ : _c("div", { staticClass: "zd-text-center text-h5 zd-pa-2" }, [
240
+ _vm._v(_vm._s(_vm.instance.user)),
241
+ ]),
242
+ _vm._v(" "),
243
+ _vm.instance.topSlot.length > 0 || _vm.$slots.topSlot
244
+ ? [
245
+ _c("v-divider"),
246
+ _vm._v(" "),
247
+ _vm._l(_vm.instance.topSlot, function (child, index) {
248
+ return _c(
249
+ child.component,
250
+ _vm._b(
251
+ { key: "top_" + index, tag: "component" },
252
+ "component",
253
+ child,
254
+ false
255
+ )
256
+ )
257
+ }),
258
+ _vm._v(" "),
259
+ _vm._t("topSlot"),
260
+ ]
261
+ : _vm._e(),
262
+ _vm._v(" "),
263
+ _vm.instance.centerSlot.length > 0 || _vm.$slots.centerSlot
264
+ ? [
265
+ _c("v-divider"),
266
+ _vm._v(" "),
267
+ _vm._l(_vm.instance.centerSlot, function (child, index) {
268
+ return _c(
269
+ child.component,
270
+ _vm._b(
271
+ { key: "center_" + index, tag: "component" },
272
+ "component",
273
+ child,
274
+ false
275
+ )
276
+ )
277
+ }),
278
+ _vm._v(" "),
279
+ _vm._t("centerSlot"),
280
+ ]
281
+ : _vm._e(),
282
+ _vm._v(" "),
283
+ _vm.instance.bottomSlot.length > 0 || _vm.$slots.bottomSlot
284
+ ? [
285
+ _c("v-divider"),
286
+ _vm._v(" "),
287
+ _vm._l(_vm.instance.bottomSlot, function (child, index) {
288
+ return _c(
289
+ child.component,
290
+ _vm._b(
291
+ { key: "bottom_" + index, tag: "component" },
292
+ "component",
293
+ child,
294
+ false
295
+ )
296
+ )
297
+ }),
298
+ _vm._v(" "),
299
+ _vm._t("bottomSlot"),
300
+ ]
301
+ : _vm._e(),
302
+ ],
303
+ 2
304
+ )
305
+ };
306
+ var __vue_staticRenderFns__ = [];
307
+ __vue_render__._withStripped = true;
308
+
309
+ /* style */
310
+ const __vue_inject_styles__ = undefined;
311
+ /* scoped */
312
+ const __vue_scope_id__ = undefined;
313
+ /* module identifier */
314
+ const __vue_module_identifier__ = undefined;
315
+ /* functional template */
316
+ const __vue_is_functional_template__ = false;
317
+ /* style inject */
318
+
319
+ /* style inject SSR */
320
+
321
+ /* style inject shadow dom */
322
+
323
+
324
+
325
+ const __vue_component__ = /*#__PURE__*/normalizeComponent(
326
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
327
+ __vue_inject_styles__,
328
+ __vue_script__,
329
+ __vue_scope_id__,
330
+ __vue_is_functional_template__,
331
+ __vue_module_identifier__,
332
+ false,
333
+ undefined,
334
+ undefined,
335
+ undefined
336
+ );
337
+
338
+ exports.ZdUserInfo = __vue_component__;
339
+ exports.ZdUserInfoClass = script;
340
+
341
+ Object.defineProperty(exports, '__esModule', { value: true });
342
+
343
+ }));
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@zeedhi/zd-user-info-vue",
3
+ "version": "1.0.0",
4
+ "description": "Implementation of UserInfo componente using Zeedhi Next",
5
+ "main": "dist/user-info-vue.umd.js",
6
+ "module": "dist/user-info-vue.esm.js",
7
+ "typings": "types/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "scripts": {
12
+ "build": "rollup -c",
13
+ "lint": "eslint . --ext .ts --fix",
14
+ "watch": "rollup -cw"
15
+ },
16
+ "peerDependencies": {
17
+ "@zeedhi/common": "^1.0.0",
18
+ "@zeedhi/core": "^1.0.0",
19
+ "@zeedhi/vuetify": "^1.0.0",
20
+ "@zeedhi/zd-user-info-common": "*",
21
+ "vue": "^2.6.12",
22
+ "vue-class-component": "^7.2.6",
23
+ "vue-property-decorator": "^9.1.2"
24
+ },
25
+ "gitHead": "27e18bb3b09807d56dd5823a827f18b50b74da3c"
26
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": [
4
+ "./src/**/*.ts",
5
+ "./tests/**/*.ts"
6
+ ],
7
+ "exclude": [
8
+ "node_modules"
9
+ ]
10
+ }
@@ -0,0 +1,31 @@
1
+ import { ZdComponentRender } from '@zeedhi/vuetify';
2
+ import { UserInfo as UserInfoClass } from '@zeedhi/zd-user-info-common';
3
+ import { IComponentRender } from '@zeedhi/common';
4
+ import { IDictionary } from '@zeedhi/core';
5
+ export default class ZdUserInfo extends ZdComponentRender {
6
+ instance: UserInfoClass;
7
+ instanceType: typeof UserInfoClass;
8
+ activator: IComponentRender;
9
+ avatarProps: IDictionary;
10
+ bottomSlot: IComponentRender[];
11
+ centerSlot: IComponentRender[];
12
+ topSlot: IComponentRender[];
13
+ headerSlot: IComponentRender[];
14
+ showProfileChange: boolean;
15
+ user: string;
16
+ userImage: string;
17
+ closeOnClick: boolean;
18
+ closeOnContentClick: boolean;
19
+ fixed: boolean;
20
+ imageProps: IDictionary;
21
+ offsetX: boolean;
22
+ offsetY: boolean;
23
+ openOnClick: boolean;
24
+ openOnHover: boolean;
25
+ height?: number | string;
26
+ maxHeight?: number | string;
27
+ maxWidth?: number | string;
28
+ minHeight?: number | string;
29
+ minWidth?: number | string;
30
+ value: any;
31
+ }
@@ -0,0 +1,3 @@
1
+ import ZdUserInfo from './UserInfo.vue';
2
+ import ZdUserInfoClass from './UserInfo';
3
+ export { ZdUserInfo, ZdUserInfoClass };