@ailaw/venus 0.3.18 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/venus.es.js CHANGED
@@ -17,12 +17,11 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, ref as ref$1, watch, computed, toRefs as toRefs$1, shallowRef } from "vue-demi";
20
+ import { defineComponent, ref, watch, computed, toRefs, getCurrentScope, shallowRef } from "vue-demi";
21
21
  import { Select, Modal, Form, Input, Checkbox, Divider, Button, Tag, Tooltip, Upload, Row, Col, Radio, Table, Badge, Card, message } from "ant-design-vue";
22
22
  import { useQuery, useResult, useMutation, useApolloClient } from "@vue/apollo-composable";
23
23
  import gql from "graphql-tag";
24
24
  import { path, uniqBy, prop } from "ramda";
25
- import "vue";
26
25
  var index$4 = "";
27
26
  function __variableDynamicImportRuntime0__$1(path2) {
28
27
  switch (path2) {
@@ -46,7 +45,7 @@ var __vue2_script$h = defineComponent({
46
45
  }
47
46
  },
48
47
  setup(props) {
49
- const iconUrl = ref$1();
48
+ const iconUrl = ref();
50
49
  watch(() => props.type, (value) => {
51
50
  let iconName = "";
52
51
  switch (value) {
@@ -168,7 +167,9 @@ const meQuery = gql`
168
167
  }
169
168
  `;
170
169
  function useMe() {
171
- const { result } = useQuery(meQuery);
170
+ const { result } = useQuery(meQuery, void 0, {
171
+ fetchPolicy: "cache-first"
172
+ });
172
173
  return useResult(result);
173
174
  }
174
175
  const profilesQuery = gql`
@@ -289,8 +290,8 @@ var __vue2_script$e = defineComponent({
289
290
  Checkbox
290
291
  },
291
292
  setup(_, { emit }) {
292
- const value = ref$1({});
293
- const shouldSendPassword = ref$1(false);
293
+ const value = ref({});
294
+ const shouldSendPassword = ref(false);
294
295
  const canSubmit = computed(() => value.value.profileName && value.value.profileType);
295
296
  const rules = {
296
297
  profileType: { required: true },
@@ -445,11 +446,11 @@ var __vue2_script$c = defineComponent({
445
446
  }
446
447
  },
447
448
  setup(props, { emit }) {
448
- const keywords = ref$1("");
449
+ const keywords = ref("");
449
450
  const handleSearch = (value) => keywords.value = value;
450
- const { onlyRole, profileIds } = toRefs$1(props);
451
+ const { onlyRole, profileIds } = toRefs(props);
451
452
  const { profiles: rawProfiles } = useProfiles(keywords, onlyRole, profileIds);
452
- const createdProfile = ref$1();
453
+ const createdProfile = ref();
453
454
  const profiles = computed(() => {
454
455
  const list = [
455
456
  ...props.preLoaded,
@@ -457,7 +458,7 @@ var __vue2_script$c = defineComponent({
457
458
  ];
458
459
  return uniqBy(prop("id"), list);
459
460
  });
460
- const isModalVisible = ref$1(false);
461
+ const isModalVisible = ref(false);
461
462
  const toggleModal = (value) => isModalVisible.value = value;
462
463
  const updateValue = (value) => emit("input", value);
463
464
  const handleProfileCreated = (profile) => {
@@ -766,7 +767,7 @@ function __vue2_injectStyles$b(context) {
766
767
  var AssigneeTag = /* @__PURE__ */ function() {
767
768
  return __component__$b.exports;
768
769
  }();
769
- var __vue2_script$a = {
770
+ var __vue2_script$a = defineComponent({
770
771
  name: "index",
771
772
  components: {
772
773
  AntTooltip: Tooltip
@@ -784,7 +785,7 @@ var __vue2_script$a = {
784
785
  default: 100
785
786
  }
786
787
  }
787
- };
788
+ });
788
789
  var render$a = function() {
789
790
  var _vm = this;
790
791
  var _h = _vm.$createElement;
@@ -794,7 +795,7 @@ var render$a = function() {
794
795
  var staticRenderFns$a = [];
795
796
  var index_vue_vue_type_style_index_0_scoped_true_lang$4 = "";
796
797
  const __cssModules$a = {};
797
- var __component__$a = /* @__PURE__ */ normalizeComponent(__vue2_script$a, render$a, staticRenderFns$a, false, __vue2_injectStyles$a, "c4729600", null, null);
798
+ var __component__$a = /* @__PURE__ */ normalizeComponent(__vue2_script$a, render$a, staticRenderFns$a, false, __vue2_injectStyles$a, "18554545", null, null);
798
799
  function __vue2_injectStyles$a(context) {
799
800
  for (let o in __cssModules$a) {
800
801
  this[o] = __cssModules$a[o];
@@ -822,6 +823,16 @@ var useChangeVal = (props, emit) => (k, v) => {
822
823
  [k]: v
823
824
  }));
824
825
  };
826
+ const acceptableFormats = [
827
+ ".rar",
828
+ ".zip",
829
+ ".doc",
830
+ ".pdf",
831
+ ".docx",
832
+ ".jpg",
833
+ ".jpeg",
834
+ ".png"
835
+ ];
825
836
  var __vue2_script$9 = defineComponent({
826
837
  name: "aFileUploader",
827
838
  components: { AntUpload: Upload, AntTag: Tag },
@@ -833,10 +844,14 @@ var __vue2_script$9 = defineComponent({
833
844
  uploadFilesFunc: {
834
845
  type: Function,
835
846
  required: true
847
+ },
848
+ disabled: {
849
+ type: Boolean
836
850
  }
837
851
  },
838
852
  setup(props, { emit }) {
839
- const loading = ref$1(false);
853
+ const me = useMe();
854
+ const loading = ref(false);
840
855
  const changeVal = (k, v) => {
841
856
  emit("change", __spreadProps(__spreadValues({}, props.value), {
842
857
  [k]: v
@@ -846,10 +861,14 @@ var __vue2_script$9 = defineComponent({
846
861
  emit("change", props.value.filter((v) => v.id !== id));
847
862
  };
848
863
  const beforeUpload = (file) => {
864
+ var _a, _b;
849
865
  if (loading.value)
850
866
  return false;
851
867
  loading.value = true;
852
- props.uploadFilesFunc([file]).then(([
868
+ props.uploadFilesFunc([file], {
869
+ office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
870
+ user_id: (_b = me.value) == null ? void 0 : _b.id
871
+ }).then(([
853
872
  {
854
873
  status,
855
874
  value: { id, name, link }
@@ -876,16 +895,7 @@ var __vue2_script$9 = defineComponent({
876
895
  remove,
877
896
  beforeUpload,
878
897
  loading,
879
- allowFiles: [
880
- ".rar",
881
- ".zip",
882
- ".doc",
883
- ".pdf",
884
- ".docx",
885
- ".jpg",
886
- ".jpeg",
887
- ".png"
888
- ]
898
+ acceptableFormats
889
899
  };
890
900
  }
891
901
  });
@@ -893,16 +903,16 @@ var render$9 = function() {
893
903
  var _vm = this;
894
904
  var _h = _vm.$createElement;
895
905
  var _c = _vm._self._c || _h;
896
- return _c("div", { staticClass: "container" }, [_c("ant-upload", { staticStyle: { "display": "inline" }, attrs: { "disabled": _vm.loading, "before-upload": _vm.beforeUpload, "action": "javascript:;", "fileList": [] } }, [_c("ant-tag", [_vm._v(" " + _vm._s(_vm.$t("message.selectFile")) + " ")]), _vm.value.length ? _c("div", { staticStyle: { "display": "inline-block" } }, _vm._l(_vm.value, function(file) {
906
+ return _c("div", { staticClass: "container" }, [_c("ant-upload", { staticStyle: { "display": "inline" }, attrs: { "disabled": _vm.disabled || _vm.loading, "before-upload": _vm.beforeUpload, "action": "javascript:;", "fileList": [], "accept": _vm.acceptableFormats.join(",") } }, [_c("ant-tag", [_vm._v(" " + _vm._s(_vm.$t("message.selectFile")) + " ")]), _vm.value.length ? _c("div", { staticStyle: { "display": "inline-block" } }, _vm._l(_vm.value, function(file) {
897
907
  return _c("ant-tag", { key: file.id, attrs: { "closable": "" }, on: { "close": function($event) {
898
908
  return _vm.remove(file.id);
899
909
  } } }, [_vm._v(_vm._s(file.name) + " ")]);
900
- }), 1) : _c("span", { staticStyle: { "color": "#ccc" } }, [_vm._v(_vm._s(_vm.allowFiles.join(" ")))])], 1)], 1);
910
+ }), 1) : _c("span", { staticStyle: { "color": "#ccc" } }, [_vm._v(_vm._s(_vm.acceptableFormats.join(" ")))])], 1)], 1);
901
911
  };
902
912
  var staticRenderFns$9 = [];
903
913
  var aFileUploader_vue_vue_type_style_index_0_scoped_true_lang = "";
904
914
  const __cssModules$9 = {};
905
- var __component__$9 = /* @__PURE__ */ normalizeComponent(__vue2_script$9, render$9, staticRenderFns$9, false, __vue2_injectStyles$9, "d2a7dbe0", null, null);
915
+ var __component__$9 = /* @__PURE__ */ normalizeComponent(__vue2_script$9, render$9, staticRenderFns$9, false, __vue2_injectStyles$9, "678cdf3c", null, null);
906
916
  function __vue2_injectStyles$9(context) {
907
917
  for (let o in __cssModules$9) {
908
918
  this[o] = __cssModules$9[o];
@@ -969,11 +979,14 @@ var __vue2_script$8 = defineComponent({
969
979
  uploadFilesFunc: {
970
980
  type: Function,
971
981
  required: true
982
+ },
983
+ disabled: {
984
+ type: Boolean
972
985
  }
973
986
  },
974
987
  setup(props, { emit }) {
975
- const nameError = ref$1(false);
976
- const typeError = ref$1(false);
988
+ const nameError = ref(false);
989
+ const typeError = ref(false);
977
990
  const changeVal = useChangeVal(props, emit);
978
991
  const validFields = (callback) => {
979
992
  const data = refactorParams(props.value);
@@ -1009,26 +1022,26 @@ var render$8 = function() {
1009
1022
  var _c = _vm._self._c || _h;
1010
1023
  return _c("ant-form", { staticClass: "add-edit-task-modal", on: { "submit": function(e) {
1011
1024
  return e.preventDefault();
1012
- } } }, [_c("ant-row", { attrs: { "gutter": 20 } }, [_c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "name": "taskName", "label": _vm.$t("message.taskName"), "help": _vm.nameError ? _vm.$t("message.required") : void 0, "validate-status": _vm.nameError ? "error" : void 0 } }, [_c("ant-input", { attrs: { "value": _vm.value.taskName }, on: { "input": function($event) {
1025
+ } } }, [_c("ant-row", { attrs: { "gutter": 20 } }, [_c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "name": "taskName", "label": _vm.$t("message.taskName"), "help": _vm.nameError ? _vm.$t("message.required") : void 0, "validate-status": _vm.nameError ? "error" : void 0 } }, [_c("ant-input", { attrs: { "disabled": _vm.disabled, "value": _vm.value.taskName }, on: { "input": function($event) {
1013
1026
  return _vm.changeVal("taskName", $event.target.value);
1014
- } } })], 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: { "value": _vm.value.isEmployee, "allowClear": true }, on: { "change": function($event) {
1027
+ } } })], 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) {
1015
1028
  return _vm.changeVal("isEmployee", $event);
1016
1029
  } } }, _vm._l(_vm.roles, function(role) {
1017
1030
  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)) + " ")])]);
1018
- }), 1)], 1)], 1)], 1), _c("ant-form-item", { attrs: { "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: { "value": _vm.value.generalTaskType }, on: { "change": function($event) {
1031
+ }), 1)], 1)], 1)], 1), _c("ant-form-item", { attrs: { "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) {
1019
1032
  return _vm.changeVal("generalTaskType", $event.target.value);
1020
- } } }, [_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) : _vm._e()], 1), _c("ant-form-item", { attrs: { "label": _vm.$t("message.descriptions") + "(" + _vm.$t("message.optional") + ")" } }, [_c("ant-textarea", { attrs: { "value": _vm.value.descriptions }, on: { "input": function($event) {
1033
+ } } }, [_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) {
1021
1034
  return _vm.changeVal("descriptions", $event.target.value);
1022
- } } })], 1), _c("ant-form-item", { attrs: { "label": _vm.$t("message.attachment") + "(" + _vm.$t("message.optional") + ")" } }, [_c("a-file-uploader", { attrs: { "value": _vm.value.sampleDocs, "uploadFilesFunc": _vm.uploadFilesFunc }, on: { "change": function($event) {
1035
+ } } })], 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) {
1023
1036
  return _vm.changeVal("sampleDocs", $event);
1024
- } } })], 1), _c("ant-form-item", { attrs: { "label": _vm.$t("message.tags") + "(" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { attrs: { "mode": "tags", "value": _vm.value.tagList, "options": [] }, on: { "change": function($event) {
1037
+ } } })], 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) {
1025
1038
  return _vm.changeVal("tagList", $event);
1026
1039
  } } })], 1)], 1);
1027
1040
  };
1028
1041
  var staticRenderFns$8 = [];
1029
1042
  var index_vue_vue_type_style_index_0_scoped_true_lang$3 = "";
1030
1043
  const __cssModules$8 = {};
1031
- var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, render$8, staticRenderFns$8, false, __vue2_injectStyles$8, "40080928", null, null);
1044
+ var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, render$8, staticRenderFns$8, false, __vue2_injectStyles$8, "daa8be96", null, null);
1032
1045
  function __vue2_injectStyles$8(context) {
1033
1046
  for (let o in __cssModules$8) {
1034
1047
  this[o] = __cssModules$8[o];
@@ -1075,12 +1088,12 @@ var __vue2_script$7 = defineComponent({
1075
1088
  }
1076
1089
  },
1077
1090
  setup(props, { emit }) {
1078
- const taskForm = ref$1();
1091
+ const taskForm = ref();
1079
1092
  const changeVisible = (visible) => {
1080
1093
  emit("update:visible", visible);
1081
1094
  };
1082
- const nameError = ref$1(false);
1083
- const typeError = ref$1(false);
1095
+ const nameError = ref(false);
1096
+ const typeError = ref(false);
1084
1097
  const changeVal = useChangeVal(props, emit);
1085
1098
  const submit2 = () => {
1086
1099
  taskForm.value.validFields((passed, ts) => {
@@ -1218,967 +1231,6 @@ function __vue2_injectStyles$6(context) {
1218
1231
  var TaskTemplateFilter = /* @__PURE__ */ function() {
1219
1232
  return __component__$6.exports;
1220
1233
  }();
1221
- var toString = function(x) {
1222
- return Object.prototype.toString.call(x);
1223
- };
1224
- function isNative(Ctor) {
1225
- return typeof Ctor === "function" && /native code/.test(Ctor.toString());
1226
- }
1227
- var hasSymbol = typeof Symbol !== "undefined" && isNative(Symbol) && typeof Reflect !== "undefined" && isNative(Reflect.ownKeys);
1228
- var noopFn = function(_) {
1229
- return _;
1230
- };
1231
- function proxy(target, key, _a) {
1232
- var get2 = _a.get, set2 = _a.set;
1233
- Object.defineProperty(target, key, {
1234
- enumerable: true,
1235
- configurable: true,
1236
- get: get2 || noopFn,
1237
- set: set2 || noopFn
1238
- });
1239
- }
1240
- function def(obj, key, val, enumerable) {
1241
- Object.defineProperty(obj, key, {
1242
- value: val,
1243
- enumerable: !!enumerable,
1244
- writable: true,
1245
- configurable: true
1246
- });
1247
- }
1248
- function hasOwn(obj, key) {
1249
- return Object.hasOwnProperty.call(obj, key);
1250
- }
1251
- function isArray(x) {
1252
- return Array.isArray(x);
1253
- }
1254
- var MAX_VALID_ARRAY_LENGTH = 4294967295;
1255
- function isValidArrayIndex(val) {
1256
- var n = parseFloat(String(val));
1257
- return n >= 0 && Math.floor(n) === n && isFinite(val) && n <= MAX_VALID_ARRAY_LENGTH;
1258
- }
1259
- function isObject(val) {
1260
- return val !== null && typeof val === "object";
1261
- }
1262
- function isPlainObject(x) {
1263
- return toString(x) === "[object Object]";
1264
- }
1265
- function isFunction(x) {
1266
- return typeof x === "function";
1267
- }
1268
- /*! *****************************************************************************
1269
- Copyright (c) Microsoft Corporation.
1270
-
1271
- Permission to use, copy, modify, and/or distribute this software for any
1272
- purpose with or without fee is hereby granted.
1273
-
1274
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1275
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1276
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1277
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1278
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1279
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1280
- PERFORMANCE OF THIS SOFTWARE.
1281
- ***************************************************************************** */
1282
- var extendStatics = function(d, b) {
1283
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
1284
- d2.__proto__ = b2;
1285
- } || function(d2, b2) {
1286
- for (var p in b2)
1287
- if (Object.prototype.hasOwnProperty.call(b2, p))
1288
- d2[p] = b2[p];
1289
- };
1290
- return extendStatics(d, b);
1291
- };
1292
- function __extends(d, b) {
1293
- if (typeof b !== "function" && b !== null)
1294
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1295
- extendStatics(d, b);
1296
- function __() {
1297
- this.constructor = d;
1298
- }
1299
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1300
- }
1301
- function __values(o) {
1302
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1303
- if (m)
1304
- return m.call(o);
1305
- if (o && typeof o.length === "number")
1306
- return {
1307
- next: function() {
1308
- if (o && i >= o.length)
1309
- o = void 0;
1310
- return { value: o && o[i++], done: !o };
1311
- }
1312
- };
1313
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1314
- }
1315
- var activeEffectScope;
1316
- var effectScopeStack = [];
1317
- var EffectScopeImpl = function() {
1318
- function EffectScopeImpl2(vm) {
1319
- this.active = true;
1320
- this.effects = [];
1321
- this.cleanups = [];
1322
- this.vm = vm;
1323
- }
1324
- EffectScopeImpl2.prototype.run = function(fn) {
1325
- if (this.active) {
1326
- try {
1327
- this.on();
1328
- return fn();
1329
- } finally {
1330
- this.off();
1331
- }
1332
- }
1333
- return;
1334
- };
1335
- EffectScopeImpl2.prototype.on = function() {
1336
- if (this.active) {
1337
- effectScopeStack.push(this);
1338
- activeEffectScope = this;
1339
- }
1340
- };
1341
- EffectScopeImpl2.prototype.off = function() {
1342
- if (this.active) {
1343
- effectScopeStack.pop();
1344
- activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
1345
- }
1346
- };
1347
- EffectScopeImpl2.prototype.stop = function() {
1348
- if (this.active) {
1349
- this.vm.$destroy();
1350
- this.effects.forEach(function(e) {
1351
- return e.stop();
1352
- });
1353
- this.cleanups.forEach(function(cleanup) {
1354
- return cleanup();
1355
- });
1356
- this.active = false;
1357
- }
1358
- };
1359
- return EffectScopeImpl2;
1360
- }();
1361
- (function(_super) {
1362
- __extends(EffectScope, _super);
1363
- function EffectScope(detached) {
1364
- if (detached === void 0) {
1365
- detached = false;
1366
- }
1367
- var _this = this;
1368
- var vm = void 0;
1369
- withCurrentInstanceTrackingDisabled(function() {
1370
- vm = defineComponentInstance(getVueConstructor());
1371
- });
1372
- _this = _super.call(this, vm) || this;
1373
- if (!detached) {
1374
- recordEffectScope(_this);
1375
- }
1376
- return _this;
1377
- }
1378
- return EffectScope;
1379
- })(EffectScopeImpl);
1380
- function recordEffectScope(effect, scope) {
1381
- var _a;
1382
- scope = scope || activeEffectScope;
1383
- if (scope && scope.active) {
1384
- scope.effects.push(effect);
1385
- return;
1386
- }
1387
- var vm = (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy;
1388
- vm && vm.$on("hook:destroyed", function() {
1389
- return effect.stop();
1390
- });
1391
- }
1392
- function getCurrentScope() {
1393
- return activeEffectScope;
1394
- }
1395
- function bindCurrentScopeToVM(vm) {
1396
- if (!vm.scope) {
1397
- var scope_1 = new EffectScopeImpl(vm.proxy);
1398
- vm.scope = scope_1;
1399
- vm.proxy.$on("hook:destroyed", function() {
1400
- return scope_1.stop();
1401
- });
1402
- }
1403
- return vm.scope;
1404
- }
1405
- var vueDependency = void 0;
1406
- try {
1407
- var requiredVue = require("vue");
1408
- if (requiredVue && isVue(requiredVue)) {
1409
- vueDependency = requiredVue;
1410
- } else if (requiredVue && "default" in requiredVue && isVue(requiredVue.default)) {
1411
- vueDependency = requiredVue.default;
1412
- }
1413
- } catch (_a) {
1414
- }
1415
- var vueConstructor = null;
1416
- var currentInstance = null;
1417
- var currentInstanceTracking = true;
1418
- var PluginInstalledFlag = "__composition_api_installed__";
1419
- function isVue(obj) {
1420
- return obj && isFunction(obj) && obj.name === "Vue";
1421
- }
1422
- function isVueRegistered(Vue) {
1423
- return vueConstructor && hasOwn(Vue, PluginInstalledFlag);
1424
- }
1425
- function getVueConstructor() {
1426
- return vueConstructor;
1427
- }
1428
- function getRegisteredVueOrDefault() {
1429
- var constructor = vueConstructor || vueDependency;
1430
- return constructor;
1431
- }
1432
- function setVueConstructor(Vue) {
1433
- vueConstructor = Vue;
1434
- Object.defineProperty(Vue, PluginInstalledFlag, {
1435
- configurable: true,
1436
- writable: true,
1437
- value: true
1438
- });
1439
- }
1440
- function withCurrentInstanceTrackingDisabled(fn) {
1441
- var prev = currentInstanceTracking;
1442
- currentInstanceTracking = false;
1443
- try {
1444
- fn();
1445
- } finally {
1446
- currentInstanceTracking = prev;
1447
- }
1448
- }
1449
- function setCurrentInstance(instance) {
1450
- if (!currentInstanceTracking)
1451
- return;
1452
- var prev = currentInstance;
1453
- prev === null || prev === void 0 ? void 0 : prev.scope.off();
1454
- currentInstance = instance;
1455
- currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope.on();
1456
- }
1457
- function getCurrentInstance() {
1458
- return currentInstance;
1459
- }
1460
- var instanceMapCache = new WeakMap();
1461
- function toVue3ComponentInstance(vm) {
1462
- if (instanceMapCache.has(vm)) {
1463
- return instanceMapCache.get(vm);
1464
- }
1465
- var instance = {
1466
- proxy: vm,
1467
- update: vm.$forceUpdate,
1468
- type: vm.$options,
1469
- uid: vm._uid,
1470
- emit: vm.$emit.bind(vm),
1471
- parent: null,
1472
- root: null
1473
- };
1474
- bindCurrentScopeToVM(instance);
1475
- var instanceProps = [
1476
- "data",
1477
- "props",
1478
- "attrs",
1479
- "refs",
1480
- "vnode",
1481
- "slots"
1482
- ];
1483
- instanceProps.forEach(function(prop2) {
1484
- proxy(instance, prop2, {
1485
- get: function() {
1486
- return vm["$" + prop2];
1487
- }
1488
- });
1489
- });
1490
- proxy(instance, "isMounted", {
1491
- get: function() {
1492
- return vm._isMounted;
1493
- }
1494
- });
1495
- proxy(instance, "isUnmounted", {
1496
- get: function() {
1497
- return vm._isDestroyed;
1498
- }
1499
- });
1500
- proxy(instance, "isDeactivated", {
1501
- get: function() {
1502
- return vm._inactive;
1503
- }
1504
- });
1505
- proxy(instance, "emitted", {
1506
- get: function() {
1507
- return vm._events;
1508
- }
1509
- });
1510
- instanceMapCache.set(vm, instance);
1511
- if (vm.$parent) {
1512
- instance.parent = toVue3ComponentInstance(vm.$parent);
1513
- }
1514
- if (vm.$root) {
1515
- instance.root = toVue3ComponentInstance(vm.$root);
1516
- }
1517
- return instance;
1518
- }
1519
- function defineComponentInstance(Ctor, options) {
1520
- if (options === void 0) {
1521
- options = {};
1522
- }
1523
- var silent = Ctor.config.silent;
1524
- Ctor.config.silent = true;
1525
- var vm = new Ctor(options);
1526
- Ctor.config.silent = silent;
1527
- return vm;
1528
- }
1529
- function isComponentInstance(obj) {
1530
- var Vue = getVueConstructor();
1531
- return Vue && obj instanceof Vue;
1532
- }
1533
- function createSlotProxy(vm, slotName) {
1534
- return function() {
1535
- var args = [];
1536
- for (var _i = 0; _i < arguments.length; _i++) {
1537
- args[_i] = arguments[_i];
1538
- }
1539
- if (!vm.$scopedSlots[slotName]) {
1540
- return;
1541
- }
1542
- return vm.$scopedSlots[slotName].apply(vm, args);
1543
- };
1544
- }
1545
- function resolveSlots(slots, normalSlots) {
1546
- var res;
1547
- if (!slots) {
1548
- res = {};
1549
- } else if (slots._normalized) {
1550
- return slots._normalized;
1551
- } else {
1552
- res = {};
1553
- for (var key in slots) {
1554
- if (slots[key] && key[0] !== "$") {
1555
- res[key] = true;
1556
- }
1557
- }
1558
- }
1559
- for (var key in normalSlots) {
1560
- if (!(key in res)) {
1561
- res[key] = true;
1562
- }
1563
- }
1564
- return res;
1565
- }
1566
- var RefKey = "composition-api.refKey";
1567
- var accessModifiedSet = new WeakMap();
1568
- var readonlySet = new WeakMap();
1569
- function set$1(target, key, val) {
1570
- var Vue = getVueConstructor();
1571
- var _a = Vue.util;
1572
- _a.warn;
1573
- var defineReactive = _a.defineReactive;
1574
- var ob = target.__ob__;
1575
- function ssrMockReactivity() {
1576
- if (ob && isObject(val) && !hasOwn(val, "__ob__")) {
1577
- mockReactivityDeep(val);
1578
- }
1579
- }
1580
- if (isArray(target)) {
1581
- if (isValidArrayIndex(key)) {
1582
- target.length = Math.max(target.length, key);
1583
- target.splice(key, 1, val);
1584
- ssrMockReactivity();
1585
- return val;
1586
- } else if (key === "length" && val !== target.length) {
1587
- target.length = val;
1588
- ob === null || ob === void 0 ? void 0 : ob.dep.notify();
1589
- return val;
1590
- }
1591
- }
1592
- if (key in target && !(key in Object.prototype)) {
1593
- target[key] = val;
1594
- ssrMockReactivity();
1595
- return val;
1596
- }
1597
- if (target._isVue || ob && ob.vmCount) {
1598
- return val;
1599
- }
1600
- if (!ob) {
1601
- target[key] = val;
1602
- return val;
1603
- }
1604
- defineReactive(ob.value, key, val);
1605
- defineAccessControl(target, key, val);
1606
- ssrMockReactivity();
1607
- ob.dep.notify();
1608
- return val;
1609
- }
1610
- var RefImpl = function() {
1611
- function RefImpl2(_a) {
1612
- var get2 = _a.get, set2 = _a.set;
1613
- proxy(this, "value", {
1614
- get: get2,
1615
- set: set2
1616
- });
1617
- }
1618
- return RefImpl2;
1619
- }();
1620
- function createRef(options, isReadonly, isComputed) {
1621
- if (isReadonly === void 0) {
1622
- isReadonly = false;
1623
- }
1624
- if (isComputed === void 0) {
1625
- isComputed = false;
1626
- }
1627
- var r = new RefImpl(options);
1628
- if (isComputed)
1629
- r.effect = true;
1630
- var sealed = Object.seal(r);
1631
- if (isReadonly)
1632
- readonlySet.set(sealed, true);
1633
- return sealed;
1634
- }
1635
- function ref(raw) {
1636
- var _a;
1637
- if (isRef(raw)) {
1638
- return raw;
1639
- }
1640
- var value = reactive((_a = {}, _a[RefKey] = raw, _a));
1641
- return createRef({
1642
- get: function() {
1643
- return value[RefKey];
1644
- },
1645
- set: function(v) {
1646
- return value[RefKey] = v;
1647
- }
1648
- });
1649
- }
1650
- function isRef(value) {
1651
- return value instanceof RefImpl;
1652
- }
1653
- function toRefs(obj) {
1654
- if (!isPlainObject(obj))
1655
- return obj;
1656
- var ret = {};
1657
- for (var key in obj) {
1658
- ret[key] = toRef(obj, key);
1659
- }
1660
- return ret;
1661
- }
1662
- function toRef(object, key) {
1663
- if (!(key in object))
1664
- set$1(object, key, void 0);
1665
- var v = object[key];
1666
- if (isRef(v))
1667
- return v;
1668
- return createRef({
1669
- get: function() {
1670
- return object[key];
1671
- },
1672
- set: function(v2) {
1673
- return object[key] = v2;
1674
- }
1675
- });
1676
- }
1677
- function isRaw(obj) {
1678
- var _a;
1679
- return Boolean(obj && hasOwn(obj, "__ob__") && typeof obj.__ob__ === "object" && ((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a.__raw__));
1680
- }
1681
- function isReactive(obj) {
1682
- var _a;
1683
- return Boolean(obj && hasOwn(obj, "__ob__") && typeof obj.__ob__ === "object" && !((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a.__raw__));
1684
- }
1685
- function setupAccessControl(target) {
1686
- if (!isPlainObject(target) || isRaw(target) || isArray(target) || isRef(target) || isComponentInstance(target) || accessModifiedSet.has(target))
1687
- return;
1688
- accessModifiedSet.set(target, true);
1689
- var keys = Object.keys(target);
1690
- for (var i = 0; i < keys.length; i++) {
1691
- defineAccessControl(target, keys[i]);
1692
- }
1693
- }
1694
- function defineAccessControl(target, key, val) {
1695
- if (key === "__ob__")
1696
- return;
1697
- if (isRaw(target[key]))
1698
- return;
1699
- var getter;
1700
- var setter;
1701
- var property = Object.getOwnPropertyDescriptor(target, key);
1702
- if (property) {
1703
- if (property.configurable === false) {
1704
- return;
1705
- }
1706
- getter = property.get;
1707
- setter = property.set;
1708
- if ((!getter || setter) && arguments.length === 2) {
1709
- val = target[key];
1710
- }
1711
- }
1712
- setupAccessControl(val);
1713
- proxy(target, key, {
1714
- get: function getterHandler() {
1715
- var value = getter ? getter.call(target) : val;
1716
- if (key !== RefKey && isRef(value)) {
1717
- return value.value;
1718
- } else {
1719
- return value;
1720
- }
1721
- },
1722
- set: function setterHandler(newVal) {
1723
- if (getter && !setter)
1724
- return;
1725
- if (key !== RefKey && isRef(val) && !isRef(newVal)) {
1726
- val.value = newVal;
1727
- } else if (setter) {
1728
- setter.call(target, newVal);
1729
- val = newVal;
1730
- } else {
1731
- val = newVal;
1732
- }
1733
- setupAccessControl(newVal);
1734
- }
1735
- });
1736
- }
1737
- function observe(obj) {
1738
- var Vue = getRegisteredVueOrDefault();
1739
- var observed;
1740
- if (Vue.observable) {
1741
- observed = Vue.observable(obj);
1742
- } else {
1743
- var vm = defineComponentInstance(Vue, {
1744
- data: {
1745
- $$state: obj
1746
- }
1747
- });
1748
- observed = vm._data.$$state;
1749
- }
1750
- if (!hasOwn(observed, "__ob__")) {
1751
- mockReactivityDeep(observed);
1752
- }
1753
- return observed;
1754
- }
1755
- function mockReactivityDeep(obj, seen) {
1756
- var e_1, _a;
1757
- if (seen === void 0) {
1758
- seen = new Set();
1759
- }
1760
- if (seen.has(obj) || hasOwn(obj, "__ob__") || !Object.isExtensible(obj))
1761
- return;
1762
- def(obj, "__ob__", mockObserver(obj));
1763
- seen.add(obj);
1764
- try {
1765
- for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
1766
- var key = _c.value;
1767
- var value = obj[key];
1768
- if (!(isPlainObject(value) || isArray(value)) || isRaw(value) || !Object.isExtensible(value)) {
1769
- continue;
1770
- }
1771
- mockReactivityDeep(value, seen);
1772
- }
1773
- } catch (e_1_1) {
1774
- e_1 = { error: e_1_1 };
1775
- } finally {
1776
- try {
1777
- if (_c && !_c.done && (_a = _b.return))
1778
- _a.call(_b);
1779
- } finally {
1780
- if (e_1)
1781
- throw e_1.error;
1782
- }
1783
- }
1784
- }
1785
- function mockObserver(value) {
1786
- if (value === void 0) {
1787
- value = {};
1788
- }
1789
- return {
1790
- value,
1791
- dep: {
1792
- notify: noopFn,
1793
- depend: noopFn,
1794
- addSub: noopFn,
1795
- removeSub: noopFn
1796
- }
1797
- };
1798
- }
1799
- function createObserver() {
1800
- return observe({}).__ob__;
1801
- }
1802
- function reactive(obj) {
1803
- if (!isObject(obj)) {
1804
- return obj;
1805
- }
1806
- if (!(isPlainObject(obj) || isArray(obj)) || isRaw(obj) || !Object.isExtensible(obj)) {
1807
- return obj;
1808
- }
1809
- var observed = observe(obj);
1810
- setupAccessControl(observed);
1811
- return observed;
1812
- }
1813
- function set(vm, key, value) {
1814
- var state = vm.__composition_api_state__ = vm.__composition_api_state__ || {};
1815
- state[key] = value;
1816
- }
1817
- function get(vm, key) {
1818
- return (vm.__composition_api_state__ || {})[key];
1819
- }
1820
- var vmStateManager = {
1821
- set,
1822
- get
1823
- };
1824
- function asVmProperty(vm, propName, propValue) {
1825
- var props = vm.$options.props;
1826
- if (!(propName in vm) && !(props && hasOwn(props, propName))) {
1827
- if (isRef(propValue)) {
1828
- proxy(vm, propName, {
1829
- get: function() {
1830
- return propValue.value;
1831
- },
1832
- set: function(val) {
1833
- propValue.value = val;
1834
- }
1835
- });
1836
- } else {
1837
- proxy(vm, propName, {
1838
- get: function() {
1839
- if (isReactive(propValue)) {
1840
- propValue.__ob__.dep.depend();
1841
- }
1842
- return propValue;
1843
- },
1844
- set: function(val) {
1845
- propValue = val;
1846
- }
1847
- });
1848
- }
1849
- }
1850
- }
1851
- function updateTemplateRef(vm) {
1852
- var rawBindings = vmStateManager.get(vm, "rawBindings") || {};
1853
- if (!rawBindings || !Object.keys(rawBindings).length)
1854
- return;
1855
- var refs = vm.$refs;
1856
- var oldRefKeys = vmStateManager.get(vm, "refs") || [];
1857
- for (var index2 = 0; index2 < oldRefKeys.length; index2++) {
1858
- var key = oldRefKeys[index2];
1859
- var setupValue = rawBindings[key];
1860
- if (!refs[key] && setupValue && isRef(setupValue)) {
1861
- setupValue.value = null;
1862
- }
1863
- }
1864
- var newKeys = Object.keys(refs);
1865
- var validNewKeys = [];
1866
- for (var index2 = 0; index2 < newKeys.length; index2++) {
1867
- var key = newKeys[index2];
1868
- var setupValue = rawBindings[key];
1869
- if (refs[key] && setupValue && isRef(setupValue)) {
1870
- setupValue.value = refs[key];
1871
- validNewKeys.push(key);
1872
- }
1873
- }
1874
- vmStateManager.set(vm, "refs", validNewKeys);
1875
- }
1876
- function updateVmAttrs(vm, ctx) {
1877
- var e_1, _a;
1878
- if (!vm) {
1879
- return;
1880
- }
1881
- var attrBindings = vmStateManager.get(vm, "attrBindings");
1882
- if (!attrBindings && !ctx) {
1883
- return;
1884
- }
1885
- if (!attrBindings) {
1886
- var observedData = reactive({});
1887
- attrBindings = { ctx, data: observedData };
1888
- vmStateManager.set(vm, "attrBindings", attrBindings);
1889
- proxy(ctx, "attrs", {
1890
- get: function() {
1891
- return attrBindings === null || attrBindings === void 0 ? void 0 : attrBindings.data;
1892
- },
1893
- set: function() {
1894
- }
1895
- });
1896
- }
1897
- var source = vm.$attrs;
1898
- var _loop_1 = function(attr2) {
1899
- if (!hasOwn(attrBindings.data, attr2)) {
1900
- proxy(attrBindings.data, attr2, {
1901
- get: function() {
1902
- return vm.$attrs[attr2];
1903
- }
1904
- });
1905
- }
1906
- };
1907
- try {
1908
- for (var _b = __values(Object.keys(source)), _c = _b.next(); !_c.done; _c = _b.next()) {
1909
- var attr = _c.value;
1910
- _loop_1(attr);
1911
- }
1912
- } catch (e_1_1) {
1913
- e_1 = { error: e_1_1 };
1914
- } finally {
1915
- try {
1916
- if (_c && !_c.done && (_a = _b.return))
1917
- _a.call(_b);
1918
- } finally {
1919
- if (e_1)
1920
- throw e_1.error;
1921
- }
1922
- }
1923
- }
1924
- function resolveScopedSlots(vm, slotsProxy) {
1925
- var parentVNode = vm.$options._parentVnode;
1926
- if (!parentVNode)
1927
- return;
1928
- var prevSlots = vmStateManager.get(vm, "slots") || [];
1929
- var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots);
1930
- for (var index2 = 0; index2 < prevSlots.length; index2++) {
1931
- var key = prevSlots[index2];
1932
- if (!curSlots[key]) {
1933
- delete slotsProxy[key];
1934
- }
1935
- }
1936
- var slotNames = Object.keys(curSlots);
1937
- for (var index2 = 0; index2 < slotNames.length; index2++) {
1938
- var key = slotNames[index2];
1939
- if (!slotsProxy[key]) {
1940
- slotsProxy[key] = createSlotProxy(vm, key);
1941
- }
1942
- }
1943
- vmStateManager.set(vm, "slots", slotNames);
1944
- }
1945
- function activateCurrentInstance(instance, fn, onError) {
1946
- var preVm = getCurrentInstance();
1947
- setCurrentInstance(instance);
1948
- try {
1949
- return fn(instance);
1950
- } catch (err) {
1951
- if (onError) {
1952
- onError(err);
1953
- } else {
1954
- throw err;
1955
- }
1956
- } finally {
1957
- setCurrentInstance(preVm);
1958
- }
1959
- }
1960
- function mixin(Vue) {
1961
- Vue.mixin({
1962
- beforeCreate: functionApiInit,
1963
- mounted: function() {
1964
- updateTemplateRef(this);
1965
- },
1966
- beforeUpdate: function() {
1967
- updateVmAttrs(this);
1968
- },
1969
- updated: function() {
1970
- var _a;
1971
- updateTemplateRef(this);
1972
- if ((_a = this.$vnode) === null || _a === void 0 ? void 0 : _a.context) {
1973
- updateTemplateRef(this.$vnode.context);
1974
- }
1975
- }
1976
- });
1977
- function functionApiInit() {
1978
- var vm = this;
1979
- var $options = vm.$options;
1980
- var setup = $options.setup, render2 = $options.render;
1981
- if (render2) {
1982
- $options.render = function() {
1983
- var _this = this;
1984
- var args = [];
1985
- for (var _i = 0; _i < arguments.length; _i++) {
1986
- args[_i] = arguments[_i];
1987
- }
1988
- return activateCurrentInstance(toVue3ComponentInstance(vm), function() {
1989
- return render2.apply(_this, args);
1990
- });
1991
- };
1992
- }
1993
- if (!setup) {
1994
- return;
1995
- }
1996
- if (!isFunction(setup)) {
1997
- return;
1998
- }
1999
- var data = $options.data;
2000
- $options.data = function wrappedData() {
2001
- initSetup(vm, vm.$props);
2002
- return isFunction(data) ? data.call(vm, vm) : data || {};
2003
- };
2004
- }
2005
- function initSetup(vm, props) {
2006
- if (props === void 0) {
2007
- props = {};
2008
- }
2009
- var setup = vm.$options.setup;
2010
- var ctx = createSetupContext(vm);
2011
- var instance = toVue3ComponentInstance(vm);
2012
- instance.setupContext = ctx;
2013
- def(props, "__ob__", createObserver());
2014
- resolveScopedSlots(vm, ctx.slots);
2015
- var binding;
2016
- activateCurrentInstance(instance, function() {
2017
- binding = setup(props, ctx);
2018
- });
2019
- if (!binding)
2020
- return;
2021
- if (isFunction(binding)) {
2022
- var bindingFunc_1 = binding;
2023
- vm.$options.render = function() {
2024
- resolveScopedSlots(vm, ctx.slots);
2025
- return activateCurrentInstance(instance, function() {
2026
- return bindingFunc_1();
2027
- });
2028
- };
2029
- return;
2030
- } else if (isObject(binding)) {
2031
- if (isReactive(binding)) {
2032
- binding = toRefs(binding);
2033
- }
2034
- vmStateManager.set(vm, "rawBindings", binding);
2035
- var bindingObj_1 = binding;
2036
- Object.keys(bindingObj_1).forEach(function(name) {
2037
- var bindingValue = bindingObj_1[name];
2038
- if (!isRef(bindingValue)) {
2039
- if (!isReactive(bindingValue)) {
2040
- if (isFunction(bindingValue)) {
2041
- var copy_1 = bindingValue;
2042
- bindingValue = bindingValue.bind(vm);
2043
- Object.keys(copy_1).forEach(function(ele) {
2044
- bindingValue[ele] = copy_1[ele];
2045
- });
2046
- } else if (!isObject(bindingValue)) {
2047
- bindingValue = ref(bindingValue);
2048
- } else if (hasReactiveArrayChild(bindingValue)) {
2049
- customReactive(bindingValue);
2050
- }
2051
- } else if (isArray(bindingValue)) {
2052
- bindingValue = ref(bindingValue);
2053
- }
2054
- }
2055
- asVmProperty(vm, name, bindingValue);
2056
- });
2057
- return;
2058
- }
2059
- }
2060
- function customReactive(target, seen) {
2061
- if (seen === void 0) {
2062
- seen = new Set();
2063
- }
2064
- if (seen.has(target))
2065
- return;
2066
- if (!isPlainObject(target) || isRef(target) || isReactive(target) || isRaw(target))
2067
- return;
2068
- var Vue2 = getVueConstructor();
2069
- var defineReactive = Vue2.util.defineReactive;
2070
- Object.keys(target).forEach(function(k) {
2071
- var val = target[k];
2072
- defineReactive(target, k, val);
2073
- if (val) {
2074
- seen.add(val);
2075
- customReactive(val, seen);
2076
- }
2077
- return;
2078
- });
2079
- }
2080
- function hasReactiveArrayChild(target, visited) {
2081
- if (visited === void 0) {
2082
- visited = new Map();
2083
- }
2084
- if (visited.has(target)) {
2085
- return visited.get(target);
2086
- }
2087
- visited.set(target, false);
2088
- if (isArray(target) && isReactive(target)) {
2089
- visited.set(target, true);
2090
- return true;
2091
- }
2092
- if (!isPlainObject(target) || isRaw(target) || isRef(target)) {
2093
- return false;
2094
- }
2095
- return Object.keys(target).some(function(x) {
2096
- return hasReactiveArrayChild(target[x], visited);
2097
- });
2098
- }
2099
- function createSetupContext(vm) {
2100
- var ctx = { slots: {} };
2101
- var propsPlain = [
2102
- "root",
2103
- "parent",
2104
- "refs",
2105
- "listeners",
2106
- "isServer",
2107
- "ssrContext"
2108
- ];
2109
- var methodReturnVoid = ["emit"];
2110
- propsPlain.forEach(function(key) {
2111
- var srcKey = "$" + key;
2112
- proxy(ctx, key, {
2113
- get: function() {
2114
- return vm[srcKey];
2115
- },
2116
- set: function() {
2117
- }
2118
- });
2119
- });
2120
- updateVmAttrs(vm, ctx);
2121
- methodReturnVoid.forEach(function(key) {
2122
- var srcKey = "$" + key;
2123
- proxy(ctx, key, {
2124
- get: function() {
2125
- return function() {
2126
- var args = [];
2127
- for (var _i = 0; _i < arguments.length; _i++) {
2128
- args[_i] = arguments[_i];
2129
- }
2130
- var fn = vm[srcKey];
2131
- fn.apply(vm, args);
2132
- };
2133
- }
2134
- });
2135
- });
2136
- return ctx;
2137
- }
2138
- }
2139
- function mergeData(from, to) {
2140
- if (!from)
2141
- return to;
2142
- if (!to)
2143
- return from;
2144
- var key;
2145
- var toVal;
2146
- var fromVal;
2147
- var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from);
2148
- for (var i = 0; i < keys.length; i++) {
2149
- key = keys[i];
2150
- if (key === "__ob__")
2151
- continue;
2152
- toVal = to[key];
2153
- fromVal = from[key];
2154
- if (!hasOwn(to, key)) {
2155
- to[key] = fromVal;
2156
- } else if (toVal !== fromVal && isPlainObject(toVal) && !isRef(toVal) && isPlainObject(fromVal) && !isRef(fromVal)) {
2157
- mergeData(fromVal, toVal);
2158
- }
2159
- }
2160
- return to;
2161
- }
2162
- function install(Vue) {
2163
- if (isVueRegistered(Vue)) {
2164
- return;
2165
- }
2166
- Vue.config.optionMergeStrategies.setup = function(parent, child) {
2167
- return function mergedSetupFn(props, context) {
2168
- return mergeData(isFunction(parent) ? parent(props, context) || {} : void 0, isFunction(child) ? child(props, context) || {} : void 0);
2169
- };
2170
- };
2171
- setVueConstructor(Vue);
2172
- mixin(Vue);
2173
- }
2174
- var Plugin = {
2175
- install: function(Vue) {
2176
- return install(Vue);
2177
- }
2178
- };
2179
- if (typeof window !== "undefined" && window.Vue) {
2180
- window.Vue.use(Plugin);
2181
- }
2182
1234
  function useT() {
2183
1235
  const scope = getCurrentScope();
2184
1236
  return (key) => scope.vm.$i18n.t(key);
@@ -2218,7 +1270,7 @@ var __vue2_script$5 = defineComponent({
2218
1270
  }
2219
1271
  },
2220
1272
  setup(props) {
2221
- const { addedTasks } = toRefs$1(props);
1273
+ const { addedTasks } = toRefs(props);
2222
1274
  const t = useT();
2223
1275
  const columns = [
2224
1276
  {
@@ -2290,7 +1342,7 @@ function __vue2_injectStyles$5(context) {
2290
1342
  var TaskTablePure = /* @__PURE__ */ function() {
2291
1343
  return __component__$5.exports;
2292
1344
  }();
2293
- var useSearchTaskTemplates = (pagination, conditions = ref$1({}), lawFirmId) => {
1345
+ var useSearchTaskTemplates = (pagination, conditions = ref({}), lawFirmId) => {
2294
1346
  const startIndex = computed(() => (pagination.value.current - 1) * pagination.value.pageSize);
2295
1347
  const endIndex = computed(() => startIndex.value + pagination.value.pageSize);
2296
1348
  watch(() => conditions.value, () => {
@@ -2363,7 +1415,7 @@ var useTaskActions = (addedTasks, emit) => {
2363
1415
  removeTask
2364
1416
  };
2365
1417
  };
2366
- var useSearchTaskConditions = () => ref$1({
1418
+ var useSearchTaskConditions = () => ref({
2367
1419
  keywords: "",
2368
1420
  isEmployee: [
2369
1421
  AssigneeTypes.ATTORNEY,
@@ -2372,12 +1424,12 @@ var useSearchTaskConditions = () => ref$1({
2372
1424
  ]
2373
1425
  });
2374
1426
  var useTaskTemplateTableData = (props, emit) => {
2375
- const initialPagination = ref$1({
1427
+ const initialPagination = ref({
2376
1428
  current: 1,
2377
1429
  pageSize: props.pageSize || 10,
2378
1430
  total: 0
2379
1431
  });
2380
- const { conditions = useSearchTaskConditions(), addedTasks = ref$1([]) } = toRefs$1(props);
1432
+ const { conditions = useSearchTaskConditions(), addedTasks = ref([]) } = toRefs(props);
2381
1433
  const { result, loading, variables } = useSearchTaskTemplates(initialPagination, conditions, props.lawFirmId);
2382
1434
  const dataSource = computed(() => {
2383
1435
  var _a;
@@ -2510,7 +1562,7 @@ var __vue2_script$3 = defineComponent({
2510
1562
  }
2511
1563
  },
2512
1564
  setup(props, { emit }) {
2513
- const taskTable = ref$1();
1565
+ const taskTable = ref();
2514
1566
  const conditions = useSearchTaskConditions();
2515
1567
  const currentComponent = shallowRef(props.showPage ? Card : Modal);
2516
1568
  const editAction = (record) => {
@@ -2606,8 +1658,8 @@ var __vue2_script$2 = defineComponent({
2606
1658
  }
2607
1659
  },
2608
1660
  setup(props, { emit }) {
2609
- const { addedTasks } = toRefs$1(props);
2610
- const pagination = ref$1({
1661
+ const { addedTasks } = toRefs(props);
1662
+ const pagination = ref({
2611
1663
  total: addedTasks.value.length,
2612
1664
  current: 1,
2613
1665
  pageSize: 10
@@ -2749,14 +1801,6 @@ var __vue2_script$1 = defineComponent({
2749
1801
  type: Boolean,
2750
1802
  default: false
2751
1803
  },
2752
- userId: {
2753
- type: String,
2754
- required: true
2755
- },
2756
- lawFirmId: {
2757
- type: Number,
2758
- required: true
2759
- },
2760
1804
  value: {
2761
1805
  type: Array,
2762
1806
  default: () => []
@@ -2792,16 +1836,25 @@ var __vue2_script$1 = defineComponent({
2792
1836
  type: Number
2793
1837
  }
2794
1838
  },
2795
- setup(props, { emit }) {
1839
+ setup(_, { emit }) {
2796
1840
  const { client } = useApolloClient();
2797
- const mainModal = ref$1();
2798
- const reviewModal = ref$1();
2799
- const newTaskVisible = ref$1(false);
2800
- const reviewModalVisible = ref$1(false);
2801
- const tempTask = ref$1(defaultTaskTemplate);
1841
+ const mainModal = ref();
1842
+ const reviewModal = ref();
1843
+ const newTaskVisible = ref(false);
1844
+ const reviewModalVisible = ref(false);
1845
+ const tempTask = ref(defaultTaskTemplate);
2802
1846
  const updateTemplate = useMutateTaskTemplate();
2803
1847
  const createTemplate = useCreateTaskTemplate();
2804
- const addedTasks = ref$1([]);
1848
+ const addedTasks = ref([]);
1849
+ const me = useMe();
1850
+ const userId = computed(() => {
1851
+ var _a;
1852
+ return (_a = me.value) == null ? void 0 : _a.id;
1853
+ });
1854
+ const lawFirmId = computed(() => {
1855
+ var _a;
1856
+ return (_a = me.value) == null ? void 0 : _a.lawFirmId;
1857
+ });
2805
1858
  watch(() => newTaskVisible.value, (visible) => {
2806
1859
  if (!visible) {
2807
1860
  tempTask.value = defaultTaskTemplate;
@@ -2818,52 +1871,63 @@ var __vue2_script$1 = defineComponent({
2818
1871
  emit("update:value", newValue.map(({ id }) => id));
2819
1872
  }
2820
1873
  };
2821
- const _submit = async (record) => {
1874
+ const writeQuery = (id, newRecord) => {
2822
1875
  const variables = mainModal.value.getVariables();
2823
1876
  const existed = client.readQuery({
2824
1877
  query: SearchTaskTemplatesQuery,
2825
1878
  variables
2826
1879
  });
2827
- const {
2828
- newRecord,
2829
- success
2830
- } = await submit(record, updateTemplate, createTemplate);
1880
+ client.writeQuery({
1881
+ query: SearchTaskTemplatesQuery,
1882
+ data: {
1883
+ taskTemplateSearch: __spreadProps(__spreadValues({}, existed.taskTemplateSearch), {
1884
+ taskTemplateList: existed.taskTemplateSearch.taskTemplateList.map((record) => {
1885
+ if (record.id === id) {
1886
+ return newRecord && __spreadProps(__spreadValues({}, newRecord), {
1887
+ isGallery: record.isGallery
1888
+ });
1889
+ }
1890
+ return record;
1891
+ }).filter((record) => !!record)
1892
+ })
1893
+ },
1894
+ variables
1895
+ });
1896
+ };
1897
+ const _submit = async (record) => {
1898
+ const { newRecord, success, isUpdate } = await submit(record, updateTemplate, createTemplate);
2831
1899
  if (success) {
2832
- client.writeQuery({
2833
- query: SearchTaskTemplatesQuery,
2834
- data: {
2835
- taskTemplateSearch: __spreadProps(__spreadValues({}, existed.taskTemplateSearch), {
2836
- taskTemplateList: existed.taskTemplateSearch.taskTemplateList.map((record2) => {
2837
- if (record2.id === newRecord.id) {
2838
- return __spreadProps(__spreadValues({}, newRecord), {
2839
- isGallery: record2.isGallery
2840
- });
2841
- }
2842
- return record2;
2843
- })
2844
- })
2845
- },
2846
- variables
2847
- });
1900
+ if (!isUpdate)
1901
+ writeQuery(record.taskTemplateId, newRecord);
2848
1902
  newTaskVisible.value = false;
2849
1903
  updateReviewModalContent(record, newRecord);
1904
+ emit("task-added", newRecord);
2850
1905
  }
2851
1906
  };
2852
1907
  const submitting = computed(() => updateTemplate.loading.value || createTemplate.loading.value);
1908
+ const endReviewing = (result) => {
1909
+ emit("submit", result);
1910
+ reviewModalVisible.value = false;
1911
+ newTaskVisible.value = false;
1912
+ };
2853
1913
  const editTask = (record) => {
2854
1914
  newTaskVisible.value = true;
2855
1915
  tempTask.value = __spreadValues({}, record);
2856
1916
  };
2857
1917
  return {
2858
- editTask,
2859
1918
  mainModal,
2860
1919
  reviewModal,
2861
- _submit,
2862
1920
  newTaskVisible,
2863
1921
  tempTask,
2864
1922
  reviewModalVisible,
2865
1923
  submitting,
2866
- addedTasks
1924
+ addedTasks,
1925
+ userId,
1926
+ lawFirmId,
1927
+ writeQuery,
1928
+ editTask,
1929
+ _submit,
1930
+ endReviewing
2867
1931
  };
2868
1932
  }
2869
1933
  });
@@ -2871,7 +1935,7 @@ var render$1 = function() {
2871
1935
  var _vm = this;
2872
1936
  var _h = _vm.$createElement;
2873
1937
  var _c = _vm._self._c || _h;
2874
- return _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, "added-tasks": _vm.addedTasks, "newTaskVisible": _vm.newTaskVisible, "task-setting-page-url": _vm.taskSettingPageUrl, "reviewModalVisible": _vm.reviewModalVisible, "open-review-button-text": _vm.openReviewButtonText }, on: { "update:tempTask": function($event) {
1938
+ 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, "added-tasks": _vm.addedTasks, "newTaskVisible": _vm.newTaskVisible, "task-setting-page-url": _vm.taskSettingPageUrl, "reviewModalVisible": _vm.reviewModalVisible, "open-review-button-text": _vm.openReviewButtonText }, on: { "update:tempTask": function($event) {
2875
1939
  _vm.tempTask = $event;
2876
1940
  }, "update:temp-task": function($event) {
2877
1941
  _vm.tempTask = $event;
@@ -2909,20 +1973,18 @@ var render$1 = function() {
2909
1973
  _vm.newTaskVisible = $event;
2910
1974
  }, "update:new-task-visible": function($event) {
2911
1975
  _vm.newTaskVisible = $event;
2912
- }, "submit": function($event) {
2913
- return _vm.$emit("submit", $event);
2914
- }, "update:sendEmail": function($event) {
1976
+ }, "submit": _vm.endReviewing, "update:sendEmail": function($event) {
2915
1977
  return _vm.$emit("update:sendEmail", $event);
2916
1978
  } } }), _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 }, on: { "update:value": function($event) {
2917
1979
  _vm.tempTask = $event;
2918
1980
  }, "update:visible": function($event) {
2919
1981
  _vm.newTaskVisible = $event;
2920
- }, "submit": _vm._submit } })], 1);
1982
+ }, "submit": _vm._submit } })], 1) : _vm._e();
2921
1983
  };
2922
1984
  var staticRenderFns$1 = [];
2923
1985
  var index_vue_vue_type_style_index_0_scoped_true_lang = "";
2924
1986
  const __cssModules$1 = {};
2925
- var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, "57002a5a", null, null);
1987
+ var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, "ffef8fd2", null, null);
2926
1988
  function __vue2_injectStyles$1(context) {
2927
1989
  for (let o in __cssModules$1) {
2928
1990
  this[o] = __cssModules$1[o];
@@ -2933,8 +1995,8 @@ var index$1 = /* @__PURE__ */ function() {
2933
1995
  }();
2934
1996
  var __vue2_script = defineComponent({
2935
1997
  setup() {
2936
- const notBoolean = ref$1(123);
2937
- const test = ref$1(false);
1998
+ const notBoolean = ref(123);
1999
+ const test = ref(false);
2938
2000
  const isDisabled = computed(() => test.value);
2939
2001
  return {
2940
2002
  isDisabled,