@ailaw/venus 0.2.3 → 0.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 (2) hide show
  1. package/dist/venus.es.js +137 -63
  2. package/package.json +1 -1
package/dist/venus.es.js CHANGED
@@ -177,12 +177,14 @@ const profilesQuery = gql`
177
177
  $lawFirmId: Int!
178
178
  $keywords: String
179
179
  $profileType: String
180
+ $profileIds: [Int!]
180
181
  ) {
181
182
  profileSearch(
182
183
  query: {
183
184
  lawFirmId: $lawFirmId
184
185
  keywords: $keywords
185
186
  profileType: $profileType
187
+ profileId: $profileIds
186
188
  }
187
189
  ) {
188
190
  numResult
@@ -352,6 +354,10 @@ var __vue2_script$b = defineComponent({
352
354
  source: {
353
355
  type: Array,
354
356
  required: true
357
+ },
358
+ creatable: {
359
+ type: Boolean,
360
+ default: false
355
361
  }
356
362
  },
357
363
  components: {
@@ -386,7 +392,7 @@ var render$b = function() {
386
392
  var _h = _vm.$createElement;
387
393
  var _c = _vm._self._c || _h;
388
394
  return _c("Select", _vm._g(_vm._b({ staticClass: "w-72", attrs: { "allowClear": "", "showSearch": "", "optionFilterProp": "name", "value": _vm.selectedId }, on: { "select": _vm.handleSelect }, scopedSlots: _vm._u([{ key: "dropdownRender", fn: function(menu) {
389
- return _c("div", {}, [_c("v-nodes", { attrs: { "vnodes": menu } }), _c("Divider", { staticClass: "my-1" }), _c("div", { staticClass: "flex justify-end px-3 py-1" }, [_c("Button", { attrs: { "size": "small" }, on: { "click": _vm.handleProfileCreate } }, [_vm._v("Create new profile")])], 1)], 1);
395
+ return _c("div", {}, [_c("v-nodes", { attrs: { "vnodes": menu } }), _vm.creatable ? _c("Divider", { staticClass: "my-1" }) : _vm._e(), _vm.creatable ? _c("div", { staticClass: "flex justify-end px-3 py-1" }, [_c("Button", { attrs: { "size": "small" }, on: { "click": _vm.handleProfileCreate } }, [_vm._v("Create new profile")])], 1) : _vm._e()], 1);
390
396
  } }]) }, "Select", _vm.$attrs, false), _vm.$listeners), _vm._l(_vm.source, function(v) {
391
397
  return _c("Option", { key: v.id, attrs: { "value": v.id } }, [_c("ProfileSelectItem", { attrs: { "source": v } })], 1);
392
398
  }), 1);
@@ -402,13 +408,15 @@ function __vue2_injectStyles$b(context) {
402
408
  var ProfileSelector = /* @__PURE__ */ function() {
403
409
  return __component__$b.exports;
404
410
  }();
405
- function useProfiles(keywords) {
411
+ function useProfiles(keywords, onlyRole, profileIds) {
406
412
  const me = useMe();
407
413
  const { result, loading } = useQuery(profilesQuery, () => {
408
414
  var _a2;
409
415
  return {
410
416
  lawFirmId: (_a2 = me.value) == null ? void 0 : _a2.lawFirmId,
411
- keywords: keywords.value
417
+ keywords: keywords.value,
418
+ profileType: onlyRole.value,
419
+ profileIds: profileIds.value
412
420
  };
413
421
  }, () => ({
414
422
  enabled: me.value != null
@@ -421,14 +429,32 @@ var __vue2_script$a = defineComponent({
421
429
  props: {
422
430
  value: {
423
431
  type: Object
432
+ },
433
+ creatable: {
434
+ type: Boolean,
435
+ default: false
436
+ },
437
+ onlyRole: {
438
+ type: String
439
+ },
440
+ preLoaded: {
441
+ type: Array,
442
+ default: []
443
+ },
444
+ profileIds: {
445
+ type: Array
424
446
  }
425
447
  },
426
- setup(_, { emit }) {
448
+ setup(props, { emit }) {
427
449
  const keywords = ref$1("");
428
450
  const handleSearch = (value) => keywords.value = value;
429
- const { profiles: rawProfiles } = useProfiles(keywords);
451
+ const { onlyRole, profileIds } = toRefs$1(props);
452
+ const { profiles: rawProfiles } = useProfiles(keywords, onlyRole, profileIds);
430
453
  const createdProfile = ref$1();
431
- const profiles = computed(() => createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value);
454
+ const profiles = computed(() => [
455
+ ...props.preLoaded,
456
+ ...createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value
457
+ ]);
432
458
  const isModalVisible = ref$1(false);
433
459
  const toggleModal = (value) => isModalVisible.value = value;
434
460
  const updateValue = (value) => emit("input", value);
@@ -451,11 +477,11 @@ var render$a = function() {
451
477
  var _vm = this;
452
478
  var _h = _vm.$createElement;
453
479
  var _c = _vm._self._c || _h;
454
- return _c("div", [_c("profile-selector", _vm._g(_vm._b({ attrs: { "source": _vm.profiles, "value": _vm.value, "keywords": _vm.keywords }, on: { "search": _vm.handleSearch, "create-profile": function($event) {
480
+ return _c("div", [_c("profile-selector", _vm._g(_vm._b({ attrs: { "source": _vm.profiles, "value": _vm.value, "keywords": _vm.keywords, "creatable": _vm.creatable }, on: { "search": _vm.handleSearch, "create-profile": function($event) {
455
481
  return _vm.toggleModal(true);
456
- }, "input": _vm.updateValue } }, "profile-selector", _vm.$attrs, false), _vm.$listeners)), _c("profile-create-modal", { attrs: { "visible": _vm.isModalVisible }, on: { "cancel": function($event) {
482
+ }, "input": _vm.updateValue } }, "profile-selector", _vm.$attrs, false), _vm.$listeners)), _vm.creatable ? _c("profile-create-modal", { attrs: { "visible": _vm.isModalVisible }, on: { "cancel": function($event) {
457
483
  return _vm.toggleModal(false);
458
- }, "profile-created": _vm.handleProfileCreated } })], 1);
484
+ }, "profile-created": _vm.handleProfileCreated } }) : _vm._e()], 1);
459
485
  };
460
486
  var staticRenderFns$a = [];
461
487
  const __cssModules$a = {};
@@ -6250,60 +6276,108 @@ async function getLanguageMessage(lang) {
6250
6276
  }
6251
6277
  return loaded.get(lang);
6252
6278
  }
6253
- var index = [
6254
- {
6255
- id: 145,
6256
- displayName: "I-485",
6257
- isSmart: true,
6258
- roles: ["Preparer", "Beneficiary"]
6259
- },
6260
- {
6261
- id: 144,
6262
- displayName: "I-129-H-Company",
6263
- isSmart: true,
6264
- roles: ["Preparer", "Petitioner", "Beneficiary"]
6265
- },
6266
- {
6267
- id: 143,
6268
- displayName: "I-129-Attachment",
6269
- isSmart: true,
6270
- roles: ["Preparer", "Beneficiary"]
6271
- },
6272
- {
6273
- id: 142,
6274
- displayName: "I-131",
6275
- isSmart: true,
6276
- roles: ["Preparer", "Beneficiary"]
6277
- },
6278
- {
6279
- id: 141,
6280
- displayName: "I-864",
6281
- isSmart: true,
6282
- roles: ["Preparer", "Petitioner", "Beneficiary"]
6283
- },
6284
- {
6285
- id: 131,
6286
- displayName: "I-130",
6287
- isSmart: true,
6288
- roles: ["Preparer", "Beneficiary"]
6289
- },
6290
- {
6291
- id: 130,
6292
- displayName: "G-28-Person",
6293
- isSmart: true,
6294
- roles: ["Preparer", "Petitioner", "Beneficiary"]
6295
- },
6296
- {
6297
- id: 129,
6298
- displayName: "I-130A",
6299
- isSmart: true,
6300
- roles: ["Preparer", "Beneficiary"]
6301
- },
6302
- {
6303
- id: 126,
6304
- displayName: "G-1145",
6305
- isSmart: true,
6306
- roles: ["Preparer", "Petitioner", "Beneficiary"]
6279
+ const createForm = (form) => form;
6280
+ var g1145 = createForm({
6281
+ displayName: "G-1145",
6282
+ roles: {
6283
+ Petitioner: "USERPROFILE",
6284
+ Beneficiary: "USERPROFILE",
6285
+ Preparer: "PREPARERPROFILE"
6286
+ }
6287
+ });
6288
+ var g28 = createForm({
6289
+ displayName: "G-28",
6290
+ roles: {
6291
+ Petitioner: "USERPROFILE",
6292
+ Beneficiary: "USERPROFILE",
6293
+ Preparer: "PREPARERPROFILE"
6294
+ }
6295
+ });
6296
+ var i129Attachment = createForm({
6297
+ displayName: "I-129 Attachment",
6298
+ roles: {
6299
+ Beneficiary: "USERPROFILE"
6307
6300
  }
6301
+ });
6302
+ var i129Mh = createForm({
6303
+ displayName: "I-129_Main with H supplement",
6304
+ roles: {
6305
+ Petitioner: "CLIENTPROFILE",
6306
+ Beneficiary: "USERPROFILE",
6307
+ Preparer: "PREPARERPROFILE"
6308
+ }
6309
+ });
6310
+ var i130 = createForm({
6311
+ displayName: "I-130",
6312
+ roles: {
6313
+ Petitioner: "USERPROFILE",
6314
+ Beneficiary: "USERPROFILE",
6315
+ Preparer: "CLIENTPROFILE"
6316
+ }
6317
+ });
6318
+ var i130a = createForm({
6319
+ displayName: "I-130A",
6320
+ roles: {
6321
+ Beneficiary: "USERPROFILE",
6322
+ Preparer: "CLIENTPROFILE"
6323
+ }
6324
+ });
6325
+ var i131 = createForm({
6326
+ displayName: "I-131",
6327
+ roles: {
6328
+ Beneficiary: "USERPROFILE",
6329
+ Preparer: "PREPARERPROFILE"
6330
+ }
6331
+ });
6332
+ var i485 = createForm({
6333
+ displayName: "I-485",
6334
+ roles: {
6335
+ Beneficiary: "USERPROFILE",
6336
+ Preparer: "PREPARERPROFILE"
6337
+ }
6338
+ });
6339
+ var i485a = createForm({
6340
+ displayName: "I-485A",
6341
+ roles: {
6342
+ Beneficiary: "USERPROFILE",
6343
+ Preparer: "PREPARERPROFILE"
6344
+ }
6345
+ });
6346
+ var i765 = createForm({
6347
+ displayName: "I-765",
6348
+ roles: {
6349
+ Beneficiary: "USERPROFILE",
6350
+ Preparer: "PREPARERPROFILE"
6351
+ }
6352
+ });
6353
+ var i864 = createForm({
6354
+ displayName: "I-864",
6355
+ roles: {
6356
+ Petitioner: "USERPROFILE",
6357
+ Beneficiary: "USERPROFILE",
6358
+ Preparer: "PREPARERPROFILE"
6359
+ }
6360
+ });
6361
+ var i864a = createForm({
6362
+ displayName: "I-864A",
6363
+ roles: {
6364
+ Petitioner: "USERPROFILE",
6365
+ Beneficiary: "USERPROFILE",
6366
+ Preparer: "PREPARERPROFILE"
6367
+ }
6368
+ });
6369
+ var index = [
6370
+ g28,
6371
+ g1145,
6372
+ i129Attachment,
6373
+ i129Mh,
6374
+ i130,
6375
+ i130a,
6376
+ i131,
6377
+ i485,
6378
+ i485a,
6379
+ i765,
6380
+ i864,
6381
+ i864a
6308
6382
  ];
6309
6383
  export { NewTask, index$3 as ProfileSelect, index$2 as TaskCart, TaskForm, TaskTemplateFilter, index$1 as TestComponent, index as forms, getLanguageMessage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ailaw/venus",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],