@ailaw/venus 1.75.0 → 1.76.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 +19 -1
  2. package/package.json +1 -1
package/dist/venus.es.js CHANGED
@@ -496,19 +496,37 @@ var __vue2_script$f = defineComponent({
496
496
  disabledProfile: {
497
497
  type: Boolean,
498
498
  default: void 0
499
+ },
500
+ priorities: {
501
+ type: Array,
502
+ default: []
499
503
  }
500
504
  },
501
505
  setup(props, { emit }) {
502
506
  const keywords = ref("");
503
507
  const handleSearch = (value) => keywords.value = value;
504
- const { onlyRole, roleTypes, profileIds, disabledProfile } = toRefs(props);
508
+ const { onlyRole, roleTypes, profileIds, disabledProfile, priorities } = toRefs(props);
505
509
  const { profiles: rawProfiles } = useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile);
506
510
  const createdProfile = ref();
507
511
  const profiles = computed(() => {
512
+ var _a;
508
513
  const list = [
509
514
  ...props.preLoaded,
510
515
  ...createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value
511
516
  ];
517
+ if ((_a = priorities.value) == null ? void 0 : _a.length) {
518
+ const priority = [];
519
+ priorities.value.forEach((pId) => {
520
+ const target = list.find(({ id }) => pId === id);
521
+ if (target) {
522
+ priority.push(target);
523
+ }
524
+ });
525
+ return uniqBy(prop("id"), [
526
+ ...priority,
527
+ ...list.filter(({ id }) => priority.every(({ id: pId }) => id !== pId))
528
+ ]);
529
+ }
512
530
  return uniqBy(prop("id"), list);
513
531
  });
514
532
  const enabledTypes = computed(() => (onlyRole == null ? void 0 : onlyRole.value) ? [onlyRole.value] : void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ailaw/venus",
3
- "version": "1.75.0",
3
+ "version": "1.76.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],