@ailaw/venus 0.14.1 → 1.3.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.
Files changed (130) hide show
  1. package/package.json +3 -3
  2. package/dist/a-file-uploader/index.vue.d.ts +0 -65
  3. package/dist/a-test-component/index.vue.d.ts +0 -10
  4. package/dist/ar.js +0 -1522
  5. package/dist/ar2.js +0 -2703
  6. package/dist/ar3.js +0 -897
  7. package/dist/assignee-tag/index.vue.d.ts +0 -20
  8. package/dist/attorney.js +0 -2
  9. package/dist/ben.js +0 -1521
  10. package/dist/ben2.js +0 -2702
  11. package/dist/ben3.js +0 -897
  12. package/dist/case-template-select/components/case-template-option.vue.d.ts +0 -19
  13. package/dist/case-template-select/components/case-template-type-badge.vue.d.ts +0 -12
  14. package/dist/case-template-select/gqls/templates.gql.d.ts +0 -1
  15. package/dist/case-template-select/hooks/useCaseTemplates.d.ts +0 -5
  16. package/dist/case-template-select/index.vue.d.ts +0 -27
  17. package/dist/case-template-select/types.d.ts +0 -9
  18. package/dist/ch.js +0 -1647
  19. package/dist/ch2.js +0 -2706
  20. package/dist/ch3.js +0 -897
  21. package/dist/company.js +0 -2
  22. package/dist/en.js +0 -1522
  23. package/dist/en2.js +0 -2706
  24. package/dist/en3.js +0 -924
  25. package/dist/es.js +0 -1647
  26. package/dist/es2.js +0 -2704
  27. package/dist/es3.js +0 -897
  28. package/dist/fa.js +0 -1522
  29. package/dist/fa2.js +0 -2702
  30. package/dist/fa3.js +0 -897
  31. package/dist/forms/G-1145.d.ts +0 -2
  32. package/dist/forms/G-1450.d.ts +0 -2
  33. package/dist/forms/G-28-Company.d.ts +0 -2
  34. package/dist/forms/G-28-Person.d.ts +0 -2
  35. package/dist/forms/G-639.d.ts +0 -2
  36. package/dist/forms/I-129 Attachment.d.ts +0 -2
  37. package/dist/forms/I-129 Trade Agreement Supplement.d.ts +0 -2
  38. package/dist/forms/I-129 with H Supplement-Company Petitioner.d.ts +0 -2
  39. package/dist/forms/I-130.d.ts +0 -2
  40. package/dist/forms/I-130A.d.ts +0 -2
  41. package/dist/forms/I-131.d.ts +0 -2
  42. package/dist/forms/I-134.d.ts +0 -2
  43. package/dist/forms/I-192.d.ts +0 -2
  44. package/dist/forms/I-485.d.ts +0 -2
  45. package/dist/forms/I-485A.d.ts +0 -2
  46. package/dist/forms/I-508.d.ts +0 -2
  47. package/dist/forms/I-539.d.ts +0 -2
  48. package/dist/forms/I-539A.d.ts +0 -2
  49. package/dist/forms/I-589.d.ts +0 -2
  50. package/dist/forms/I-601A.d.ts +0 -2
  51. package/dist/forms/I-765.d.ts +0 -2
  52. package/dist/forms/I-864.d.ts +0 -2
  53. package/dist/forms/I-864A.d.ts +0 -2
  54. package/dist/forms/I-864EZ.d.ts +0 -2
  55. package/dist/forms/I-864W.d.ts +0 -2
  56. package/dist/forms/I-907.d.ts +0 -2
  57. package/dist/forms/I-918.d.ts +0 -2
  58. package/dist/forms/I-918A.d.ts +0 -2
  59. package/dist/forms/I-918B.d.ts +0 -2
  60. package/dist/forms/index.d.ts +0 -33
  61. package/dist/fr.js +0 -1522
  62. package/dist/fr2.js +0 -2704
  63. package/dist/fr3.js +0 -897
  64. package/dist/hi.js +0 -1645
  65. package/dist/hi2.js +0 -2704
  66. package/dist/hi3.js +0 -897
  67. package/dist/hooks/useMe/index.d.ts +0 -2
  68. package/dist/hooks/useMe/me.gql.d.ts +0 -1
  69. package/dist/hooks/useMe/types.d.ts +0 -4
  70. package/dist/hooks/useT.d.ts +0 -1
  71. package/dist/hooks/useTask/useMutateTaskTemplate.d.ts +0 -9
  72. package/dist/hooks/useTask/useSearchTaskConditions.d.ts +0 -4
  73. package/dist/hooks/useTask/useSearchTaskTemplates.d.ts +0 -7
  74. package/dist/hooks/useTask/useTaskActions.d.ts +0 -8
  75. package/dist/hooks/useTask/useTaskTemplateTableData.d.ts +0 -15
  76. package/dist/hooks/useVm.d.ts +0 -1
  77. package/dist/ht.js +0 -1522
  78. package/dist/ht2.js +0 -2704
  79. package/dist/ht3.js +0 -897
  80. package/dist/hy.js +0 -1522
  81. package/dist/hy2.js +0 -2704
  82. package/dist/hy3.js +0 -897
  83. package/dist/index.d.ts +0 -20
  84. package/dist/individual.js +0 -2
  85. package/dist/jp.js +0 -1521
  86. package/dist/jp2.js +0 -2702
  87. package/dist/jp3.js +0 -897
  88. package/dist/ko.js +0 -1642
  89. package/dist/ko2.js +0 -2704
  90. package/dist/ko3.js +0 -897
  91. package/dist/nep.js +0 -1521
  92. package/dist/nep2.js +0 -2702
  93. package/dist/nep3.js +0 -897
  94. package/dist/new-task/index.vue.d.ts +0 -217
  95. package/dist/profile-select/gqls/profile.gql.d.ts +0 -9
  96. package/dist/profile-select/hooks/useCreateProfile.d.ts +0 -5
  97. package/dist/profile-select/hooks/useProfiles.d.ts +0 -6
  98. package/dist/profile-select/index.vue.d.ts +0 -87
  99. package/dist/profile-select/profile-create-modal.vue.d.ts +0 -90
  100. package/dist/profile-select/profile-select-item.vue.d.ts +0 -15
  101. package/dist/profile-select/profile-selector.vue.d.ts +0 -57
  102. package/dist/profile-select/profile-type-select.vue.d.ts +0 -32
  103. package/dist/profile-type-icon/index.vue.d.ts +0 -19
  104. package/dist/pt.js +0 -1522
  105. package/dist/pt2.js +0 -2704
  106. package/dist/pt3.js +0 -897
  107. package/dist/ru.js +0 -1644
  108. package/dist/ru2.js +0 -2704
  109. package/dist/ru3.js +0 -897
  110. package/dist/style.css +0 -1
  111. package/dist/tags-with-tooltip/index.vue.d.ts +0 -33
  112. package/dist/task-cart/MainModal.vue.d.ts +0 -95
  113. package/dist/task-cart/ReviewModal.vue.d.ts +0 -77
  114. package/dist/task-cart/TaskTable.vue.d.ts +0 -69
  115. package/dist/task-cart/TaskTablePure.vue.d.ts +0 -93
  116. package/dist/task-cart/index.vue.d.ts +0 -235
  117. package/dist/task-form/index.vue.d.ts +0 -47
  118. package/dist/task-form/refactorParams.d.ts +0 -3
  119. package/dist/task-form/useChangeVal.d.ts +0 -2
  120. package/dist/task-template-filter/index.vue.d.ts +0 -55
  121. package/dist/tr.js +0 -1522
  122. package/dist/tr2.js +0 -2706
  123. package/dist/tr3.js +0 -924
  124. package/dist/types/common.d.ts +0 -32
  125. package/dist/types/form.d.ts +0 -9
  126. package/dist/types/profile.d.ts +0 -16
  127. package/dist/types/task.d.ts +0 -110
  128. package/dist/utils/forms.d.ts +0 -2
  129. package/dist/utils/languages.d.ts +0 -1
  130. package/dist/venus.es.js +0 -2552
package/dist/venus.es.js DELETED
@@ -1,2552 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop2 in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop2))
11
- __defNormalProp(a, prop2, b[prop2]);
12
- if (__getOwnPropSymbols)
13
- for (var prop2 of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop2))
15
- __defNormalProp(a, prop2, b[prop2]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, ref, watch, toRefs, reactive, computed, getCurrentScope, shallowRef } from "vue-demi";
21
- import { Select, Modal, FormModel, Input, Checkbox, Divider, Button, Upload, Tag, Icon, Tooltip, Form, Row, Col, Radio, Popconfirm, Table, Badge, Card, message } from "ant-design-vue";
22
- import { useQuery, useResult, useMutation, useApolloClient } from "@vue/apollo-composable";
23
- import gql from "graphql-tag";
24
- import { path, uniqBy, prop, sort } from "ramda";
25
- var index$5 = "";
26
- function __variableDynamicImportRuntime0__$1(path2) {
27
- switch (path2) {
28
- case "./icons/attorney.svg":
29
- return import("./attorney.js");
30
- case "./icons/company.svg":
31
- return import("./company.js");
32
- case "./icons/individual.svg":
33
- return import("./individual.js");
34
- default:
35
- return new Promise(function(resolve, reject) {
36
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path2)));
37
- });
38
- }
39
- }
40
- var __vue2_script$k = defineComponent({
41
- props: {
42
- type: {
43
- type: String,
44
- required: true
45
- }
46
- },
47
- setup(props) {
48
- const iconUrl = ref();
49
- watch(() => props.type, (value) => {
50
- let iconName = "";
51
- switch (value) {
52
- case "USERPROFILE":
53
- iconName = "individual";
54
- break;
55
- case "CLIENTPROFILE":
56
- iconName = "company";
57
- break;
58
- default:
59
- iconName = "attorney";
60
- break;
61
- }
62
- __variableDynamicImportRuntime0__$1(`./icons/${iconName}.svg`).then((result) => iconUrl.value = result.default);
63
- }, { immediate: true });
64
- return { iconUrl };
65
- }
66
- });
67
- var render$k = function() {
68
- var _vm = this;
69
- var _h = _vm.$createElement;
70
- var _c = _vm._self._c || _h;
71
- return _c("img", { staticClass: "w-6 h-6", attrs: { "src": _vm.iconUrl, "alt": _vm.type } });
72
- };
73
- var staticRenderFns$k = [];
74
- function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
75
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
76
- if (render2) {
77
- options.render = render2;
78
- options.staticRenderFns = staticRenderFns2;
79
- options._compiled = true;
80
- }
81
- if (functionalTemplate) {
82
- options.functional = true;
83
- }
84
- if (scopeId) {
85
- options._scopeId = "data-v-" + scopeId;
86
- }
87
- var hook;
88
- if (moduleIdentifier) {
89
- hook = function(context) {
90
- context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
91
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
92
- context = __VUE_SSR_CONTEXT__;
93
- }
94
- if (injectStyles) {
95
- injectStyles.call(this, context);
96
- }
97
- if (context && context._registeredComponents) {
98
- context._registeredComponents.add(moduleIdentifier);
99
- }
100
- };
101
- options._ssrRegister = hook;
102
- } else if (injectStyles) {
103
- hook = shadowMode ? function() {
104
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
105
- } : injectStyles;
106
- }
107
- if (hook) {
108
- if (options.functional) {
109
- options._injectStyles = hook;
110
- var originalRender = options.render;
111
- options.render = function renderWithStyleInjection(h, context) {
112
- hook.call(context);
113
- return originalRender(h, context);
114
- };
115
- } else {
116
- var existing = options.beforeCreate;
117
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
118
- }
119
- }
120
- return {
121
- exports: scriptExports,
122
- options
123
- };
124
- }
125
- const __cssModules$k = {};
126
- var __component__$k = /* @__PURE__ */ normalizeComponent(__vue2_script$k, render$k, staticRenderFns$k, false, __vue2_injectStyles$k, null, null, null);
127
- function __vue2_injectStyles$k(context) {
128
- for (let o in __cssModules$k) {
129
- this[o] = __cssModules$k[o];
130
- }
131
- }
132
- var ProfileTypeIcon = /* @__PURE__ */ function() {
133
- return __component__$k.exports;
134
- }();
135
- var __vue2_script$j = defineComponent({
136
- props: {
137
- source: {
138
- type: Object,
139
- required: true
140
- }
141
- },
142
- components: { ProfileTypeIcon }
143
- });
144
- var render$j = function() {
145
- var _vm = this;
146
- var _h = _vm.$createElement;
147
- var _c = _vm._self._c || _h;
148
- return _c("div", { staticClass: "flex space-x-1 items-center" }, [_c("ProfileTypeIcon", { attrs: { "type": _vm.source.profileType } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.source.profileName))])], 1);
149
- };
150
- var staticRenderFns$j = [];
151
- const __cssModules$j = {};
152
- var __component__$j = /* @__PURE__ */ normalizeComponent(__vue2_script$j, render$j, staticRenderFns$j, false, __vue2_injectStyles$j, null, null, null);
153
- function __vue2_injectStyles$j(context) {
154
- for (let o in __cssModules$j) {
155
- this[o] = __cssModules$j[o];
156
- }
157
- }
158
- var ProfileSelectItem = /* @__PURE__ */ function() {
159
- return __component__$j.exports;
160
- }();
161
- const meQuery = gql`
162
- query Me {
163
- me {
164
- id
165
- lawFirmId
166
- }
167
- }
168
- `;
169
- function useMe() {
170
- const { result } = useQuery(meQuery, void 0, {
171
- fetchPolicy: "cache-first"
172
- });
173
- return useResult(result);
174
- }
175
- const profilesQuery = gql`
176
- query ProfileSearch(
177
- $lawFirmId: Int!
178
- $keywords: String
179
- $profileType: String
180
- $profileTypeInt: [Int!]
181
- $profileIds: [Int!]
182
- $isDisabled: Int
183
- ) {
184
- profileSearch(
185
- query: {
186
- lawFirmId: $lawFirmId
187
- keywords: $keywords
188
- profileType: $profileType
189
- profileTypeInt: $profileTypeInt
190
- profileId: $profileIds
191
- isDisabled: $isDisabled
192
- }
193
- ) {
194
- numResult
195
- profileList(startIndex: 0, endIndex: 99) {
196
- id
197
- profileType
198
- profileName
199
- accountList {
200
- id
201
- email
202
- }
203
- }
204
- }
205
- }
206
- `;
207
- const addProfileUserMutation = gql`
208
- mutation AddProfileUser(
209
- $lawFirmId: Int!
210
- $name: String!
211
- $profileType: ProfileType
212
- $email: String!
213
- $sendEmail: Boolean!
214
- ) {
215
- addProfileUser(
216
- selfLawFirmId: $lawFirmId
217
- name: $name
218
- profileType: $profileType
219
- email: $email
220
- sendEmail: $sendEmail
221
- ) {
222
- profile {
223
- id
224
- profileName
225
- profileType
226
- accountList {
227
- id
228
- email
229
- }
230
- }
231
- }
232
- }
233
- `;
234
- function useCreateProfile() {
235
- const me = useMe();
236
- const { mutate, loading } = useMutation(addProfileUserMutation);
237
- const createProfile = async (variables) => {
238
- var _a;
239
- const result = await mutate(__spreadProps(__spreadValues({}, variables), {
240
- lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
241
- }));
242
- return path(["data", "addProfileUser", "profile"], result);
243
- };
244
- return { createProfile, loading };
245
- }
246
- const profileTypes = {
247
- USERPROFILE: "Individual",
248
- CLIENTPROFILE: "Company",
249
- PREPARERPROFILE: "Attorney"
250
- };
251
- var __vue2_script$i = defineComponent({
252
- props: {
253
- value: {
254
- type: String
255
- },
256
- enabledTypes: {
257
- type: Array,
258
- default: ["USERPROFILE", "CLIENTPROFILE", "PREPARERPROFILE"]
259
- }
260
- },
261
- components: {
262
- Select,
263
- Option: Select.Option,
264
- ProfileTypeIcon
265
- },
266
- setup(_, { emit }) {
267
- const handleChange = (value) => emit("input", value);
268
- return { profileTypes, handleChange };
269
- }
270
- });
271
- var render$i = function() {
272
- var _vm = this;
273
- var _h = _vm.$createElement;
274
- var _c = _vm._self._c || _h;
275
- return _c("Select", { attrs: { "value": _vm.value }, on: { "change": _vm.handleChange } }, _vm._l(_vm.enabledTypes, function(key) {
276
- return _c("Option", { key, attrs: { "value": key } }, [_c("div", { staticClass: "flex items-center space-x-1" }, [_c("ProfileTypeIcon", { attrs: { "type": key } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.profileTypes[key]))])], 1)]);
277
- }), 1);
278
- };
279
- var staticRenderFns$i = [];
280
- const __cssModules$i = {};
281
- var __component__$i = /* @__PURE__ */ normalizeComponent(__vue2_script$i, render$i, staticRenderFns$i, false, __vue2_injectStyles$i, null, null, null);
282
- function __vue2_injectStyles$i(context) {
283
- for (let o in __cssModules$i) {
284
- this[o] = __cssModules$i[o];
285
- }
286
- }
287
- var ProfileTypeSelect = /* @__PURE__ */ function() {
288
- return __component__$i.exports;
289
- }();
290
- var __vue2_script$h = defineComponent({
291
- props: {
292
- enabledTypes: {
293
- type: Array,
294
- default: () => ["USERPROFILE", "CLIENTPROFILE"]
295
- },
296
- simpleCreate: {
297
- type: Boolean,
298
- default: false
299
- },
300
- profileType: {
301
- type: String
302
- }
303
- },
304
- components: {
305
- Modal,
306
- Form: FormModel,
307
- FormItem: FormModel.Item,
308
- ProfileTypeSelect,
309
- Input,
310
- Checkbox
311
- },
312
- setup(props, { emit }) {
313
- const { simpleCreate, profileType } = toRefs(props);
314
- const value = reactive({
315
- profileType: simpleCreate.value ? profileType == null ? void 0 : profileType.value : void 0,
316
- name: "",
317
- email: "",
318
- sendEmail: false
319
- });
320
- const hasValidationError = ref(false);
321
- const canSubmit = computed(() => {
322
- if (simpleCreate.value && value.name)
323
- return true;
324
- return !(value.name === "" || value.profileType == null || hasValidationError.value);
325
- });
326
- const rules = {
327
- profileType: { required: true },
328
- name: { required: true },
329
- email: { type: "email" }
330
- };
331
- const handleValidate = (_, result) => {
332
- hasValidationError.value = !result;
333
- };
334
- const clearValue = () => Object.assign(value, {});
335
- const { createProfile, loading } = useCreateProfile();
336
- const hide = () => emit("cancel");
337
- const handleSubmit = async () => {
338
- const profile = await createProfile(value);
339
- hide();
340
- emit("profile-created", profile);
341
- };
342
- return {
343
- value,
344
- rules,
345
- clearValue,
346
- loading,
347
- canSubmit,
348
- handleSubmit,
349
- handleValidate
350
- };
351
- }
352
- });
353
- var render$h = function() {
354
- var _vm = this;
355
- var _h = _vm.$createElement;
356
- var _c = _vm._self._c || _h;
357
- return _c("modal", _vm._g(_vm._b({ attrs: { "closable": false, "ok-text": "Create", "width": 320, "okButtonProps": { props: { disabled: !_vm.canSubmit, loading: _vm.loading } } }, on: { "cancel": _vm.clearValue, "ok": _vm.handleSubmit } }, "modal", _vm.$attrs, false), _vm.$listeners), [_c("Form", { attrs: { "layout": "vertical", "validate-trigger": "blur", "model": _vm.value, "rules": _vm.rules }, on: { "validate": _vm.handleValidate } }, [!_vm.simpleCreate ? _c("form-item", { attrs: { "label": "Profile type", "prop": "profileType" } }, [_c("profile-type-select", { attrs: { "enabledTypes": _vm.enabledTypes }, model: { value: _vm.value.profileType, callback: function($$v) {
358
- _vm.$set(_vm.value, "profileType", $$v);
359
- }, expression: "value.profileType" } })], 1) : _vm._e(), _c("form-item", { class: { "mb-0": _vm.simpleCreate }, attrs: { "label": "Name", "prop": "name" } }, [_c("Input", { model: { value: _vm.value.name, callback: function($$v) {
360
- _vm.$set(_vm.value, "name", $$v);
361
- }, expression: "value.name" } })], 1), !_vm.simpleCreate ? _c("form-item", { attrs: { "label": "Email", "prop": "email" } }, [_c("Input", { model: { value: _vm.value.email, callback: function($$v) {
362
- _vm.$set(_vm.value, "email", $$v);
363
- }, expression: "value.email" } })], 1) : _vm._e(), !_vm.simpleCreate ? _c("form-item", [_c("checkbox", { model: { value: _vm.value.sendEmail, callback: function($$v) {
364
- _vm.$set(_vm.value, "sendEmail", $$v);
365
- }, expression: "value.sendEmail" } }, [_vm._v("Send client portal login password (System will email client a login password)")])], 1) : _vm._e()], 1)], 1);
366
- };
367
- var staticRenderFns$h = [];
368
- const __cssModules$h = {};
369
- var __component__$h = /* @__PURE__ */ normalizeComponent(__vue2_script$h, render$h, staticRenderFns$h, false, __vue2_injectStyles$h, null, null, null);
370
- function __vue2_injectStyles$h(context) {
371
- for (let o in __cssModules$h) {
372
- this[o] = __cssModules$h[o];
373
- }
374
- }
375
- var ProfileCreateModal = /* @__PURE__ */ function() {
376
- return __component__$h.exports;
377
- }();
378
- var __vue2_script$g = defineComponent({
379
- props: {
380
- value: {
381
- type: Object
382
- },
383
- source: {
384
- type: Array,
385
- required: true
386
- },
387
- creatable: {
388
- type: Boolean,
389
- default: false
390
- }
391
- },
392
- components: {
393
- Select,
394
- Option: Select.Option,
395
- Divider,
396
- Button,
397
- ProfileSelectItem,
398
- ProfileCreateModal
399
- },
400
- setup(props, { emit }) {
401
- const selectedId = computed(() => {
402
- var _a;
403
- return (_a = props.value) == null ? void 0 : _a.id;
404
- });
405
- const handleChange = (value) => emit("input", props.source.find((v) => String(v.id) == value));
406
- const handleProfileCreate = () => emit("create-profile");
407
- const filterOption = (val, option) => {
408
- if (!option.data.attrs.name)
409
- return true;
410
- return option.data.attrs.name === "create-btn" || option.data.attrs.name.toUpperCase().includes(val.toUpperCase());
411
- };
412
- return {
413
- filterOption,
414
- selectedId,
415
- handleChange,
416
- handleProfileCreate,
417
- menu: {}
418
- };
419
- }
420
- });
421
- var render$g = function() {
422
- var _vm = this;
423
- var _h = _vm.$createElement;
424
- var _c = _vm._self._c || _h;
425
- return _c("Select", _vm._g(_vm._b({ staticClass: "w-72", attrs: { "allowClear": "", "showSearch": "", "optionFilterProp": "name", "value": _vm.selectedId, "filterOption": _vm.filterOption }, on: { "change": _vm.handleChange } }, "Select", _vm.$attrs, false), _vm.$listeners), [_c("Option", { key: "create-btn", attrs: { "value": "create-btn", "disabled": "", "name": "create-btn" } }, [_c("Button", { staticStyle: { "width": "100%" }, on: { "click": _vm.handleProfileCreate } }, [_vm._v("Create new profile ")]), _vm.creatable ? _c("Divider", { staticClass: "btn-divider" }) : _vm._e()], 1), _vm._l(_vm.source, function(v) {
426
- return _c("Option", { key: v.id, attrs: { "value": v.id, "name": v.profileName } }, [_c("ProfileSelectItem", { attrs: { "source": v } })], 1);
427
- })], 2);
428
- };
429
- var staticRenderFns$g = [];
430
- var profileSelector_vue_vue_type_style_index_0_scoped_true_lang = "";
431
- const __cssModules$g = {};
432
- var __component__$g = /* @__PURE__ */ normalizeComponent(__vue2_script$g, render$g, staticRenderFns$g, false, __vue2_injectStyles$g, "599bdbb2", null, null);
433
- function __vue2_injectStyles$g(context) {
434
- for (let o in __cssModules$g) {
435
- this[o] = __cssModules$g[o];
436
- }
437
- }
438
- var ProfileSelector = /* @__PURE__ */ function() {
439
- return __component__$g.exports;
440
- }();
441
- function useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile) {
442
- const me = useMe();
443
- const isDisabled = computed(() => {
444
- if (disabledProfile.value === true) {
445
- return 1;
446
- } else if (disabledProfile.value === false) {
447
- return 0;
448
- } else {
449
- return void 0;
450
- }
451
- });
452
- const { result, loading } = useQuery(profilesQuery, () => {
453
- var _a;
454
- return {
455
- lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId,
456
- keywords: keywords.value,
457
- profileType: onlyRole.value,
458
- profileTypeInt: roleTypes.value,
459
- profileIds: profileIds.value,
460
- isDisabled: isDisabled.value
461
- };
462
- }, () => ({
463
- enabled: me.value != null
464
- }));
465
- const profiles = useResult(result, [], (data) => data.profileSearch.profileList);
466
- return { profiles, loading };
467
- }
468
- var __vue2_script$f = defineComponent({
469
- components: { ProfileSelector, ProfileCreateModal },
470
- props: {
471
- value: {
472
- type: Object
473
- },
474
- creatable: {
475
- type: Boolean,
476
- default: false
477
- },
478
- onlyRole: {
479
- type: String
480
- },
481
- roleTypes: {
482
- type: Array,
483
- required: true
484
- },
485
- preLoaded: {
486
- type: Array,
487
- default: () => []
488
- },
489
- profileIds: {
490
- type: Array
491
- },
492
- simpleCreate: {
493
- type: Boolean,
494
- default: false
495
- },
496
- disabledProfile: {
497
- type: Boolean,
498
- default: void 0
499
- }
500
- },
501
- setup(props, { emit }) {
502
- const keywords = ref("");
503
- const handleSearch = (value) => keywords.value = value;
504
- const { onlyRole, roleTypes, profileIds, disabledProfile } = toRefs(props);
505
- const { profiles: rawProfiles } = useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile);
506
- const createdProfile = ref();
507
- const profiles = computed(() => {
508
- const list = [
509
- ...props.preLoaded,
510
- ...createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value
511
- ];
512
- return uniqBy(prop("id"), list);
513
- });
514
- const enabledTypes = computed(() => (onlyRole == null ? void 0 : onlyRole.value) ? [onlyRole.value] : void 0);
515
- const isModalVisible = ref(false);
516
- const toggleModal = (value) => isModalVisible.value = value;
517
- const updateValue = (value) => emit("input", value);
518
- const handleProfileCreated = (profile) => {
519
- createdProfile.value = profile;
520
- updateValue(profile);
521
- };
522
- return {
523
- profiles,
524
- isModalVisible,
525
- toggleModal,
526
- enabledTypes,
527
- updateValue,
528
- handleProfileCreated,
529
- keywords,
530
- handleSearch
531
- };
532
- }
533
- });
534
- var render$f = function() {
535
- var _vm = this;
536
- var _h = _vm.$createElement;
537
- var _c = _vm._self._c || _h;
538
- return _c("div", [_c("profile-selector", _vm._g(_vm._b({ attrs: { "source": _vm.profiles, "value": _vm.value, "creatable": _vm.creatable }, on: { "search": _vm.handleSearch, "create-profile": function($event) {
539
- return _vm.toggleModal(true);
540
- }, "input": _vm.updateValue } }, "profile-selector", _vm.$attrs, false), _vm.$listeners)), _vm.creatable ? _c("profile-create-modal", { attrs: { "visible": _vm.isModalVisible, "enabledTypes": _vm.enabledTypes, "simpleCreate": _vm.simpleCreate, "profileType": _vm.simpleCreate ? _vm.onlyRole : void 0 }, on: { "cancel": function($event) {
541
- return _vm.toggleModal(false);
542
- }, "profile-created": _vm.handleProfileCreated } }) : _vm._e()], 1);
543
- };
544
- var staticRenderFns$f = [];
545
- const __cssModules$f = {};
546
- var __component__$f = /* @__PURE__ */ normalizeComponent(__vue2_script$f, render$f, staticRenderFns$f, false, __vue2_injectStyles$f, null, null, null);
547
- function __vue2_injectStyles$f(context) {
548
- for (let o in __cssModules$f) {
549
- this[o] = __cssModules$f[o];
550
- }
551
- }
552
- var index$4 = /* @__PURE__ */ function() {
553
- return __component__$f.exports;
554
- }();
555
- const queryAllCaseTemplates = gql`
556
- query AllCaseTemplates($lawFirmId: Int!) {
557
- gallery: galleryCaseTemplateList(selfLawFirmId: $lawFirmId) {
558
- id
559
- isSmart
560
- templateName
561
- isCompanyRelated
562
- isIndividualRelated
563
- }
564
-
565
- custom: customCaseTemplateList(selfLawFirmId: $lawFirmId) {
566
- id
567
- isSmart
568
- templateName
569
- isCompanyRelated
570
- isIndividualRelated
571
- }
572
- }
573
- `;
574
- const compare = (a, b) => {
575
- if (a.templateName === b.templateName) {
576
- if (a.isSmart && b.isSmart)
577
- return 0;
578
- return a.isSmart ? 1 : -1;
579
- }
580
- return a.templateName > b.templateName ? 1 : -1;
581
- };
582
- function useCaseTemplates() {
583
- const me = useMe();
584
- const { result, loading } = useQuery(queryAllCaseTemplates, () => {
585
- var _a;
586
- return {
587
- lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
588
- };
589
- }, () => ({
590
- enabled: me.value != null
591
- }));
592
- const templates = useResult(result, {
593
- gallery: [],
594
- custom: []
595
- }, (data) => ({
596
- gallery: sort(compare, data.gallery),
597
- custom: sort(compare, data.custom)
598
- }));
599
- return { templates, loading };
600
- }
601
- var __vue2_script$e = defineComponent({
602
- props: {
603
- isSmart: {
604
- type: Boolean
605
- }
606
- },
607
- setup() {
608
- }
609
- });
610
- var render$e = function() {
611
- var _vm = this;
612
- var _h = _vm.$createElement;
613
- var _c = _vm._self._c || _h;
614
- return _c("div", { staticClass: "border border-solid rounded px-2 leading-5", class: {
615
- "text-smart bg-purple border-light-purple": _vm.isSmart,
616
- "text-classic bg-blue border-light-blue": !_vm.isSmart
617
- } }, [_vm._v(" " + _vm._s(_vm.isSmart ? _vm.$t("message.smart") : _vm.$t("message.classic")) + " ")]);
618
- };
619
- var staticRenderFns$e = [];
620
- const __cssModules$e = {};
621
- var __component__$e = /* @__PURE__ */ normalizeComponent(__vue2_script$e, render$e, staticRenderFns$e, false, __vue2_injectStyles$e, null, null, null);
622
- function __vue2_injectStyles$e(context) {
623
- for (let o in __cssModules$e) {
624
- this[o] = __cssModules$e[o];
625
- }
626
- }
627
- var CaseTemplateTypeBadge = /* @__PURE__ */ function() {
628
- return __component__$e.exports;
629
- }();
630
- var __vue2_script$d = defineComponent({
631
- props: {
632
- source: {
633
- type: Object,
634
- required: true
635
- }
636
- },
637
- components: { CaseTemplateTypeBadge },
638
- setup() {
639
- const isShowBeta = (source) => [467, 468, 469, 470, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826].includes(source.id);
640
- return {
641
- isShowBeta
642
- };
643
- }
644
- });
645
- var render$d = function() {
646
- var _vm = this;
647
- var _h = _vm.$createElement;
648
- var _c = _vm._self._c || _h;
649
- return _c("div", { staticClass: "flex space-x-2 items-center" }, [_c("span", [_vm._v(_vm._s(_vm.source.templateName))]), _c("case-template-type-badge", { attrs: { "isSmart": _vm.source.isSmart } }), _vm.isShowBeta(_vm.source) ? _c("span", { staticClass: "beta" }, [_vm._v("Beta")]) : _vm._e()], 1);
650
- };
651
- var staticRenderFns$d = [];
652
- var caseTemplateOption_vue_vue_type_style_index_0_scoped_true_lang = "";
653
- const __cssModules$d = {};
654
- var __component__$d = /* @__PURE__ */ normalizeComponent(__vue2_script$d, render$d, staticRenderFns$d, false, __vue2_injectStyles$d, "bf8611b6", null, null);
655
- function __vue2_injectStyles$d(context) {
656
- for (let o in __cssModules$d) {
657
- this[o] = __cssModules$d[o];
658
- }
659
- }
660
- var CaseTemplateOption = /* @__PURE__ */ function() {
661
- return __component__$d.exports;
662
- }();
663
- var __vue2_script$c = defineComponent({
664
- props: ["value"],
665
- components: {
666
- ASelect: Select,
667
- AOption: Select.Option,
668
- AOptionGroup: Select.OptGroup,
669
- CaseTemplateOption
670
- },
671
- setup(props, { emit }) {
672
- const { templates } = useCaseTemplates();
673
- const customTemplates = computed(() => {
674
- var _a, _b;
675
- return (_b = (_a = templates.value) == null ? void 0 : _a.custom) != null ? _b : [];
676
- });
677
- const galleryTemplates = computed(() => {
678
- var _a, _b;
679
- return (_b = (_a = templates.value) == null ? void 0 : _a.gallery) != null ? _b : [];
680
- });
681
- const allTemplates = computed(() => [
682
- ...customTemplates.value,
683
- ...galleryTemplates.value
684
- ]);
685
- const isMultiple = computed(() => Array.isArray(props.value));
686
- const innerValue = computed(() => {
687
- var _a, _b;
688
- return isMultiple.value ? (_a = props.value) == null ? void 0 : _a.map(prop("id")) : (_b = props.value) == null ? void 0 : _b.id;
689
- });
690
- const onChange = (value) => {
691
- if (Array.isArray(value)) {
692
- const result2 = allTemplates.value.filter((v) => value.includes(v.id));
693
- return emit("update:value", result2);
694
- }
695
- const result = allTemplates.value.find((v) => v.id === value);
696
- emit("update:value", result);
697
- };
698
- const onFilter = (keywords, node) => {
699
- var _a, _b, _c, _d;
700
- return (_d = (_c = (_b = (_a = node.data) == null ? void 0 : _a.attrs) == null ? void 0 : _b.name) == null ? void 0 : _c.toLowerCase()) == null ? void 0 : _d.includes(keywords.toLowerCase());
701
- };
702
- return {
703
- customTemplates,
704
- galleryTemplates,
705
- isMultiple,
706
- innerValue,
707
- onChange,
708
- onFilter
709
- };
710
- }
711
- });
712
- var render$c = function() {
713
- var _vm = this;
714
- var _h = _vm.$createElement;
715
- var _c = _vm._self._c || _h;
716
- return _c("a-select", _vm._b({ staticClass: "min-w-80", attrs: { "allowClear": "", "showSearch": "", "mode": _vm.isMultiple ? "multiple" : "default", "filter-option": _vm.onFilter, "value": _vm.innerValue }, on: { "change": _vm.onChange } }, "a-select", _vm.$attrs, false), [_c("a-option-group", { attrs: { "label": [_vm.$t("message.custom"), _vm.$t("message.templates")].join(" ") } }, _vm._l(_vm.customTemplates, function(v) {
717
- return _c("a-option", { key: v.id, attrs: { "value": v.id, "name": v.templateName } }, [_c("CaseTemplateOption", { attrs: { "source": v } })], 1);
718
- }), 1), _c("a-option-group", { attrs: { "label": [_vm.$t("message.gallery"), _vm.$t("message.templates")].join(" ") } }, _vm._l(_vm.galleryTemplates, function(v) {
719
- return _c("a-option", { key: v.id, attrs: { "value": v.id, "name": v.templateName } }, [_c("CaseTemplateOption", { attrs: { "source": v } })], 1);
720
- }), 1)], 1);
721
- };
722
- var staticRenderFns$c = [];
723
- var index_vue_vue_type_style_index_0_scoped_true_lang$7 = "";
724
- const __cssModules$c = {};
725
- var __component__$c = /* @__PURE__ */ normalizeComponent(__vue2_script$c, render$c, staticRenderFns$c, false, __vue2_injectStyles$c, "149d121e", null, null);
726
- function __vue2_injectStyles$c(context) {
727
- for (let o in __cssModules$c) {
728
- this[o] = __cssModules$c[o];
729
- }
730
- }
731
- var index$3 = /* @__PURE__ */ function() {
732
- return __component__$c.exports;
733
- }();
734
- function __variableDynamicImportRuntime0__(path2) {
735
- switch (path2) {
736
- case "../languages/ar.ts":
737
- return import("./ar.js");
738
- case "../languages/ar2.ts":
739
- return import("./ar2.js");
740
- case "../languages/ar3.ts":
741
- return import("./ar3.js");
742
- case "../languages/ben.ts":
743
- return import("./ben.js");
744
- case "../languages/ben2.ts":
745
- return import("./ben2.js");
746
- case "../languages/ben3.ts":
747
- return import("./ben3.js");
748
- case "../languages/ch.ts":
749
- return import("./ch.js");
750
- case "../languages/ch2.ts":
751
- return import("./ch2.js");
752
- case "../languages/ch3.ts":
753
- return import("./ch3.js");
754
- case "../languages/en.ts":
755
- return import("./en.js");
756
- case "../languages/en2.ts":
757
- return import("./en2.js");
758
- case "../languages/en3.ts":
759
- return import("./en3.js");
760
- case "../languages/es.ts":
761
- return import("./es.js");
762
- case "../languages/es2.ts":
763
- return import("./es2.js");
764
- case "../languages/es3.ts":
765
- return import("./es3.js");
766
- case "../languages/fa.ts":
767
- return import("./fa.js");
768
- case "../languages/fa2.ts":
769
- return import("./fa2.js");
770
- case "../languages/fa3.ts":
771
- return import("./fa3.js");
772
- case "../languages/fr.ts":
773
- return import("./fr.js");
774
- case "../languages/fr2.ts":
775
- return import("./fr2.js");
776
- case "../languages/fr3.ts":
777
- return import("./fr3.js");
778
- case "../languages/hi.ts":
779
- return import("./hi.js");
780
- case "../languages/hi2.ts":
781
- return import("./hi2.js");
782
- case "../languages/hi3.ts":
783
- return import("./hi3.js");
784
- case "../languages/ht.ts":
785
- return import("./ht.js");
786
- case "../languages/ht2.ts":
787
- return import("./ht2.js");
788
- case "../languages/ht3.ts":
789
- return import("./ht3.js");
790
- case "../languages/hy.ts":
791
- return import("./hy.js");
792
- case "../languages/hy2.ts":
793
- return import("./hy2.js");
794
- case "../languages/hy3.ts":
795
- return import("./hy3.js");
796
- case "../languages/jp.ts":
797
- return import("./jp.js");
798
- case "../languages/jp2.ts":
799
- return import("./jp2.js");
800
- case "../languages/jp3.ts":
801
- return import("./jp3.js");
802
- case "../languages/ko.ts":
803
- return import("./ko.js");
804
- case "../languages/ko2.ts":
805
- return import("./ko2.js");
806
- case "../languages/ko3.ts":
807
- return import("./ko3.js");
808
- case "../languages/nep.ts":
809
- return import("./nep.js");
810
- case "../languages/nep2.ts":
811
- return import("./nep2.js");
812
- case "../languages/nep3.ts":
813
- return import("./nep3.js");
814
- case "../languages/pt.ts":
815
- return import("./pt.js");
816
- case "../languages/pt2.ts":
817
- return import("./pt2.js");
818
- case "../languages/pt3.ts":
819
- return import("./pt3.js");
820
- case "../languages/ru.ts":
821
- return import("./ru.js");
822
- case "../languages/ru2.ts":
823
- return import("./ru2.js");
824
- case "../languages/ru3.ts":
825
- return import("./ru3.js");
826
- case "../languages/tr.ts":
827
- return import("./tr.js");
828
- case "../languages/tr2.ts":
829
- return import("./tr2.js");
830
- case "../languages/tr3.ts":
831
- return import("./tr3.js");
832
- default:
833
- return new Promise(function(resolve, reject) {
834
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path2)));
835
- });
836
- }
837
- }
838
- const loaded = new Map();
839
- async function getLanguageMessage(lang) {
840
- if (!loaded.has(lang)) {
841
- const { default: message2 } = await __variableDynamicImportRuntime0__(`../languages/${lang}.ts`);
842
- loaded.set(lang, message2);
843
- }
844
- return loaded.get(lang);
845
- }
846
- const createForm = (form) => form;
847
- var GlueRoleType;
848
- (function(GlueRoleType2) {
849
- GlueRoleType2[GlueRoleType2["USERPROFILE"] = 0] = "USERPROFILE";
850
- GlueRoleType2[GlueRoleType2["CLIENTPROFILE"] = 1] = "CLIENTPROFILE";
851
- GlueRoleType2[GlueRoleType2["PREPARERPROFILE"] = 2] = "PREPARERPROFILE";
852
- })(GlueRoleType || (GlueRoleType = {}));
853
- var g28Company = createForm({
854
- displayName: "G-28-Company",
855
- roles: {
856
- Petitioner: [GlueRoleType.CLIENTPROFILE],
857
- Beneficiary: [GlueRoleType.USERPROFILE],
858
- Preparer: [GlueRoleType.PREPARERPROFILE]
859
- }
860
- });
861
- var g28Person = createForm({
862
- displayName: "G-28-Person",
863
- roles: {
864
- Petitioner: [GlueRoleType.USERPROFILE],
865
- Beneficiary: [GlueRoleType.USERPROFILE],
866
- Preparer: [GlueRoleType.PREPARERPROFILE]
867
- }
868
- });
869
- var g639 = createForm({
870
- displayName: "G-639",
871
- roles: {
872
- Beneficiary: [GlueRoleType.USERPROFILE],
873
- Preparer: [GlueRoleType.PREPARERPROFILE]
874
- }
875
- });
876
- var g1145 = createForm({
877
- displayName: "G-1145",
878
- roles: {
879
- Petitioner: [GlueRoleType.USERPROFILE],
880
- Beneficiary: [GlueRoleType.USERPROFILE],
881
- Preparer: [GlueRoleType.PREPARERPROFILE]
882
- }
883
- });
884
- var g1450 = createForm({
885
- displayName: "G-1450",
886
- roles: {
887
- Beneficiary: [GlueRoleType.USERPROFILE]
888
- }
889
- });
890
- var i129Attachment = createForm({
891
- displayName: "I-129 Attachment",
892
- roles: {
893
- Beneficiary: [GlueRoleType.USERPROFILE]
894
- }
895
- });
896
- var i129TAS = createForm({
897
- displayName: "I-129 Trade Agreement Supplement",
898
- roles: {
899
- Petitioner: [GlueRoleType.CLIENTPROFILE],
900
- Beneficiary: [GlueRoleType.USERPROFILE],
901
- Preparer: [GlueRoleType.PREPARERPROFILE]
902
- }
903
- });
904
- var i129HS = createForm({
905
- displayName: "I-129 with H Supplement-Company Petitioner",
906
- roles: {
907
- Petitioner: [GlueRoleType.CLIENTPROFILE],
908
- Beneficiary: [GlueRoleType.USERPROFILE],
909
- Preparer: [GlueRoleType.PREPARERPROFILE]
910
- }
911
- });
912
- var i130 = createForm({
913
- displayName: "I-130",
914
- roles: {
915
- Petitioner: [GlueRoleType.USERPROFILE],
916
- Beneficiary: [GlueRoleType.USERPROFILE],
917
- Preparer: [GlueRoleType.PREPARERPROFILE]
918
- }
919
- });
920
- var i130A = createForm({
921
- displayName: "I-130A",
922
- roles: {
923
- Beneficiary: [GlueRoleType.USERPROFILE],
924
- Preparer: [GlueRoleType.PREPARERPROFILE]
925
- }
926
- });
927
- var i131 = createForm({
928
- displayName: "I-131",
929
- roles: {
930
- Beneficiary: [GlueRoleType.USERPROFILE],
931
- Preparer: [GlueRoleType.PREPARERPROFILE]
932
- }
933
- });
934
- var i134 = createForm({
935
- displayName: "I-134",
936
- roles: {
937
- Beneficiary: [GlueRoleType.USERPROFILE],
938
- Petitioner: [GlueRoleType.USERPROFILE],
939
- Preparer: [GlueRoleType.PREPARERPROFILE]
940
- }
941
- });
942
- var i192 = createForm({
943
- displayName: "I-192",
944
- roles: {
945
- Beneficiary: [GlueRoleType.USERPROFILE],
946
- Preparer: [GlueRoleType.PREPARERPROFILE]
947
- }
948
- });
949
- var i485 = createForm({
950
- displayName: "I-485",
951
- roles: {
952
- Beneficiary: [GlueRoleType.USERPROFILE],
953
- Preparer: [GlueRoleType.PREPARERPROFILE]
954
- }
955
- });
956
- var i485A = createForm({
957
- displayName: "I-485A",
958
- roles: {
959
- Beneficiary: [GlueRoleType.USERPROFILE],
960
- Preparer: [GlueRoleType.PREPARERPROFILE]
961
- }
962
- });
963
- var i508 = createForm({
964
- displayName: "I-508",
965
- roles: {
966
- Beneficiary: [GlueRoleType.USERPROFILE],
967
- Preparer: [GlueRoleType.PREPARERPROFILE]
968
- }
969
- });
970
- var i539 = createForm({
971
- displayName: "I-539",
972
- roles: {
973
- Beneficiary: [GlueRoleType.USERPROFILE],
974
- Preparer: [GlueRoleType.PREPARERPROFILE]
975
- }
976
- });
977
- var i539A = createForm({
978
- displayName: "I-539A",
979
- roles: {
980
- Beneficiary: [GlueRoleType.USERPROFILE],
981
- Preparer: [GlueRoleType.PREPARERPROFILE]
982
- }
983
- });
984
- var i589 = createForm({
985
- displayName: "I-589",
986
- roles: {
987
- Beneficiary: [GlueRoleType.USERPROFILE],
988
- Preparer: [GlueRoleType.PREPARERPROFILE]
989
- }
990
- });
991
- var i601A = createForm({
992
- displayName: "I-601A",
993
- roles: {
994
- Beneficiary: [GlueRoleType.USERPROFILE],
995
- Preparer: [GlueRoleType.PREPARERPROFILE]
996
- }
997
- });
998
- var i765 = createForm({
999
- displayName: "I-765",
1000
- roles: {
1001
- Beneficiary: [GlueRoleType.USERPROFILE],
1002
- Preparer: [GlueRoleType.PREPARERPROFILE]
1003
- }
1004
- });
1005
- var i864 = createForm({
1006
- displayName: "I-864",
1007
- roles: {
1008
- Petitioner: [GlueRoleType.USERPROFILE],
1009
- Beneficiary: [GlueRoleType.USERPROFILE],
1010
- Preparer: [GlueRoleType.PREPARERPROFILE]
1011
- }
1012
- });
1013
- var i864A = createForm({
1014
- displayName: "I-864A",
1015
- roles: {
1016
- Petitioner: [GlueRoleType.USERPROFILE],
1017
- Beneficiary: [GlueRoleType.USERPROFILE],
1018
- Preparer: [GlueRoleType.PREPARERPROFILE]
1019
- }
1020
- });
1021
- var i864EZ = createForm({
1022
- displayName: "I-864EZ",
1023
- roles: {
1024
- Petitioner: [GlueRoleType.USERPROFILE],
1025
- Beneficiary: [GlueRoleType.USERPROFILE],
1026
- Preparer: [GlueRoleType.PREPARERPROFILE]
1027
- }
1028
- });
1029
- var i864W = createForm({
1030
- displayName: "I-864W",
1031
- roles: {
1032
- Beneficiary: [GlueRoleType.USERPROFILE],
1033
- Preparer: [GlueRoleType.PREPARERPROFILE]
1034
- }
1035
- });
1036
- var i907 = createForm({
1037
- displayName: "I-907",
1038
- roles: {
1039
- Petitioner: [GlueRoleType.CLIENTPROFILE],
1040
- Beneficiary: [GlueRoleType.USERPROFILE],
1041
- Preparer: [GlueRoleType.PREPARERPROFILE]
1042
- }
1043
- });
1044
- var i918 = createForm({
1045
- displayName: "I-918",
1046
- roles: {
1047
- Beneficiary: [GlueRoleType.USERPROFILE],
1048
- Preparer: [GlueRoleType.PREPARERPROFILE]
1049
- }
1050
- });
1051
- var i918A = createForm({
1052
- displayName: "I-918A",
1053
- roles: {
1054
- Petitioner: [GlueRoleType.USERPROFILE],
1055
- Beneficiary: [GlueRoleType.USERPROFILE],
1056
- Preparer: [GlueRoleType.PREPARERPROFILE]
1057
- }
1058
- });
1059
- var i918B = createForm({
1060
- displayName: "I-918B",
1061
- roles: {
1062
- Beneficiary: [GlueRoleType.USERPROFILE]
1063
- }
1064
- });
1065
- const formRecords = {
1066
- g28Company,
1067
- g28Person,
1068
- g639,
1069
- g1145,
1070
- g1450,
1071
- i129Attachment,
1072
- i129TAS,
1073
- i129HS,
1074
- i130,
1075
- i130A,
1076
- i131,
1077
- i134,
1078
- i192,
1079
- i485,
1080
- i485A,
1081
- i508,
1082
- i539,
1083
- i539A,
1084
- i589,
1085
- i601A,
1086
- i765,
1087
- i864,
1088
- i864A,
1089
- i864EZ,
1090
- i864W,
1091
- i907,
1092
- i918,
1093
- i918A,
1094
- i918B
1095
- };
1096
- var index$2 = Object.values(formRecords);
1097
- const acceptableFormats = [
1098
- ".rar",
1099
- ".zip",
1100
- ".doc",
1101
- ".pdf",
1102
- ".docx",
1103
- ".jpg",
1104
- ".jpeg",
1105
- ".png"
1106
- ];
1107
- var __vue2_script$b = defineComponent({
1108
- name: "aFileUploader",
1109
- components: { AntUpload: Upload, AntTag: Tag, AntModal: Modal, AntIcon: Icon },
1110
- props: {
1111
- value: {
1112
- type: Array,
1113
- default: () => []
1114
- },
1115
- uploadFilesFunc: {
1116
- type: Function,
1117
- required: true
1118
- },
1119
- disabled: {
1120
- type: Boolean
1121
- },
1122
- previewMode: {
1123
- type: Boolean,
1124
- default: false
1125
- },
1126
- multipleLineMode: {
1127
- type: Boolean,
1128
- default: false
1129
- }
1130
- },
1131
- setup(props, { emit }) {
1132
- const me = useMe();
1133
- const loading = ref(false);
1134
- const changeVal = (k, v) => {
1135
- emit("change", __spreadProps(__spreadValues({}, props.value), {
1136
- [k]: v
1137
- }));
1138
- };
1139
- const remove = (id) => {
1140
- emit("change", props.value.filter((v) => v.id !== id));
1141
- };
1142
- const beforeUpload = (file, files) => {
1143
- var _a, _b;
1144
- if (loading.value)
1145
- return false;
1146
- loading.value = true;
1147
- props.uploadFilesFunc(files, {
1148
- office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
1149
- user_id: (_b = me.value) == null ? void 0 : _b.id
1150
- }).then((res) => {
1151
- emit("change", [
1152
- ...props.value,
1153
- ...res.map(({ status, value }) => {
1154
- if (status === "fulfilled") {
1155
- return value;
1156
- }
1157
- }).filter((v) => v)
1158
- ]);
1159
- }).finally(() => {
1160
- loading.value = false;
1161
- });
1162
- return false;
1163
- };
1164
- const previewImage = ref();
1165
- const typeOf = (filename) => {
1166
- if (/\.(gif|jpe?g|png)$/i.test(filename)) {
1167
- return "img";
1168
- } else if (/\.docx?$/i.test(filename)) {
1169
- return "doc";
1170
- } else if (/\.pdf$/i.test(filename)) {
1171
- return "pdf";
1172
- }
1173
- return "other";
1174
- };
1175
- const icons = {
1176
- img: "picture",
1177
- pdf: "file-pdf",
1178
- doc: "file-word",
1179
- other: "download"
1180
- };
1181
- const isImage = (file) => typeOf(file.name) === "img";
1182
- const iconOf = (fileName) => icons[typeOf(fileName)];
1183
- const clickItem = (item, event) => {
1184
- if (!isImage(item)) {
1185
- return;
1186
- }
1187
- event.preventDefault();
1188
- previewImage.value = item.link;
1189
- };
1190
- return {
1191
- iconOf,
1192
- previewImage,
1193
- clickItem,
1194
- changeVal,
1195
- remove,
1196
- beforeUpload,
1197
- loading,
1198
- acceptableFormats
1199
- };
1200
- }
1201
- });
1202
- var render$b = function() {
1203
- var _vm = this;
1204
- var _h = _vm.$createElement;
1205
- var _c = _vm._self._c || _h;
1206
- return _c("div", { class: { container: !_vm.previewMode && !_vm.multipleLineMode } }, [_c("ant-modal", { attrs: { "visible": !!_vm.previewImage, "footer": null }, on: { "cancel": function($event) {
1207
- _vm.previewImage = null;
1208
- } } }, [_c("img", { staticStyle: { "width": "100%" }, attrs: { "src": _vm.previewImage } })]), _c("ant-upload", { staticStyle: { "display": "inline" }, attrs: { "multiple": "", "before-upload": _vm.beforeUpload, "disabled": _vm.disabled || _vm.loading, "action": "javascript:;", "fileList": [], "accept": _vm.acceptableFormats.join(",") } }, [!_vm.previewMode ? _c("ant-tag", [_vm._v(" " + _vm._s(_vm.$t("message.selectFile")) + " ")]) : _vm._e(), _vm.value.length ? [_vm.multipleLineMode ? _c("div", _vm._l(_vm.value, function(file) {
1209
- return _c("div", { key: file.id, staticStyle: { "margin-top": "3px" } }, [_c("a", { staticStyle: { "color": "#2D8CF0" }, attrs: { "href": file.link, "target": "_blank" }, on: { "click": function($event) {
1210
- $event.stopPropagation();
1211
- return _vm.clickItem(file, $event);
1212
- } } }, [_vm._v(" " + _vm._s(file.name) + " "), _c("a-icon", { attrs: { "type": _vm.iconOf(file.name) } })], 1), !_vm.disabled ? _c("a-icon", { attrs: { "type": "close" }, on: { "click": function($event) {
1213
- $event.stopPropagation();
1214
- return _vm.remove(file.id);
1215
- } } }) : _vm._e()], 1);
1216
- }), 0) : _c("div", { staticStyle: { "display": "inline-block" } }, _vm._l(_vm.value, function(file) {
1217
- return _c("ant-tag", { key: file.id, attrs: { "closable": !_vm.previewMode && !_vm.disabled }, on: { "close": function($event) {
1218
- return _vm.remove(file.id);
1219
- } } }, [_c("a", { staticStyle: { "color": "#111" }, attrs: { "href": file.link, "target": "_blank" }, on: { "click": function($event) {
1220
- $event.stopPropagation();
1221
- return _vm.clickItem(file, $event);
1222
- } } }, [_vm._v(" " + _vm._s(file.name) + " ")])]);
1223
- }), 1)] : !_vm.previewMode ? _c("span", { class: { block: _vm.multipleLineMode }, staticStyle: { "color": "#ccc" } }, [_vm._v(_vm._s(_vm.acceptableFormats.join(" ")))]) : _vm._e()], 2)], 1);
1224
- };
1225
- var staticRenderFns$b = [];
1226
- var index_vue_vue_type_style_index_0_scoped_true_lang$6 = "";
1227
- const __cssModules$b = {};
1228
- var __component__$b = /* @__PURE__ */ normalizeComponent(__vue2_script$b, render$b, staticRenderFns$b, false, __vue2_injectStyles$b, "1c53738a", null, null);
1229
- function __vue2_injectStyles$b(context) {
1230
- for (let o in __cssModules$b) {
1231
- this[o] = __cssModules$b[o];
1232
- }
1233
- }
1234
- var AFileUploader = /* @__PURE__ */ function() {
1235
- return __component__$b.exports;
1236
- }();
1237
- var AssigneeTypes;
1238
- (function(AssigneeTypes2) {
1239
- AssigneeTypes2[AssigneeTypes2["EMPTY_DEFAULT"] = 4] = "EMPTY_DEFAULT";
1240
- AssigneeTypes2[AssigneeTypes2["BENEFICIARY"] = 1] = "BENEFICIARY";
1241
- AssigneeTypes2[AssigneeTypes2["PETITIONER"] = 2] = "PETITIONER";
1242
- AssigneeTypes2[AssigneeTypes2["ATTORNEY"] = 3] = "ATTORNEY";
1243
- })(AssigneeTypes || (AssigneeTypes = {}));
1244
- var AssigneeTypesText;
1245
- (function(AssigneeTypesText2) {
1246
- AssigneeTypesText2["EMPTY_DEFAULT"] = "message.none";
1247
- AssigneeTypesText2["BENEFICIARY"] = "message.beneficiary";
1248
- AssigneeTypesText2["PETITIONER"] = "message.petitioner";
1249
- AssigneeTypesText2["ATTORNEY"] = "message.attorney";
1250
- })(AssigneeTypesText || (AssigneeTypesText = {}));
1251
- var SortOrder;
1252
- (function(SortOrder2) {
1253
- SortOrder2["default"] = "DEFAULT";
1254
- SortOrder2["desc"] = "DESC";
1255
- SortOrder2["asc"] = "ASC";
1256
- })(SortOrder || (SortOrder = {}));
1257
- var ResponseCode;
1258
- (function(ResponseCode2) {
1259
- ResponseCode2["success"] = "SUCCESS";
1260
- ResponseCode2["failed"] = "FAILED";
1261
- })(ResponseCode || (ResponseCode = {}));
1262
- var __vue2_script$a = defineComponent({
1263
- components: {
1264
- AntTag: Tag
1265
- },
1266
- props: {
1267
- assigneeType: {
1268
- type: String
1269
- }
1270
- },
1271
- setup() {
1272
- const tagColor = (key) => ["cyan", "orange", "blue", "purple"][AssigneeTypes[key]];
1273
- return {
1274
- AssigneeTypesText,
1275
- tagColor
1276
- };
1277
- }
1278
- });
1279
- var render$a = function() {
1280
- var _vm = this;
1281
- var _h = _vm.$createElement;
1282
- var _c = _vm._self._c || _h;
1283
- return _c("ant-tag", { attrs: { "color": _vm.tagColor(_vm.assigneeType || "EMPTY_DEFAULT") } }, [_vm._v(" " + _vm._s(_vm.$t(_vm.AssigneeTypesText[_vm.assigneeType])) + " ")]);
1284
- };
1285
- var staticRenderFns$a = [];
1286
- var index_vue_vue_type_style_index_0_scoped_true_lang$5 = "";
1287
- const __cssModules$a = {};
1288
- var __component__$a = /* @__PURE__ */ normalizeComponent(__vue2_script$a, render$a, staticRenderFns$a, false, __vue2_injectStyles$a, "3f69c61c", null, null);
1289
- function __vue2_injectStyles$a(context) {
1290
- for (let o in __cssModules$a) {
1291
- this[o] = __cssModules$a[o];
1292
- }
1293
- }
1294
- var AssigneeTag = /* @__PURE__ */ function() {
1295
- return __component__$a.exports;
1296
- }();
1297
- var __vue2_script$9 = defineComponent({
1298
- name: "index",
1299
- components: {
1300
- AntTooltip: Tooltip
1301
- },
1302
- props: {
1303
- placement: {
1304
- type: String,
1305
- default: "left"
1306
- },
1307
- tags: {
1308
- type: Array
1309
- },
1310
- maxWidth: {
1311
- type: Number,
1312
- default: 100
1313
- }
1314
- }
1315
- });
1316
- var render$9 = function() {
1317
- var _vm = this;
1318
- var _h = _vm.$createElement;
1319
- var _c = _vm._self._c || _h;
1320
- return _c("ant-tooltip", { attrs: { "placement": _vm.placement, "title": _vm.tags ? _vm.tags.join(", ") : "-" } }, [_c("div", { staticClass: "tags-container", style: "max-width:" + _vm.maxWidth + "px" }, [_c("span", [_vm._v(_vm._s(_vm.tags ? _vm.tags.join(", ") : "-"))])])]);
1321
- };
1322
- var staticRenderFns$9 = [];
1323
- var index_vue_vue_type_style_index_0_scoped_true_lang$4 = "";
1324
- const __cssModules$9 = {};
1325
- var __component__$9 = /* @__PURE__ */ normalizeComponent(__vue2_script$9, render$9, staticRenderFns$9, false, __vue2_injectStyles$9, "18554545", null, null);
1326
- function __vue2_injectStyles$9(context) {
1327
- for (let o in __cssModules$9) {
1328
- this[o] = __cssModules$9[o];
1329
- }
1330
- }
1331
- var TagsWithTooltip = /* @__PURE__ */ function() {
1332
- return __component__$9.exports;
1333
- }();
1334
- var TaskTypes;
1335
- (function(TaskTypes2) {
1336
- TaskTypes2["clientUpload"] = "Client Upload";
1337
- TaskTypes2["clientReview"] = "For Client Review";
1338
- TaskTypes2["worksheet"] = "Worksheet";
1339
- })(TaskTypes || (TaskTypes = {}));
1340
- var StepType;
1341
- (function(StepType2) {
1342
- StepType2["worksheetForEmployeeEmployer"] = "WORKSHEET_FOR_EMPLOYEE_EMPLOYER";
1343
- StepType2["beneficiary"] = "BENEFICIARY";
1344
- StepType2["petitioner"] = "PETITIONER";
1345
- StepType2["billing"] = "BILLING";
1346
- StepType2["overseas"] = "OVERSEAS";
1347
- StepType2["supplement"] = "SUPPLEMENT";
1348
- StepType2["worksheetForAttorney"] = "WORKSHEET_FOR_ATTORNEY";
1349
- StepType2["counterReviewAndSign"] = "COUNTER_REVIEW_AND_SIGN";
1350
- StepType2["attorney"] = "ATTORNEY";
1351
- })(StepType || (StepType = {}));
1352
- var TaskTemplateSortBy;
1353
- (function(TaskTemplateSortBy2) {
1354
- TaskTemplateSortBy2["default"] = "DEFAULT";
1355
- TaskTemplateSortBy2["id"] = "TASKTEMPLATEID";
1356
- TaskTemplateSortBy2["name"] = "TASKNAME";
1357
- TaskTemplateSortBy2["type"] = "TASKTYPE";
1358
- TaskTemplateSortBy2["isEmployee"] = "ISEMPLOYEE";
1359
- })(TaskTemplateSortBy || (TaskTemplateSortBy = {}));
1360
- var useChangeVal = (props, emit) => (k, v) => {
1361
- console.log(k, v);
1362
- emit("update:value", __spreadProps(__spreadValues({}, props.value), {
1363
- [k]: v
1364
- }));
1365
- };
1366
- var refactorParams = (record) => {
1367
- var _a;
1368
- return {
1369
- id: record.id,
1370
- sampleDocList: ((_a = record.sampleDocs) == null ? void 0 : _a.map(({ id }) => id)) || [],
1371
- taskName: record.taskName,
1372
- isEmployee: record.isEmployee || AssigneeTypes[AssigneeTypes.EMPTY_DEFAULT],
1373
- generalTaskType: record.generalTaskType,
1374
- descriptions: record.descriptions,
1375
- tagList: record.tagList
1376
- };
1377
- };
1378
- const roles = [
1379
- {
1380
- id: AssigneeTypes.BENEFICIARY,
1381
- key: "BENEFICIARY",
1382
- i18nKey: "beneficiary"
1383
- },
1384
- {
1385
- id: AssigneeTypes.PETITIONER,
1386
- key: "PETITIONER",
1387
- i18nKey: "petitioner"
1388
- },
1389
- {
1390
- id: AssigneeTypes.ATTORNEY,
1391
- key: "ATTORNEY",
1392
- i18nKey: "attorney"
1393
- },
1394
- {
1395
- id: AssigneeTypes.EMPTY_DEFAULT,
1396
- key: "EMPTY_DEFAULT",
1397
- i18nKey: "none",
1398
- hide: true
1399
- }
1400
- ];
1401
- var __vue2_script$8 = defineComponent({
1402
- name: "index",
1403
- components: {
1404
- AntForm: Form,
1405
- AntFormItem: Form.Item,
1406
- AntRow: Row,
1407
- AntCol: Col,
1408
- AntSelect: Select,
1409
- AntSelectOption: Select.Option,
1410
- AntRadioGroup: Radio.Group,
1411
- AntRadio: Radio,
1412
- AntTextarea: Input.TextArea,
1413
- AntInput: Input,
1414
- AFileUploader
1415
- },
1416
- props: {
1417
- value: {
1418
- type: Object,
1419
- required: true
1420
- },
1421
- uploadFilesFunc: {
1422
- type: Function,
1423
- required: true
1424
- },
1425
- disabled: {
1426
- type: Boolean
1427
- }
1428
- },
1429
- setup(props, { emit }) {
1430
- const nameError = ref(false);
1431
- const typeError = ref(false);
1432
- const nameErrorContent = ref("message.required");
1433
- const changeVal = useChangeVal(props, emit);
1434
- const validFields = (callback) => {
1435
- var _a;
1436
- const data = refactorParams(props.value);
1437
- if (!data.taskName) {
1438
- nameError.value = true;
1439
- nameErrorContent.value = "message.required";
1440
- } else if (((_a = data.taskName) == null ? void 0 : _a.length) > 150) {
1441
- nameError.value = true;
1442
- nameErrorContent.value = "message.moreThan150";
1443
- }
1444
- typeError.value = !data.generalTaskType;
1445
- callback(!nameError.value && !typeError.value, data, {
1446
- nameError,
1447
- typeError
1448
- });
1449
- };
1450
- watch(() => props.value.taskName, (val) => {
1451
- nameError.value = !val;
1452
- });
1453
- const isAttorneySelected = computed(() => props.value.isEmployee === AssigneeTypes[AssigneeTypes.ATTORNEY]);
1454
- watch(() => isAttorneySelected.value, (selected) => {
1455
- if (selected) {
1456
- if (props.value.generalTaskType !== TaskTypes.worksheet) {
1457
- changeVal("generalTaskType", TaskTypes.clientUpload);
1458
- }
1459
- }
1460
- });
1461
- return {
1462
- typeError,
1463
- nameError,
1464
- changeVal,
1465
- validFields,
1466
- TaskTypes,
1467
- roles,
1468
- isAttorneySelected,
1469
- nameErrorContent
1470
- };
1471
- }
1472
- });
1473
- var render$8 = function() {
1474
- var _vm = this;
1475
- var _h = _vm.$createElement;
1476
- var _c = _vm._self._c || _h;
1477
- return _c("ant-form", { staticClass: "add-edit-task-modal", on: { "submit": function(e) {
1478
- return e.preventDefault();
1479
- } } }, [_c("ant-row", { attrs: { "gutter": 20 } }, [_c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "required": "", "name": "taskName", "label": _vm.$t("message.taskName"), "help": _vm.nameError ? _vm.$t(_vm.nameErrorContent) : void 0, "validate-status": _vm.nameError ? "error" : void 0 } }, [_c("ant-input", { attrs: { "disabled": _vm.disabled, "value": _vm.value.taskName }, on: { "input": function($event) {
1480
- return _vm.changeVal("taskName", $event.target.value);
1481
- } } })], 1)], 1), _c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.assignee") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { staticStyle: { "min-width": "170px" }, attrs: { "disabled": _vm.disabled, "value": _vm.value.isEmployee, "allowClear": true }, on: { "change": function($event) {
1482
- return _vm.changeVal("isEmployee", $event);
1483
- } } }, _vm._l(_vm.roles, function(role) {
1484
- return _c("ant-select-option", { key: role.id, attrs: { "value": role.key } }, [_c("span", { staticStyle: { "text-transform": "capitalize" } }, [_vm._v(" " + _vm._s(_vm.$t("message." + role.i18nKey)) + " ")])]);
1485
- }), 1)], 1)], 1)], 1), _c("ant-form-item", { attrs: { "required": "", "label": _vm.$t("message.type"), "help": _vm.typeError ? _vm.$t("message.required") : void 0, "validate-status": _vm.typeError ? "error" : void 0 } }, [_vm.value.generalTaskType !== _vm.TaskTypes.worksheet ? _c("ant-radio-group", { attrs: { "disabled": _vm.disabled, "value": _vm.value.generalTaskType }, on: { "change": function($event) {
1486
- return _vm.changeVal("generalTaskType", $event.target.value);
1487
- } } }, [_c("ant-radio", { attrs: { "value": _vm.TaskTypes.clientUpload } }, [_vm._v(" " + _vm._s(_vm.$t("message.clientUpload")) + " ")]), _c("ant-radio", { attrs: { "value": _vm.TaskTypes.clientReview, "disabled": _vm.isAttorneySelected } }, [_vm._v(" " + _vm._s(_vm.$t("message.clientReview")) + " ")])], 1) : _c("div", [_vm._v(_vm._s(_vm.$t("message.worksheet")))])], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.descriptions") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-textarea", { attrs: { "disabled": _vm.disabled, "value": _vm.value.descriptions }, on: { "input": function($event) {
1488
- return _vm.changeVal("descriptions", $event.target.value);
1489
- } } })], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.attachment") + " (" + _vm.$t("message.optional") + ")" } }, [_c("a-file-uploader", { attrs: { "disabled": _vm.disabled, "value": _vm.value.sampleDocs, "uploadFilesFunc": _vm.uploadFilesFunc }, on: { "change": function($event) {
1490
- return _vm.changeVal("sampleDocs", $event);
1491
- } } })], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.tags") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { attrs: { "disabled": _vm.disabled, "mode": "tags", "value": _vm.value.tagList || [], "options": [] }, on: { "change": function($event) {
1492
- return _vm.changeVal("tagList", $event);
1493
- } } })], 1)], 1);
1494
- };
1495
- var staticRenderFns$8 = [];
1496
- var index_vue_vue_type_style_index_0_scoped_true_lang$3 = "";
1497
- const __cssModules$8 = {};
1498
- var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, render$8, staticRenderFns$8, false, __vue2_injectStyles$8, "55282ee4", null, null);
1499
- function __vue2_injectStyles$8(context) {
1500
- for (let o in __cssModules$8) {
1501
- this[o] = __cssModules$8[o];
1502
- }
1503
- }
1504
- var TaskForm = /* @__PURE__ */ function() {
1505
- return __component__$8.exports;
1506
- }();
1507
- var __vue2_script$7 = defineComponent({
1508
- name: "NewTask",
1509
- components: {
1510
- AFileUploader,
1511
- TaskForm,
1512
- AntModal: Modal,
1513
- AntCheckbox: Checkbox,
1514
- AntButton: Button,
1515
- AntPopconfirm: Popconfirm
1516
- },
1517
- props: {
1518
- visible: {
1519
- type: Boolean,
1520
- default: false
1521
- },
1522
- value: {
1523
- type: Object,
1524
- required: true
1525
- },
1526
- showSendEmail: {
1527
- type: Boolean,
1528
- default: false
1529
- },
1530
- showAddToList: {
1531
- type: Boolean,
1532
- default: false
1533
- },
1534
- uploadFilesFunc: {
1535
- type: Function,
1536
- required: true
1537
- },
1538
- userId: {
1539
- type: String,
1540
- required: true
1541
- },
1542
- lawFirmId: {
1543
- type: Number,
1544
- required: true
1545
- },
1546
- loading: {
1547
- type: Boolean,
1548
- default: false
1549
- },
1550
- hasDoubleConfirm: {
1551
- type: Boolean,
1552
- default: true
1553
- }
1554
- },
1555
- setup(props, { emit }) {
1556
- const taskForm = ref();
1557
- const changeVisible = (visible) => {
1558
- emit("update:visible", visible);
1559
- };
1560
- const nameError = ref(false);
1561
- const typeError = ref(false);
1562
- const changeVal = useChangeVal(props, emit);
1563
- const submit2 = () => {
1564
- taskForm.value.validFields((passed, ts) => {
1565
- if (passed) {
1566
- const data = {
1567
- taskTemplateObj: __spreadProps(__spreadValues({}, ts), {
1568
- taskType: props.value.taskTemplateObj.taskType,
1569
- tagList: ts.tagList || [],
1570
- descriptions: ts.descriptions || ""
1571
- }),
1572
- selfUserId: props.userId,
1573
- selfLawFirmId: props.lawFirmId,
1574
- taskTemplateId: ts.id,
1575
- isAddedToTask: props.value.isAddedToTask || false,
1576
- isNotified: props.value.isNotified || false
1577
- };
1578
- emit("submit", data);
1579
- }
1580
- });
1581
- };
1582
- const updateFormValue = (record) => {
1583
- const data = {
1584
- taskTemplateId: record.id,
1585
- selfUserId: props.userId,
1586
- selfLawFirmId: props.lawFirmId,
1587
- isAddedToTask: props.value.isAddedToTask,
1588
- isNotified: props.value.isNotified,
1589
- taskTemplateObj: __spreadProps(__spreadValues({}, record), {
1590
- isEmployee: record.isEmployee
1591
- })
1592
- };
1593
- emit("update:value", data);
1594
- };
1595
- return {
1596
- submit: submit2,
1597
- taskForm,
1598
- changeVisible,
1599
- changeVal,
1600
- AFileUploader,
1601
- TaskTypes,
1602
- nameError,
1603
- typeError,
1604
- updateFormValue
1605
- };
1606
- }
1607
- });
1608
- var render$7 = function() {
1609
- var _vm = this;
1610
- var _h = _vm.$createElement;
1611
- var _c = _vm._self._c || _h;
1612
- return _c("ant-modal", { attrs: { "id": "venus-component-new-task", "visible": _vm.visible, "title": _vm.value.taskTemplateObj.id ? _vm.$t("message.editTask") : _vm.$t("message.newTask"), "width": "700px" }, on: { "cancel": function($event) {
1613
- return _vm.changeVisible(false);
1614
- } }, scopedSlots: _vm._u([{ key: "footer", fn: function() {
1615
- return [_c("div", { staticClass: "footer" }, [_vm.showSendEmail ? _c("div", { staticStyle: { "float": "left", "padding-top": "5px", "padding-left": "10px" } }, [_c("ant-checkbox", { attrs: { "checked": _vm.value.isNotified }, on: { "change": function($event) {
1616
- return _vm.changeVal("isNotified", $event.target.checked);
1617
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.sendTaskEmail")) + " ")])], 1) : _vm._e(), _c("div", [_vm.hasDoubleConfirm ? _c("ant-popconfirm", { attrs: { "title": _vm.$t("message.updateTaskConfirm"), "placement": "top" }, on: { "confirm": _vm.submit } }, [_c("ant-button", { attrs: { "loading": _vm.loading, "type": "primary" } }, [_vm._v(_vm._s(_vm.$t("message.submit")) + " ")])], 1) : _c("ant-button", { attrs: { "loading": _vm.loading, "type": "primary" }, on: { "click": _vm.submit } }, [_vm._v(_vm._s(_vm.$t("message.submit")) + " ")]), _c("ant-button", { on: { "click": function($event) {
1618
- return _vm.changeVisible(false);
1619
- } } }, [_vm._v(_vm._s(_vm.$t("message.cancel")) + " ")])], 1)])];
1620
- }, proxy: true }]) }, [_c("task-form", { ref: "taskForm", attrs: { "upload-files-func": _vm.uploadFilesFunc, "law-firm-id": _vm.lawFirmId, "user-id": _vm.userId, "value": _vm.value.taskTemplateObj }, on: { "update:value": _vm.updateFormValue } }), _vm.showAddToList ? _c("ant-checkbox", { attrs: { "checked": _vm.value.isAddedToTask }, on: { "change": function($event) {
1621
- return _vm.changeVal("isAddedToTask", $event.target.checked);
1622
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.addToTaskList")) + " ")]) : _vm._e()], 1);
1623
- };
1624
- var staticRenderFns$7 = [];
1625
- var index_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
1626
- const __cssModules$7 = {};
1627
- var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, render$7, staticRenderFns$7, false, __vue2_injectStyles$7, "554f679c", null, null);
1628
- function __vue2_injectStyles$7(context) {
1629
- for (let o in __cssModules$7) {
1630
- this[o] = __cssModules$7[o];
1631
- }
1632
- }
1633
- var NewTask = /* @__PURE__ */ function() {
1634
- return __component__$7.exports;
1635
- }();
1636
- var __vue2_script$6 = defineComponent({
1637
- name: "taskTemplateFilter",
1638
- components: {
1639
- AntInput: Input,
1640
- AntButton: Button,
1641
- AntCheckbox: Checkbox,
1642
- AntCheckboxGroup: Checkbox.Group
1643
- },
1644
- props: {
1645
- conditions: {
1646
- type: Object,
1647
- required: true
1648
- },
1649
- showTaskSettingLink: {
1650
- type: Boolean,
1651
- default: true
1652
- },
1653
- inline: {
1654
- type: Boolean,
1655
- default: false
1656
- },
1657
- width: {
1658
- type: Number,
1659
- default: 300
1660
- },
1661
- showNewBtn: {
1662
- type: Boolean,
1663
- default: true
1664
- }
1665
- },
1666
- setup(props, { emit }) {
1667
- const changeVal = (key, val) => {
1668
- const data = __spreadProps(__spreadValues({}, props.conditions), {
1669
- [key]: val
1670
- });
1671
- if (key === "isEmployee" && val.length === 0) {
1672
- data.isEmployee = [AssigneeTypes.EMPTY_DEFAULT];
1673
- }
1674
- emit("update:conditions", data);
1675
- };
1676
- return {
1677
- AssigneeTypes,
1678
- changeVal
1679
- };
1680
- }
1681
- });
1682
- var render$6 = function() {
1683
- var _vm = this;
1684
- var _h = _vm.$createElement;
1685
- var _c = _vm._self._c || _h;
1686
- return _c("div", { staticClass: "filter mb-5" }, [_c("ant-input", { style: "width:" + _vm.width + "px", attrs: { "value": _vm.conditions.keywords, "placeholder": _vm.$t("message.searchTaskPlaceholder") }, on: { "input": function($event) {
1687
- return _vm.changeVal("keywords", $event.target.value);
1688
- } }, scopedSlots: _vm._u([{ key: "suffix", fn: function() {
1689
- return void 0;
1690
- }, proxy: true }]) }), _vm.showNewBtn ? _c("ant-button", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "margin-left": "20px", "float": "right" }, on: { "click": function($event) {
1691
- return _vm.$emit("update:newTaskVisible", true);
1692
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.newTask")) + " ")]) : _vm._e(), _vm.showTaskSettingLink ? _c("a", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "float": "right", "margin-top": "5px", "color": "dodgerblue !important" }, attrs: { "href": "/task-templates", "target": "_blank" } }, [_vm._v(" " + _vm._s(_vm.$t("message.taskSetting")) + " ")]) : _vm._e(), _c("div", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "margin-top": "20px" } }, [_c("ant-checkbox-group", { attrs: { "value": _vm.conditions.isEmployee }, on: { "change": function($event) {
1693
- return _vm.changeVal("isEmployee", $event);
1694
- } } }, [_c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.ATTORNEY } }, [_vm._v(_vm._s(_vm.$t("message.attorney")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.BENEFICIARY } }, [_vm._v(_vm._s(_vm.$t("message.beneficiary")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.PETITIONER } }, [_vm._v(_vm._s(_vm.$t("message.petitioner")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.EMPTY_DEFAULT } }, [_vm._v(_vm._s(_vm.$t("message.none")) + " ")])], 1)], 1)], 1);
1695
- };
1696
- var staticRenderFns$6 = [];
1697
- var index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
1698
- const __cssModules$6 = {};
1699
- var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, render$6, staticRenderFns$6, false, __vue2_injectStyles$6, "c5d917d8", null, null);
1700
- function __vue2_injectStyles$6(context) {
1701
- for (let o in __cssModules$6) {
1702
- this[o] = __cssModules$6[o];
1703
- }
1704
- }
1705
- var TaskTemplateFilter = /* @__PURE__ */ function() {
1706
- return __component__$6.exports;
1707
- }();
1708
- function useVm() {
1709
- const scope = getCurrentScope();
1710
- return scope.vm;
1711
- }
1712
- function useT() {
1713
- const vm = useVm();
1714
- return (key) => vm.$i18n.t(key);
1715
- }
1716
- var __vue2_script$5 = defineComponent({
1717
- name: "TaskTablePure",
1718
- components: {
1719
- AntTable: Table,
1720
- AntButton: Button,
1721
- AssigneeTag,
1722
- TagsWithTooltip
1723
- },
1724
- props: {
1725
- addedTasks: {
1726
- type: Array,
1727
- required: true
1728
- },
1729
- dataSource: {
1730
- type: Array,
1731
- required: true
1732
- },
1733
- loading: {
1734
- type: Boolean,
1735
- default: false
1736
- },
1737
- pagination: {
1738
- type: Object,
1739
- required: true
1740
- },
1741
- noEdit: {
1742
- type: Boolean,
1743
- default: false
1744
- },
1745
- showEdit: {
1746
- type: Boolean,
1747
- default: true
1748
- }
1749
- },
1750
- setup(props) {
1751
- const { addedTasks } = toRefs(props);
1752
- const t = useT();
1753
- const columns = [
1754
- {
1755
- title: t("message.taskName"),
1756
- dataIndex: "taskName",
1757
- key: "taskName",
1758
- scopedSlots: { customRender: "taskName" }
1759
- },
1760
- {
1761
- title: t("message.assignee"),
1762
- dataIndex: "isEmployee",
1763
- key: "isEmployee",
1764
- width: 120,
1765
- scopedSlots: { customRender: "isEmployee" }
1766
- },
1767
- {
1768
- title: t("message.tag"),
1769
- dataIndex: "tagList",
1770
- key: "tagList",
1771
- width: 120,
1772
- scopedSlots: { customRender: "tagList" }
1773
- },
1774
- {
1775
- title: "Operation",
1776
- dataIndex: "id",
1777
- key: "id",
1778
- width: 210,
1779
- scopedSlots: { customRender: "operation" }
1780
- }
1781
- ];
1782
- const isTemplateAdded = (record) => addedTasks.value.some((added) => added.id === record.id);
1783
- return {
1784
- isTemplateAdded,
1785
- columns
1786
- };
1787
- }
1788
- });
1789
- var render$5 = function() {
1790
- var _vm = this;
1791
- var _h = _vm.$createElement;
1792
- var _c = _vm._self._c || _h;
1793
- return _c("div", [_c("ant-table", { attrs: { "size": "middle", "dataSource": _vm.dataSource, "rowKey": "id", "columns": _vm.columns, "pagination": _vm.pagination, "loading": _vm.loading }, on: { "change": function($event) {
1794
- return _vm.$emit("changePagination", $event);
1795
- } }, scopedSlots: _vm._u([{ key: "isEmployee", fn: function(isEmployee) {
1796
- return _c("span", {}, [_c("assignee-tag", { attrs: { "assignee-type": isEmployee } })], 1);
1797
- } }, { key: "taskName", fn: function(taskName) {
1798
- return _c("span", {}, [_c("span", { staticStyle: { "word-break": "break-word" } }, [_vm._v(_vm._s(taskName))])]);
1799
- } }, { key: "tagList", fn: function(tags) {
1800
- return [_c("tags-with-tooltip", { attrs: { "tags": tags } })];
1801
- } }, { key: "operation", fn: function(_, record) {
1802
- return [record.isGallery ? _c("span", { staticStyle: { "width": "82px", "display": "inline-block", "color": "#999" } }, [_vm._v(" Preset ")]) : _vm.showEdit ? _c("ant-button", { staticClass: "mr-2", attrs: { "disabled": _vm.isTemplateAdded(record), "size": "small" }, on: { "click": function($event) {
1803
- return _vm.$emit("editTask", record);
1804
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.editTask")) + " ")]) : _vm._e(), _vm.isTemplateAdded(record) ? _c("ant-button", { staticStyle: { "width": "70px" }, attrs: { "size": "small", "type": "danger" }, on: { "click": function($event) {
1805
- return _vm.$emit("removeTask", record);
1806
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.remove")) + " ")]) : _c("ant-button", { staticStyle: { "width": "70px" }, attrs: { "size": "small", "type": "primary" }, on: { "click": function($event) {
1807
- return _vm.$emit("addTask", record);
1808
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.add")) + " ")])];
1809
- } }]) })], 1);
1810
- };
1811
- var staticRenderFns$5 = [];
1812
- var TaskTablePure_vue_vue_type_style_index_0_scoped_true_lang = "";
1813
- const __cssModules$5 = {};
1814
- var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$5, staticRenderFns$5, false, __vue2_injectStyles$5, "3272d34e", null, null);
1815
- function __vue2_injectStyles$5(context) {
1816
- for (let o in __cssModules$5) {
1817
- this[o] = __cssModules$5[o];
1818
- }
1819
- }
1820
- var TaskTablePure = /* @__PURE__ */ function() {
1821
- return __component__$5.exports;
1822
- }();
1823
- var useSearchTaskTemplates = (pagination, conditions = ref({}), lawFirmId, withGallery = true) => {
1824
- const startIndex = computed(() => (pagination.value.current - 1) * pagination.value.pageSize);
1825
- const endIndex = computed(() => startIndex.value + pagination.value.pageSize);
1826
- watch(() => conditions.value, () => {
1827
- pagination.value.current = 1;
1828
- pagination.value.total = 0;
1829
- });
1830
- return useQuery(SearchTaskTemplatesQuery, () => ({
1831
- query: {
1832
- includeGallery: withGallery,
1833
- keywords: conditions.value.keywords || "",
1834
- isEmployee: conditions.value.isEmployee,
1835
- taskTemplateId: conditions.value.taskTemplateId,
1836
- sortBy: TaskTemplateSortBy.name,
1837
- sortOrder: SortOrder.asc
1838
- },
1839
- startIndex: startIndex.value,
1840
- endIndex: endIndex.value,
1841
- lawFirmId
1842
- }));
1843
- };
1844
- const taskTemplateFragment = gql`
1845
- fragment taskTemplate on TaskTemplate {
1846
- id
1847
- taskName
1848
- tagList
1849
- isEmployee
1850
- taskType
1851
- generalTaskType
1852
- descriptions
1853
- sampleDocs {
1854
- id
1855
- name
1856
- link
1857
- }
1858
- sampleDocList
1859
- updatedUser{
1860
- id
1861
- name
1862
- }
1863
- updatedOn
1864
- }
1865
- `;
1866
- const SearchTaskTemplatesQuery = gql`
1867
- query taskTemplateSearch(
1868
- $query: TaskTemplateFilterInput!
1869
- $startIndex: Int
1870
- $endIndex: Int
1871
- $lawFirmId: Int!
1872
- ) {
1873
- taskTemplateSearch(query: $query) {
1874
- numResult
1875
- taskTemplateList(startIndex: $startIndex, endIndex: $endIndex) {
1876
- ...taskTemplate
1877
- isGallery(selfLawFirmId: $lawFirmId)
1878
- }
1879
- }
1880
- }
1881
- ${taskTemplateFragment}
1882
- `;
1883
- var useTaskActions = (addedTasks, emit) => {
1884
- const addTask = (record) => emit("update:addedTasks", [...addedTasks.value, record]);
1885
- const editTask = (record) => {
1886
- const taskToAdd = {
1887
- taskTemplateObj: record
1888
- };
1889
- emit("editTask", taskToAdd);
1890
- };
1891
- const removeTask = (record) => emit("update:addedTasks", addedTasks.value.filter(({ id }) => id !== record.id));
1892
- return {
1893
- addTask,
1894
- editTask,
1895
- removeTask
1896
- };
1897
- };
1898
- var useSearchTaskConditions = () => ref({
1899
- keywords: "",
1900
- isEmployee: [
1901
- AssigneeTypes.ATTORNEY,
1902
- AssigneeTypes.PETITIONER,
1903
- AssigneeTypes.BENEFICIARY,
1904
- AssigneeTypes.EMPTY_DEFAULT
1905
- ]
1906
- });
1907
- var useTaskTemplateTableData = (props, emit) => {
1908
- const initialPagination = ref({
1909
- current: 1,
1910
- pageSize: props.pageSize || 10,
1911
- total: 0
1912
- });
1913
- const { conditions = useSearchTaskConditions(), addedTasks = ref([]) } = toRefs(props);
1914
- const { result, loading, variables } = useSearchTaskTemplates(initialPagination, conditions, props.lawFirmId, props.withGallery);
1915
- const dataSource = computed(() => {
1916
- var _a;
1917
- return ((_a = result.value) == null ? void 0 : _a.taskTemplateSearch.taskTemplateList) || [];
1918
- });
1919
- const total = computed(() => {
1920
- var _a;
1921
- return ((_a = result.value) == null ? void 0 : _a.taskTemplateSearch.numResult) || 0;
1922
- });
1923
- const pagination = computed(() => __spreadProps(__spreadValues({}, initialPagination.value), {
1924
- total: total.value
1925
- }));
1926
- const changePagination = (pagination2) => {
1927
- initialPagination.value = __spreadValues({}, pagination2);
1928
- };
1929
- const { addTask, editTask, removeTask } = useTaskActions(addedTasks, emit);
1930
- return {
1931
- addTask,
1932
- editTask,
1933
- removeTask,
1934
- changePagination,
1935
- pagination,
1936
- dataSource,
1937
- result,
1938
- loading,
1939
- conditions,
1940
- addedTasks,
1941
- variables
1942
- };
1943
- };
1944
- var __vue2_script$4 = defineComponent({
1945
- name: "TaskTable",
1946
- components: {
1947
- TaskTablePure
1948
- },
1949
- props: {
1950
- conditions: {
1951
- type: Object,
1952
- required: true
1953
- },
1954
- addedTasks: {
1955
- type: Array,
1956
- default: () => []
1957
- },
1958
- lawFirmId: {
1959
- type: Number,
1960
- required: true
1961
- },
1962
- pageSize: {
1963
- type: Number
1964
- },
1965
- withGallery: {
1966
- type: Boolean,
1967
- default: true
1968
- }
1969
- },
1970
- setup(props, { emit }) {
1971
- const {
1972
- loading,
1973
- dataSource,
1974
- pagination,
1975
- variables,
1976
- changePagination,
1977
- addTask,
1978
- editTask,
1979
- removeTask
1980
- } = useTaskTemplateTableData(props, emit);
1981
- return {
1982
- loading,
1983
- dataSource,
1984
- pagination,
1985
- AssigneeTypesText,
1986
- changePagination,
1987
- addTask,
1988
- editTask,
1989
- removeTask,
1990
- variables
1991
- };
1992
- }
1993
- });
1994
- var render$4 = function() {
1995
- var _vm = this;
1996
- var _h = _vm.$createElement;
1997
- var _c = _vm._self._c || _h;
1998
- return _c("div", [_vm._t("default", function() {
1999
- return [_c("task-table-pure", { attrs: { "loading": _vm.loading, "data-source": _vm.dataSource, "pagination": _vm.pagination, "added-tasks": _vm.addedTasks }, on: { "editTask": _vm.editTask, "addTask": _vm.addTask, "removeTask": _vm.removeTask, "changePagination": _vm.changePagination } })];
2000
- }, { "loading": _vm.loading, "dataSource": _vm.dataSource, "pagination": _vm.pagination, "AssigneeTypesText": _vm.AssigneeTypesText, "changePagination": _vm.changePagination })], 2);
2001
- };
2002
- var staticRenderFns$4 = [];
2003
- var TaskTable_vue_vue_type_style_index_0_scoped_true_lang = "";
2004
- const __cssModules$4 = {};
2005
- var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$4, staticRenderFns$4, false, __vue2_injectStyles$4, "6662fabb", null, null);
2006
- function __vue2_injectStyles$4(context) {
2007
- for (let o in __cssModules$4) {
2008
- this[o] = __cssModules$4[o];
2009
- }
2010
- }
2011
- var TaskTable = /* @__PURE__ */ function() {
2012
- return __component__$4.exports;
2013
- }();
2014
- var __vue2_script$3 = defineComponent({
2015
- name: "MainModal",
2016
- components: {
2017
- TaskTable,
2018
- TaskTemplateFilter,
2019
- AntButton: Button,
2020
- AntBadge: Badge
2021
- },
2022
- props: {
2023
- visible: {
2024
- type: Boolean,
2025
- default: false
2026
- },
2027
- addedTasks: {
2028
- type: Array
2029
- },
2030
- lawFirmId: {
2031
- type: Number,
2032
- required: true
2033
- },
2034
- showTaskSettingLink: {
2035
- type: Boolean,
2036
- default: true
2037
- },
2038
- showPage: {
2039
- type: Boolean,
2040
- default: false
2041
- },
2042
- pageSize: {
2043
- type: Number
2044
- },
2045
- openReviewButtonText: {
2046
- type: String,
2047
- default: "Review and add to template"
2048
- },
2049
- withGallery: {
2050
- type: Boolean,
2051
- default: true
2052
- },
2053
- showNewBtn: {
2054
- type: Boolean,
2055
- default: true
2056
- }
2057
- },
2058
- setup(props, { emit }) {
2059
- const taskTable = ref();
2060
- const conditions = useSearchTaskConditions();
2061
- const currentComponent = shallowRef(props.showPage ? Card : Modal);
2062
- const editAction = (record) => {
2063
- emit("editTask", record);
2064
- };
2065
- const getVariables = () => taskTable.value.variables;
2066
- return {
2067
- editAction,
2068
- getVariables,
2069
- taskTable,
2070
- conditions,
2071
- AssigneeTypes,
2072
- currentComponent
2073
- };
2074
- }
2075
- });
2076
- var render$3 = function() {
2077
- var _vm = this;
2078
- var _h = _vm.$createElement;
2079
- var _c = _vm._self._c || _h;
2080
- return _c(_vm.currentComponent, { tag: "component", staticClass: "task-cart-main-modal", attrs: { "zIndex": 800, "width": 900, "visible": _vm.visible, "title": _vm.showPage ? _vm.$t("message.tasks") : _vm.$t("message.addTask") }, on: { "cancel": function($event) {
2081
- return _vm.$emit("update:visible", false);
2082
- } }, scopedSlots: _vm._u([{ key: "footer", fn: function() {
2083
- return [_c("ant-button", { staticStyle: { "margin-right": "20px" }, on: { "click": function($event) {
2084
- return _vm.$emit("update:visible", false);
2085
- } } }, [_vm._v("Cancel ")]), _c("ant-badge", { attrs: { "count": _vm.addedTasks.length } }, [_c("ant-button", { attrs: { "disabled": _vm.addedTasks.length === 0, "type": "primary" }, on: { "click": function($event) {
2086
- return _vm.$emit("update:reviewModalVisible", true);
2087
- } } }, [_vm._v(" " + _vm._s(_vm.openReviewButtonText) + " ")])], 1)];
2088
- }, proxy: true }]) }, [_c("task-template-filter", { attrs: { "show-task-home-page-link": true, "show-task-setting-link": _vm.showTaskSettingLink, "conditions": _vm.conditions, "inline": !!_vm.showPage, "show-new-btn": _vm.showNewBtn }, on: { "update:conditions": function($event) {
2089
- _vm.conditions = $event;
2090
- }, "update:newTaskVisible": function($event) {
2091
- return _vm.$emit("update:newTaskVisible", true);
2092
- } } }), _c("task-table", { ref: "taskTable", attrs: { "conditions": _vm.conditions, "added-tasks": _vm.addedTasks, "law-firm-id": _vm.lawFirmId, "page-size": _vm.pageSize, "with-gallery": _vm.withGallery }, on: { "update:addedTasks": function($event) {
2093
- return _vm.$emit("update:addedTasks", $event);
2094
- }, "editTask": function($event) {
2095
- return _vm.$emit("editTask", $event);
2096
- } }, scopedSlots: _vm._u([{ key: "default", fn: function(ref2) {
2097
- var loading = ref2.loading;
2098
- var dataSource = ref2.dataSource;
2099
- var pagination = ref2.pagination;
2100
- var changePagination = ref2.changePagination;
2101
- return [_vm._t("default", null, { "editAction": _vm.editAction, "loading": loading, "dataSource": dataSource, "pagination": pagination, "changePagination": changePagination })];
2102
- } }], null, true) })], 1);
2103
- };
2104
- var staticRenderFns$3 = [];
2105
- var MainModal_vue_vue_type_style_index_0_scoped_true_lang = "";
2106
- const __cssModules$3 = {};
2107
- var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, "68bc0589", null, null);
2108
- function __vue2_injectStyles$3(context) {
2109
- for (let o in __cssModules$3) {
2110
- this[o] = __cssModules$3[o];
2111
- }
2112
- }
2113
- var MainModal = /* @__PURE__ */ function() {
2114
- return __component__$3.exports;
2115
- }();
2116
- var __vue2_script$2 = defineComponent({
2117
- name: "ReviewModal",
2118
- components: {
2119
- TaskTablePure,
2120
- AntModal: Modal,
2121
- AntCheckbox: Checkbox,
2122
- AntButton: Button
2123
- },
2124
- props: {
2125
- visible: {
2126
- type: Boolean,
2127
- default: false
2128
- },
2129
- addedTasks: {
2130
- type: Array,
2131
- default: () => []
2132
- },
2133
- reviewText: {
2134
- type: String,
2135
- required: true
2136
- },
2137
- sendEmail: {
2138
- type: Boolean,
2139
- default: false
2140
- },
2141
- showSendEmail: {
2142
- type: Boolean,
2143
- default: false
2144
- },
2145
- allowClear: {
2146
- type: Boolean,
2147
- default: false
2148
- },
2149
- adding: {
2150
- type: Boolean,
2151
- default: false
2152
- }
2153
- },
2154
- setup(props, { emit }) {
2155
- const { addedTasks } = toRefs(props);
2156
- const pagination = ref({
2157
- total: addedTasks.value.length,
2158
- current: 1,
2159
- pageSize: 10
2160
- });
2161
- const changePagination = (newPagination) => {
2162
- pagination.value = newPagination;
2163
- };
2164
- const { addTask, editTask, removeTask } = useTaskActions(addedTasks, emit);
2165
- return {
2166
- addTask,
2167
- editTask,
2168
- removeTask,
2169
- pagination,
2170
- changePagination
2171
- };
2172
- }
2173
- });
2174
- var render$2 = function() {
2175
- var _vm = this;
2176
- var _h = _vm.$createElement;
2177
- var _c = _vm._self._c || _h;
2178
- return _c("ant-modal", { attrs: { "zIndex": 900, "width": "900px", "visible": _vm.visible, "title": _vm.$t("message.reviewTasksTitle") }, on: { "cancel": function($event) {
2179
- return _vm.$emit("update:visible", false);
2180
- } } }, [_c("task-table-pure", { attrs: { "show-edit": false, "loading": false, "no-edit": true, "data-source": _vm.addedTasks, "pagination": _vm.pagination, "added-tasks": _vm.addedTasks }, on: { "removeTask": _vm.removeTask, "changePagination": _vm.changePagination } }), _c("div", { attrs: { "slot": "footer" }, slot: "footer" }, [_vm.showSendEmail ? _c("ant-checkbox", { staticStyle: { "float": "left" }, attrs: { "checked": _vm.sendEmail }, on: { "change": function($event) {
2181
- return _vm.$emit("update:sendEmail", $event.target.checked);
2182
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.sendTaskEmail")) + " ")]) : _vm._e(), _c("ant-button", { on: { "click": function($event) {
2183
- return _vm.$emit("update:visible", false);
2184
- } } }, [_vm._v(" " + _vm._s(_vm.$t("message.cancel")) + " ")]), _c("ant-button", { attrs: { "loading": _vm.adding, "type": "primary", "disabled": !_vm.addedTasks.length }, on: { "click": function($event) {
2185
- _vm.$emit("submit", {
2186
- addedTasks: _vm.addedTasks,
2187
- addedTaskIds: _vm.addedTasks.map(function(ref2) {
2188
- var id = ref2.id;
2189
- return id;
2190
- }),
2191
- sendEmail: _vm.sendEmail
2192
- });
2193
- } } }, [_vm._v(" " + _vm._s(_vm.reviewText + "(" + _vm.addedTasks.length + ")") + " ")])], 1)], 1);
2194
- };
2195
- var staticRenderFns$2 = [];
2196
- var ReviewModal_vue_vue_type_style_index_0_scoped_true_lang = "";
2197
- const __cssModules$2 = {};
2198
- var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, "315dcb1d", null, null);
2199
- function __vue2_injectStyles$2(context) {
2200
- for (let o in __cssModules$2) {
2201
- this[o] = __cssModules$2[o];
2202
- }
2203
- }
2204
- var ReviewModal = /* @__PURE__ */ function() {
2205
- return __component__$2.exports;
2206
- }();
2207
- const useMutateTaskTemplate = () => useMutation(UpdateTaskTemplateMutation);
2208
- const useCreateTaskTemplate = () => useMutation(CreateTaskTemplateMutation);
2209
- const submit = async (record, updateTemplate, createTemplate) => {
2210
- var _a, _b, _c, _d;
2211
- let newRecord = {};
2212
- let res;
2213
- let success;
2214
- const isUpdate = !!record.taskTemplateId;
2215
- if (isUpdate) {
2216
- res = await updateTemplate.mutate(record);
2217
- newRecord = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.updateTaskTemplate.updatedTaskTemplate) || {};
2218
- success = ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.updateTaskTemplate.code) === ResponseCode.success;
2219
- } else {
2220
- res = await createTemplate.mutate(record);
2221
- newRecord = ((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.createTaskTemplate.newTaskTemplate) || {};
2222
- success = ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.createTaskTemplate.code) === ResponseCode.success;
2223
- }
2224
- if (success) {
2225
- message.success("Success!");
2226
- } else {
2227
- message.error("Failed!");
2228
- }
2229
- return {
2230
- isUpdate,
2231
- newRecord,
2232
- success
2233
- };
2234
- };
2235
- const UpdateTaskTemplateMutation = gql`
2236
- mutation updateTaskTemplate(
2237
- $selfUserId: Int!
2238
- $selfLawFirmId: Int!
2239
- $taskTemplateObj: TaskTemplateInput!
2240
- $taskTemplateId: Int!
2241
- ) {
2242
- updateTaskTemplate(
2243
- selfUserId: $selfUserId
2244
- selfLawFirmId: $selfLawFirmId
2245
- taskTemplateObj: $taskTemplateObj
2246
- taskTemplateId: $taskTemplateId
2247
- ) {
2248
- code
2249
- message
2250
- updatedTaskTemplate {
2251
- ...taskTemplate
2252
- }
2253
- }
2254
- }
2255
- ${taskTemplateFragment}
2256
- `;
2257
- const CreateTaskTemplateMutation = gql`
2258
- mutation createTaskTemplate(
2259
- $selfUserId: Int!
2260
- $selfLawFirmId: Int!
2261
- $taskTemplateObj: TaskTemplateInput!
2262
- ) {
2263
- createTaskTemplate(
2264
- selfUserId: $selfUserId
2265
- selfLawFirmId: $selfLawFirmId
2266
- taskTemplateObj: $taskTemplateObj
2267
- ) {
2268
- code
2269
- message
2270
- newTaskTemplate {
2271
- ...taskTemplate
2272
- }
2273
- }
2274
- }
2275
- ${taskTemplateFragment}
2276
- `;
2277
- const defaultTaskTemplate = {
2278
- taskTemplateObj: {
2279
- generalTaskType: TaskTypes.clientUpload
2280
- },
2281
- isAddedToTask: false,
2282
- isNotified: false
2283
- };
2284
- var __vue2_script$1 = defineComponent({
2285
- name: "index",
2286
- components: {
2287
- NewTask,
2288
- MainModal,
2289
- ReviewModal
2290
- },
2291
- props: {
2292
- uploadFilesFunc: {
2293
- type: Function,
2294
- required: true
2295
- },
2296
- visible: {
2297
- type: Boolean,
2298
- default: false
2299
- },
2300
- value: {
2301
- type: Array,
2302
- default: () => []
2303
- },
2304
- reviewText: {
2305
- type: String,
2306
- default: "Add"
2307
- },
2308
- openReviewButtonText: {
2309
- type: String,
2310
- default: "Review and add to template"
2311
- },
2312
- showSendEmail: {
2313
- type: Boolean,
2314
- default: false
2315
- },
2316
- sendEmail: {
2317
- type: Boolean,
2318
- default: false
2319
- },
2320
- showTaskSettingLink: {
2321
- type: Boolean,
2322
- default: true
2323
- },
2324
- allowClear: {
2325
- type: Boolean,
2326
- default: false
2327
- },
2328
- pageMode: {
2329
- type: Boolean,
2330
- default: false
2331
- },
2332
- pageSize: {
2333
- type: Number
2334
- },
2335
- closeAfterAdd: {
2336
- type: Boolean,
2337
- default: true
2338
- },
2339
- adding: {
2340
- type: Boolean,
2341
- default: false
2342
- },
2343
- withGallery: {
2344
- type: Boolean,
2345
- default: true
2346
- },
2347
- showNewBtn: {
2348
- type: Boolean,
2349
- default: true
2350
- }
2351
- },
2352
- setup(props, { emit }) {
2353
- const { client } = useApolloClient();
2354
- const mainModal = ref();
2355
- const reviewModal = ref();
2356
- const newTaskVisible = ref(false);
2357
- const reviewModalVisible = ref(false);
2358
- const tempTask = ref(defaultTaskTemplate);
2359
- const updateTemplate = useMutateTaskTemplate();
2360
- const createTemplate = useCreateTaskTemplate();
2361
- const addedTasks = ref([]);
2362
- const me = useMe();
2363
- const userId = computed(() => {
2364
- var _a;
2365
- return (_a = me.value) == null ? void 0 : _a.id;
2366
- });
2367
- const lawFirmId = computed(() => {
2368
- var _a;
2369
- return (_a = me.value) == null ? void 0 : _a.lawFirmId;
2370
- });
2371
- watch(() => newTaskVisible.value, (visible) => {
2372
- if (!visible) {
2373
- tempTask.value = defaultTaskTemplate;
2374
- }
2375
- });
2376
- watch(() => props.visible, (visible) => {
2377
- if (!visible) {
2378
- addedTasks.value = [];
2379
- emit("update:value", []);
2380
- }
2381
- });
2382
- const updateReviewModalContent = (record, newRecord) => {
2383
- if (addedTasks.value.some(({ id }) => id === newRecord.id)) {
2384
- const newValue = addedTasks.value.map((originTask) => {
2385
- if (originTask.id === record.taskTemplateId) {
2386
- return newRecord;
2387
- }
2388
- return originTask;
2389
- });
2390
- emit("update:value", newValue.map(({ id }) => id));
2391
- } else {
2392
- newRecord.id !== record.taskTemplateId && addedTasks.value.push(newRecord);
2393
- emit("update:value", [...addedTasks.value.map(({ id }) => id), newRecord.id]);
2394
- }
2395
- };
2396
- const writeQuery = (id, newRecord, isUpdate = true) => {
2397
- const variables = mainModal.value.getVariables();
2398
- const existed = client.readQuery({
2399
- query: SearchTaskTemplatesQuery,
2400
- variables
2401
- });
2402
- const newTasks = isUpdate ? existed.taskTemplateSearch.taskTemplateList.map((record) => {
2403
- if (record.id === id) {
2404
- return newRecord && __spreadProps(__spreadValues({}, newRecord), {
2405
- isGallery: record.isGallery
2406
- });
2407
- }
2408
- return record;
2409
- }).filter((record) => !!record) : [
2410
- __spreadProps(__spreadValues({}, newRecord), { isGallery: false }),
2411
- ...existed.taskTemplateSearch.taskTemplateList
2412
- ];
2413
- client.writeQuery({
2414
- query: SearchTaskTemplatesQuery,
2415
- data: {
2416
- taskTemplateSearch: __spreadProps(__spreadValues({}, existed.taskTemplateSearch), {
2417
- taskTemplateList: newTasks
2418
- })
2419
- },
2420
- variables
2421
- });
2422
- };
2423
- const _submit = async (record) => {
2424
- const { newRecord, success, isUpdate } = await submit(record, updateTemplate, createTemplate);
2425
- if (success) {
2426
- writeQuery(record.taskTemplateId, newRecord, isUpdate);
2427
- newTaskVisible.value = false;
2428
- updateReviewModalContent(record, newRecord);
2429
- emit("task-added", newRecord);
2430
- }
2431
- };
2432
- const submitting = computed(() => updateTemplate.loading.value || createTemplate.loading.value);
2433
- const endReviewing = (result) => {
2434
- emit("submit", result);
2435
- if (props.closeAfterAdd) {
2436
- reviewModalVisible.value = false;
2437
- newTaskVisible.value = false;
2438
- }
2439
- };
2440
- const editTask = (record) => {
2441
- newTaskVisible.value = true;
2442
- tempTask.value = __spreadValues({}, record);
2443
- };
2444
- return {
2445
- mainModal,
2446
- reviewModal,
2447
- newTaskVisible,
2448
- tempTask,
2449
- reviewModalVisible,
2450
- submitting,
2451
- addedTasks,
2452
- userId,
2453
- lawFirmId,
2454
- writeQuery,
2455
- editTask,
2456
- _submit,
2457
- endReviewing
2458
- };
2459
- }
2460
- });
2461
- var render$1 = function() {
2462
- var _vm = this;
2463
- var _h = _vm.$createElement;
2464
- var _c = _vm._self._c || _h;
2465
- return _vm.lawFirmId != null ? _c("div", { attrs: { "id": "venus-component-task-cart" } }, [_c("main-modal", { ref: "mainModal", attrs: { "visible": _vm.visible, "show-page": _vm.pageMode, "page-size": _vm.pageSize, "law-firm-id": _vm.lawFirmId, "tempTask": _vm.tempTask, "show-new-btn": _vm.showNewBtn, "with-gallery": _vm.withGallery, "added-tasks": _vm.addedTasks, "newTaskVisible": _vm.newTaskVisible, "show-task-setting-link": _vm.showTaskSettingLink, "reviewModalVisible": _vm.reviewModalVisible, "open-review-button-text": _vm.openReviewButtonText }, on: { "update:tempTask": function($event) {
2466
- _vm.tempTask = $event;
2467
- }, "update:temp-task": function($event) {
2468
- _vm.tempTask = $event;
2469
- }, "update:addedTasks": function($event) {
2470
- _vm.addedTasks = $event;
2471
- }, "update:added-tasks": function($event) {
2472
- _vm.addedTasks = $event;
2473
- }, "update:newTaskVisible": function($event) {
2474
- _vm.newTaskVisible = $event;
2475
- }, "update:new-task-visible": function($event) {
2476
- _vm.newTaskVisible = $event;
2477
- }, "update:reviewModalVisible": function($event) {
2478
- _vm.reviewModalVisible = $event;
2479
- }, "update:review-modal-visible": function($event) {
2480
- _vm.reviewModalVisible = $event;
2481
- }, "editTask": _vm.editTask, "update:visible": function($event) {
2482
- return _vm.$emit("update:visible", $event);
2483
- } }, scopedSlots: _vm._u([{ key: "default", fn: function(ref2) {
2484
- var loading = ref2.loading;
2485
- var dataSource = ref2.dataSource;
2486
- var pagination = ref2.pagination;
2487
- var changePagination = ref2.changePagination;
2488
- return [_vm._t("table", null, { "loading": loading, "dataSource": dataSource, "pagination": pagination, "changePagination": changePagination })];
2489
- } }], null, true) }), _c("review-modal", { ref: "reviewModal", attrs: { "adding": _vm.adding, "sendEmail": _vm.sendEmail, "allow-clear": _vm.allowClear, "tempTask": _vm.tempTask, "review-text": _vm.reviewText, "added-tasks": _vm.addedTasks, "showSendEmail": _vm.showSendEmail, "visible": _vm.reviewModalVisible, "newTaskVisible": _vm.newTaskVisible }, on: { "update:tempTask": function($event) {
2490
- _vm.tempTask = $event;
2491
- }, "update:temp-task": function($event) {
2492
- _vm.tempTask = $event;
2493
- }, "update:addedTasks": function($event) {
2494
- _vm.addedTasks = $event;
2495
- }, "update:added-tasks": function($event) {
2496
- _vm.addedTasks = $event;
2497
- }, "update:visible": function($event) {
2498
- _vm.reviewModalVisible = $event;
2499
- }, "update:newTaskVisible": function($event) {
2500
- _vm.newTaskVisible = $event;
2501
- }, "update:new-task-visible": function($event) {
2502
- _vm.newTaskVisible = $event;
2503
- }, "submit": _vm.endReviewing, "update:sendEmail": function($event) {
2504
- return _vm.$emit("update:sendEmail", $event);
2505
- } } }), _c("new-task", { attrs: { "user-id": _vm.userId, "loading": _vm.submitting, "value": _vm.tempTask, "law-firm-id": _vm.lawFirmId, "visible": _vm.newTaskVisible, "upload-files-func": _vm.uploadFilesFunc, "has-double-confirm": !!_vm.tempTask.taskTemplateObj.id }, on: { "update:value": function($event) {
2506
- _vm.tempTask = $event;
2507
- }, "update:visible": function($event) {
2508
- _vm.newTaskVisible = $event;
2509
- }, "submit": _vm._submit } })], 1) : _vm._e();
2510
- };
2511
- var staticRenderFns$1 = [];
2512
- var index_vue_vue_type_style_index_0_scoped_true_lang = "";
2513
- const __cssModules$1 = {};
2514
- var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, "466cfa4a", null, null);
2515
- function __vue2_injectStyles$1(context) {
2516
- for (let o in __cssModules$1) {
2517
- this[o] = __cssModules$1[o];
2518
- }
2519
- }
2520
- var index$1 = /* @__PURE__ */ function() {
2521
- return __component__$1.exports;
2522
- }();
2523
- var __vue2_script = defineComponent({
2524
- setup() {
2525
- const notBoolean = ref(123);
2526
- const test = ref(false);
2527
- const isDisabled = computed(() => test.value);
2528
- return {
2529
- isDisabled,
2530
- notBoolean,
2531
- test
2532
- };
2533
- }
2534
- });
2535
- var render = function() {
2536
- var _vm = this;
2537
- var _h = _vm.$createElement;
2538
- var _c = _vm._self._c || _h;
2539
- return _c("div", [_c("a-radio", { attrs: { "disabled": _vm.isDisabled } }), _c("h1", [_vm._v(_vm._s(_vm.isDisabled))]), _c("h1", [_vm._v(_vm._s(_vm.test))]), _c("h1", [_vm._v(_vm._s(_vm.notBoolean))])], 1);
2540
- };
2541
- var staticRenderFns = [];
2542
- const __cssModules = {};
2543
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
2544
- function __vue2_injectStyles(context) {
2545
- for (let o in __cssModules) {
2546
- this[o] = __cssModules[o];
2547
- }
2548
- }
2549
- var index = /* @__PURE__ */ function() {
2550
- return __component__.exports;
2551
- }();
2552
- export { AFileUploader, AssigneeTag, index$3 as CaseTemplateSelect, CaseTemplateTypeBadge, GlueRoleType, NewTask, index$4 as ProfileSelect, TagsWithTooltip, index$1 as TaskCart, TaskForm, TaskTable, TaskTemplateFilter, index as TestComponent, formRecords, index$2 as forms, getLanguageMessage, refactorParams as refactorTaskTemplateParams, submit as submitTaskTemplate, useCreateTaskTemplate, useMutateTaskTemplate, useSearchTaskConditions, useSearchTaskTemplates };