@conduction/nextcloud-vue 2.146.0 → 2.147.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/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +68 -9
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +37 -13
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +2 -2
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +83 -71
- package/dist/esm/utils/objectParties.js +30 -1
- package/dist/esm/utils/objectParties.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +193 -81
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +83 -71
- package/package.json +1 -1
- package/src/components/CnFactsWidget/CnFactsWidget.vue +96 -9
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +2 -1
- package/src/utils/objectParties.js +29 -0
|
@@ -40581,17 +40581,22 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40581
40581
|
}
|
|
40582
40582
|
|
|
40583
40583
|
|
|
40584
|
-
.cn-facts-widget[data-v-
|
|
40584
|
+
.cn-facts-widget[data-v-6351bc64] {
|
|
40585
40585
|
display: flex;
|
|
40586
40586
|
flex-direction: column;
|
|
40587
40587
|
gap: 10px;
|
|
40588
40588
|
min-width: 0;
|
|
40589
40589
|
}
|
|
40590
|
+
.cn-facts-widget__pills[data-v-6351bc64] {
|
|
40591
|
+
display: flex;
|
|
40592
|
+
flex-wrap: wrap;
|
|
40593
|
+
gap: 8px;
|
|
40594
|
+
}
|
|
40590
40595
|
|
|
40591
40596
|
/* `padding: 0`: Nextcloud's core stylesheet pads every `dl` 12px at the top
|
|
40592
40597
|
and bottom, which put a side card's facts 24px under its title, against
|
|
40593
40598
|
the board's 12 (DqZaak "Behandeling", DqZaakDocumenten). */
|
|
40594
|
-
.cn-facts-widget__rows[data-v-
|
|
40599
|
+
.cn-facts-widget__rows[data-v-6351bc64] {
|
|
40595
40600
|
display: grid;
|
|
40596
40601
|
grid-template-columns: max-content 1fr;
|
|
40597
40602
|
gap: 8px 16px;
|
|
@@ -40601,17 +40606,17 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40601
40606
|
}
|
|
40602
40607
|
|
|
40603
40608
|
/* Each row is a grid of its own children: the wrapper takes no box. */
|
|
40604
|
-
.cn-facts-widget__row[data-v-
|
|
40609
|
+
.cn-facts-widget__row[data-v-6351bc64] {
|
|
40605
40610
|
display: contents;
|
|
40606
40611
|
}
|
|
40607
|
-
.cn-facts-widget__row--inline[data-v-
|
|
40612
|
+
.cn-facts-widget__row--inline[data-v-6351bc64] {
|
|
40608
40613
|
display: flex;
|
|
40609
40614
|
grid-column: 1 / -1;
|
|
40610
40615
|
flex-wrap: wrap;
|
|
40611
40616
|
align-items: center;
|
|
40612
40617
|
gap: 10px;
|
|
40613
40618
|
}
|
|
40614
|
-
.cn-facts-widget__row--inline .cn-facts-widget__value[data-v-
|
|
40619
|
+
.cn-facts-widget__row--inline .cn-facts-widget__value[data-v-6351bc64] {
|
|
40615
40620
|
display: flex;
|
|
40616
40621
|
flex-wrap: wrap;
|
|
40617
40622
|
align-items: center;
|
|
@@ -40623,14 +40628,14 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40623
40628
|
12px around both and widened the label column to 130px. The class is
|
|
40624
40629
|
doubled so these resets outrank that rule, and a dossiq-style `:deep()`
|
|
40625
40630
|
override in an app is not needed. */
|
|
40626
|
-
.cn-facts-widget__label.cn-facts-widget__label[data-v-
|
|
40631
|
+
.cn-facts-widget__label.cn-facts-widget__label[data-v-6351bc64] {
|
|
40627
40632
|
width: auto;
|
|
40628
40633
|
margin: 0;
|
|
40629
40634
|
padding: 0;
|
|
40630
40635
|
text-align: start;
|
|
40631
40636
|
color: var(--color-text-maxcontrast);
|
|
40632
40637
|
}
|
|
40633
|
-
.cn-facts-widget__value.cn-facts-widget__value[data-v-
|
|
40638
|
+
.cn-facts-widget__value.cn-facts-widget__value[data-v-6351bc64] {
|
|
40634
40639
|
margin: 0;
|
|
40635
40640
|
padding: 0;
|
|
40636
40641
|
text-align: start;
|
|
@@ -40638,56 +40643,56 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40638
40643
|
min-width: 0;
|
|
40639
40644
|
overflow-wrap: anywhere;
|
|
40640
40645
|
}
|
|
40641
|
-
.cn-facts-widget__title[data-v-
|
|
40646
|
+
.cn-facts-widget__title[data-v-6351bc64] {
|
|
40642
40647
|
font-size: 15px;
|
|
40643
40648
|
font-weight: 600;
|
|
40644
40649
|
color: var(--color-main-text);
|
|
40645
40650
|
}
|
|
40646
|
-
.cn-facts-widget__line[data-v-
|
|
40651
|
+
.cn-facts-widget__line[data-v-6351bc64] {
|
|
40647
40652
|
font-size: 13px;
|
|
40648
40653
|
color: var(--color-text-maxcontrast);
|
|
40649
40654
|
}
|
|
40650
|
-
.cn-facts-widget__meter[data-v-
|
|
40655
|
+
.cn-facts-widget__meter[data-v-6351bc64] {
|
|
40651
40656
|
display: flex;
|
|
40652
40657
|
flex-direction: column;
|
|
40653
40658
|
gap: 4px;
|
|
40654
40659
|
font-size: 14px;
|
|
40655
40660
|
}
|
|
40656
|
-
.cn-facts-widget__meter-head[data-v-
|
|
40661
|
+
.cn-facts-widget__meter-head[data-v-6351bc64] {
|
|
40657
40662
|
display: flex;
|
|
40658
40663
|
justify-content: space-between;
|
|
40659
40664
|
gap: 16px;
|
|
40660
40665
|
}
|
|
40661
|
-
.cn-facts-widget__meter-label[data-v-
|
|
40666
|
+
.cn-facts-widget__meter-label[data-v-6351bc64] {
|
|
40662
40667
|
color: var(--color-text-maxcontrast);
|
|
40663
40668
|
}
|
|
40664
|
-
.cn-facts-widget__meter-value[data-v-
|
|
40669
|
+
.cn-facts-widget__meter-value[data-v-6351bc64] {
|
|
40665
40670
|
font-weight: 500;
|
|
40666
40671
|
text-align: end;
|
|
40667
40672
|
}
|
|
40668
|
-
.cn-facts-widget__meter-track[data-v-
|
|
40673
|
+
.cn-facts-widget__meter-track[data-v-6351bc64] {
|
|
40669
40674
|
height: 6px;
|
|
40670
40675
|
border-radius: 3px;
|
|
40671
40676
|
background: var(--color-background-darker);
|
|
40672
40677
|
overflow: hidden;
|
|
40673
40678
|
}
|
|
40674
|
-
.cn-facts-widget__meter-bar[data-v-
|
|
40679
|
+
.cn-facts-widget__meter-bar[data-v-6351bc64] {
|
|
40675
40680
|
display: block;
|
|
40676
40681
|
height: 100%;
|
|
40677
40682
|
border-radius: inherit;
|
|
40678
40683
|
background: var(--color-primary-element);
|
|
40679
40684
|
}
|
|
40680
|
-
.cn-facts-widget__meter--over .cn-facts-widget__meter-value[data-v-
|
|
40685
|
+
.cn-facts-widget__meter--over .cn-facts-widget__meter-value[data-v-6351bc64] {
|
|
40681
40686
|
color: var(--color-error-text);
|
|
40682
40687
|
}
|
|
40683
|
-
.cn-facts-widget__meter--over .cn-facts-widget__meter-bar[data-v-
|
|
40688
|
+
.cn-facts-widget__meter--over .cn-facts-widget__meter-bar[data-v-6351bc64] {
|
|
40684
40689
|
background: var(--color-error);
|
|
40685
40690
|
}
|
|
40686
|
-
.cn-facts-widget__muted[data-v-
|
|
40691
|
+
.cn-facts-widget__muted[data-v-6351bc64] {
|
|
40687
40692
|
margin: 0;
|
|
40688
40693
|
color: var(--color-text-maxcontrast);
|
|
40689
40694
|
}
|
|
40690
|
-
.cn-facts-widget__label .hidden-visually[data-v-
|
|
40695
|
+
.cn-facts-widget__label .hidden-visually[data-v-6351bc64] {
|
|
40691
40696
|
clip-path: inset(50%);
|
|
40692
40697
|
height: 1px;
|
|
40693
40698
|
overflow: hidden;
|
|
@@ -40695,27 +40700,27 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40695
40700
|
white-space: nowrap;
|
|
40696
40701
|
width: 1px;
|
|
40697
40702
|
}
|
|
40698
|
-
.cn-facts-widget__label--icon[data-v-
|
|
40703
|
+
.cn-facts-widget__label--icon[data-v-6351bc64] {
|
|
40699
40704
|
align-items: center;
|
|
40700
40705
|
display: flex;
|
|
40701
40706
|
}
|
|
40702
|
-
.cn-facts-widget__value-link[data-v-
|
|
40707
|
+
.cn-facts-widget__value-link[data-v-6351bc64] {
|
|
40703
40708
|
color: var(--color-primary-element);
|
|
40704
40709
|
text-decoration: underline;
|
|
40705
40710
|
}
|
|
40706
|
-
.cn-facts-widget__inline-button[data-v-
|
|
40707
|
-
.cn-facts-widget__icon-button[data-v-
|
|
40708
|
-
.cn-facts-widget__action[data-v-
|
|
40711
|
+
.cn-facts-widget__inline-button[data-v-6351bc64],
|
|
40712
|
+
.cn-facts-widget__icon-button[data-v-6351bc64],
|
|
40713
|
+
.cn-facts-widget__action[data-v-6351bc64] {
|
|
40709
40714
|
align-items: center;
|
|
40710
40715
|
cursor: pointer;
|
|
40711
40716
|
display: inline-flex;
|
|
40712
40717
|
font: inherit;
|
|
40713
40718
|
}
|
|
40714
|
-
.cn-facts-widget__reveal-error[data-v-
|
|
40719
|
+
.cn-facts-widget__reveal-error[data-v-6351bc64] {
|
|
40715
40720
|
font-size: 13px;
|
|
40716
40721
|
color: var(--color-text-error, var(--color-error));
|
|
40717
40722
|
}
|
|
40718
|
-
.cn-facts-widget__inline-button[data-v-
|
|
40723
|
+
.cn-facts-widget__inline-button[data-v-6351bc64] {
|
|
40719
40724
|
background: var(--color-main-background);
|
|
40720
40725
|
border: 1px solid var(--color-border-dark);
|
|
40721
40726
|
border-radius: 16px;
|
|
@@ -40727,7 +40732,7 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40727
40732
|
min-height: 30px;
|
|
40728
40733
|
padding: 0 10px;
|
|
40729
40734
|
}
|
|
40730
|
-
.cn-facts-widget__icon-button[data-v-
|
|
40735
|
+
.cn-facts-widget__icon-button[data-v-6351bc64] {
|
|
40731
40736
|
background: transparent;
|
|
40732
40737
|
border: 0;
|
|
40733
40738
|
border-radius: 6px;
|
|
@@ -40736,23 +40741,23 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40736
40741
|
padding: 2px;
|
|
40737
40742
|
vertical-align: middle;
|
|
40738
40743
|
}
|
|
40739
|
-
.cn-facts-widget__icon-button[data-v-
|
|
40740
|
-
.cn-facts-widget__icon-button[data-v-
|
|
40744
|
+
.cn-facts-widget__icon-button[data-v-6351bc64]:hover,
|
|
40745
|
+
.cn-facts-widget__icon-button[data-v-6351bc64]:focus-visible {
|
|
40741
40746
|
background: var(--color-background-hover);
|
|
40742
40747
|
color: var(--color-main-text);
|
|
40743
40748
|
}
|
|
40744
|
-
.cn-facts-widget__text[data-v-
|
|
40749
|
+
.cn-facts-widget__text[data-v-6351bc64] {
|
|
40745
40750
|
color: var(--color-main-text);
|
|
40746
40751
|
font-size: 15px;
|
|
40747
40752
|
}
|
|
40748
40753
|
|
|
40749
40754
|
/* A lead: an icon tile or initials beside a bold title and a muted subtitle. */
|
|
40750
|
-
.cn-facts-widget__lead[data-v-
|
|
40755
|
+
.cn-facts-widget__lead[data-v-6351bc64] {
|
|
40751
40756
|
align-items: center;
|
|
40752
40757
|
display: flex;
|
|
40753
40758
|
gap: 12px;
|
|
40754
40759
|
}
|
|
40755
|
-
.cn-facts-widget__lead-tile[data-v-
|
|
40760
|
+
.cn-facts-widget__lead-tile[data-v-6351bc64] {
|
|
40756
40761
|
align-items: center;
|
|
40757
40762
|
background: var(--color-background-dark);
|
|
40758
40763
|
border-radius: 8px;
|
|
@@ -40767,32 +40772,32 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40767
40772
|
}
|
|
40768
40773
|
|
|
40769
40774
|
/* Initials stand for a person: round, as an avatar. */
|
|
40770
|
-
.cn-facts-widget__lead-tile--initials[data-v-
|
|
40775
|
+
.cn-facts-widget__lead-tile--initials[data-v-6351bc64] {
|
|
40771
40776
|
border-radius: 50%;
|
|
40772
40777
|
}
|
|
40773
|
-
.cn-facts-widget__lead-tile--success[data-v-
|
|
40778
|
+
.cn-facts-widget__lead-tile--success[data-v-6351bc64] {
|
|
40774
40779
|
background: color-mix(in srgb, var(--color-success) 14%, var(--color-main-background));
|
|
40775
40780
|
border-radius: 50%;
|
|
40776
40781
|
color: var(--color-success-text, var(--color-success));
|
|
40777
40782
|
}
|
|
40778
|
-
.cn-facts-widget__lead-tile--info[data-v-
|
|
40783
|
+
.cn-facts-widget__lead-tile--info[data-v-6351bc64] {
|
|
40779
40784
|
background: var(--color-primary-element-light);
|
|
40780
40785
|
border-radius: 50%;
|
|
40781
40786
|
color: var(--color-primary-element-light-text, var(--color-primary-element));
|
|
40782
40787
|
}
|
|
40783
|
-
.cn-facts-widget__lead-text[data-v-
|
|
40788
|
+
.cn-facts-widget__lead-text[data-v-6351bc64] {
|
|
40784
40789
|
display: flex;
|
|
40785
40790
|
flex-direction: column;
|
|
40786
40791
|
min-width: 0;
|
|
40787
40792
|
}
|
|
40788
|
-
.cn-facts-widget__lead-title[data-v-
|
|
40793
|
+
.cn-facts-widget__lead-title[data-v-6351bc64] {
|
|
40789
40794
|
font-size: 15px;
|
|
40790
40795
|
}
|
|
40791
|
-
.cn-facts-widget__lead-subtitle[data-v-
|
|
40796
|
+
.cn-facts-widget__lead-subtitle[data-v-6351bc64] {
|
|
40792
40797
|
color: var(--color-text-maxcontrast);
|
|
40793
40798
|
font-size: 13px;
|
|
40794
40799
|
}
|
|
40795
|
-
.cn-facts-widget__action[data-v-
|
|
40800
|
+
.cn-facts-widget__action[data-v-6351bc64] {
|
|
40796
40801
|
align-self: flex-start;
|
|
40797
40802
|
background: var(--color-primary-element-light);
|
|
40798
40803
|
border: 0;
|
|
@@ -40804,20 +40809,27 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40804
40809
|
min-height: 32px;
|
|
40805
40810
|
padding: 0 14px;
|
|
40806
40811
|
}
|
|
40807
|
-
.cn-facts-widget__action[data-v-
|
|
40808
|
-
.cn-facts-widget__action[data-v-
|
|
40812
|
+
.cn-facts-widget__action[data-v-6351bc64]:hover,
|
|
40813
|
+
.cn-facts-widget__action[data-v-6351bc64]:focus-visible {
|
|
40809
40814
|
background: var(--color-primary-element-light-hover, var(--color-primary-element-light));
|
|
40810
40815
|
}
|
|
40811
|
-
.cn-facts-widget__notice[data-v-
|
|
40816
|
+
.cn-facts-widget__notice[data-v-6351bc64] {
|
|
40812
40817
|
margin: 4px 0 0;
|
|
40813
40818
|
}
|
|
40814
|
-
|
|
40819
|
+
|
|
40820
|
+
/* A div, not a p: a theme sets every paragraph's size with !important. */
|
|
40821
|
+
.cn-facts-widget__footnote[data-v-6351bc64] {
|
|
40822
|
+
color: var(--color-text-maxcontrast);
|
|
40823
|
+
font-size: 13px;
|
|
40824
|
+
line-height: 1.2;
|
|
40825
|
+
}
|
|
40826
|
+
.cn-facts-widget__link[data-v-6351bc64] {
|
|
40815
40827
|
font-size: 14px;
|
|
40816
40828
|
font-weight: 600;
|
|
40817
40829
|
color: var(--color-primary-element);
|
|
40818
40830
|
text-decoration: underline;
|
|
40819
40831
|
}
|
|
40820
|
-
.cn-facts-widget__link--button[data-v-
|
|
40832
|
+
.cn-facts-widget__link--button[data-v-6351bc64] {
|
|
40821
40833
|
display: inline-flex;
|
|
40822
40834
|
align-items: center;
|
|
40823
40835
|
gap: 6px;
|
|
@@ -40832,12 +40844,12 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40832
40844
|
|
|
40833
40845
|
/* `columns: 2` (board DqContact): two columns, the label above the value, a
|
|
40834
40846
|
hairline under each fact; one column on a phone. */
|
|
40835
|
-
.cn-facts-widget__rows--columns[data-v-
|
|
40847
|
+
.cn-facts-widget__rows--columns[data-v-6351bc64] {
|
|
40836
40848
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
40837
40849
|
gap: 14px 24px;
|
|
40838
40850
|
font-size: 15px;
|
|
40839
40851
|
}
|
|
40840
|
-
.cn-facts-widget__rows--columns .cn-facts-widget__row[data-v-
|
|
40852
|
+
.cn-facts-widget__rows--columns .cn-facts-widget__row[data-v-6351bc64] {
|
|
40841
40853
|
display: flex;
|
|
40842
40854
|
flex-direction: column;
|
|
40843
40855
|
gap: 3px;
|
|
@@ -40845,21 +40857,21 @@ a.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name[data-v-76cc4
|
|
|
40845
40857
|
padding-bottom: 10px;
|
|
40846
40858
|
border-bottom: 1px solid var(--color-border);
|
|
40847
40859
|
}
|
|
40848
|
-
.cn-facts-widget__rows--columns .cn-facts-widget__label.cn-facts-widget__label[data-v-
|
|
40860
|
+
.cn-facts-widget__rows--columns .cn-facts-widget__label.cn-facts-widget__label[data-v-6351bc64] {
|
|
40849
40861
|
font-size: 13px;
|
|
40850
40862
|
}
|
|
40851
40863
|
|
|
40852
40864
|
/* One column, label above value: 2px under its label, 10px to the next
|
|
40853
40865
|
label, so a long label never squeezes its value (DqHandhaving). */
|
|
40854
|
-
.cn-facts-widget__rows--stacked[data-v-
|
|
40866
|
+
.cn-facts-widget__rows--stacked[data-v-6351bc64] {
|
|
40855
40867
|
grid-template-columns: minmax(0, 1fr);
|
|
40856
40868
|
gap: 2px 0;
|
|
40857
40869
|
}
|
|
40858
|
-
.cn-facts-widget__rows--stacked .cn-facts-widget__value.cn-facts-widget__value[data-v-
|
|
40870
|
+
.cn-facts-widget__rows--stacked .cn-facts-widget__value.cn-facts-widget__value[data-v-6351bc64] {
|
|
40859
40871
|
margin-bottom: 8px;
|
|
40860
40872
|
}
|
|
40861
40873
|
@media (max-width: 640px) {
|
|
40862
|
-
.cn-facts-widget__rows--columns[data-v-
|
|
40874
|
+
.cn-facts-widget__rows--columns[data-v-6351bc64] {
|
|
40863
40875
|
grid-template-columns: minmax(0, 1fr);
|
|
40864
40876
|
}
|
|
40865
40877
|
}
|
|
@@ -43456,22 +43468,22 @@ a.cn-record-list__inline-title[data-v-59c81065] {
|
|
|
43456
43468
|
}
|
|
43457
43469
|
|
|
43458
43470
|
|
|
43459
|
-
.cn-object-parties[data-v-
|
|
43471
|
+
.cn-object-parties[data-v-24a3d77a] {
|
|
43460
43472
|
display: flex;
|
|
43461
43473
|
flex-direction: column;
|
|
43462
43474
|
gap: calc(var(--default-grid-baseline, 4px) * 3);
|
|
43463
43475
|
}
|
|
43464
|
-
.cn-object-parties__verdicts[data-v-
|
|
43476
|
+
.cn-object-parties__verdicts[data-v-24a3d77a] {
|
|
43465
43477
|
display: flex;
|
|
43466
43478
|
flex-direction: column;
|
|
43467
43479
|
gap: var(--default-grid-baseline, 4px);
|
|
43468
43480
|
}
|
|
43469
|
-
.cn-object-parties__role-label[data-v-
|
|
43481
|
+
.cn-object-parties__role-label[data-v-24a3d77a] {
|
|
43470
43482
|
margin: 0 0 var(--default-grid-baseline, 4px) 0;
|
|
43471
43483
|
color: var(--color-text-maxcontrast);
|
|
43472
43484
|
font-size: 0.9em;
|
|
43473
43485
|
}
|
|
43474
|
-
.cn-object-parties__list[data-v-
|
|
43486
|
+
.cn-object-parties__list[data-v-24a3d77a] {
|
|
43475
43487
|
display: flex;
|
|
43476
43488
|
flex-direction: column;
|
|
43477
43489
|
gap: var(--default-grid-baseline, 4px);
|
|
@@ -43479,7 +43491,7 @@ a.cn-record-list__inline-title[data-v-59c81065] {
|
|
|
43479
43491
|
padding: 0;
|
|
43480
43492
|
list-style: none;
|
|
43481
43493
|
}
|
|
43482
|
-
.cn-object-parties__party[data-v-
|
|
43494
|
+
.cn-object-parties__party[data-v-24a3d77a] {
|
|
43483
43495
|
display: flex;
|
|
43484
43496
|
flex-wrap: wrap;
|
|
43485
43497
|
align-items: center;
|
|
@@ -43487,33 +43499,33 @@ a.cn-record-list__inline-title[data-v-59c81065] {
|
|
|
43487
43499
|
padding: var(--default-grid-baseline, 4px);
|
|
43488
43500
|
border-radius: var(--border-radius, 4px);
|
|
43489
43501
|
}
|
|
43490
|
-
.cn-object-parties__party[data-v-
|
|
43502
|
+
.cn-object-parties__party[data-v-24a3d77a]:hover {
|
|
43491
43503
|
background-color: var(--color-background-hover);
|
|
43492
43504
|
}
|
|
43493
|
-
.cn-object-parties__name[data-v-
|
|
43505
|
+
.cn-object-parties__name[data-v-24a3d77a] {
|
|
43494
43506
|
font-weight: bold;
|
|
43495
43507
|
}
|
|
43496
|
-
.cn-object-parties__muted[data-v-
|
|
43508
|
+
.cn-object-parties__muted[data-v-24a3d77a] {
|
|
43497
43509
|
color: var(--color-text-maxcontrast);
|
|
43498
43510
|
}
|
|
43499
|
-
.cn-object-parties__manage[data-v-
|
|
43511
|
+
.cn-object-parties__manage[data-v-24a3d77a] {
|
|
43500
43512
|
display: flex;
|
|
43501
43513
|
justify-content: flex-end;
|
|
43502
43514
|
}
|
|
43503
|
-
.cn-object-parties__remove[data-v-
|
|
43515
|
+
.cn-object-parties__remove[data-v-24a3d77a] {
|
|
43504
43516
|
margin-inline-start: auto;
|
|
43505
43517
|
}
|
|
43506
|
-
.cn-object-parties__main-card[data-v-
|
|
43518
|
+
.cn-object-parties__main-card[data-v-24a3d77a] {
|
|
43507
43519
|
display: flex;
|
|
43508
43520
|
flex-direction: column;
|
|
43509
43521
|
gap: calc(var(--default-grid-baseline, 4px) * 3);
|
|
43510
43522
|
}
|
|
43511
|
-
.cn-object-parties__main[data-v-
|
|
43523
|
+
.cn-object-parties__main[data-v-24a3d77a] {
|
|
43512
43524
|
display: flex;
|
|
43513
43525
|
align-items: center;
|
|
43514
43526
|
gap: calc(var(--default-grid-baseline, 4px) * 3);
|
|
43515
43527
|
}
|
|
43516
|
-
.cn-object-parties__main-initials[data-v-
|
|
43528
|
+
.cn-object-parties__main-initials[data-v-24a3d77a] {
|
|
43517
43529
|
display: flex;
|
|
43518
43530
|
flex: none;
|
|
43519
43531
|
align-items: center;
|
|
@@ -43525,28 +43537,28 @@ a.cn-record-list__inline-title[data-v-59c81065] {
|
|
|
43525
43537
|
color: var(--color-main-text);
|
|
43526
43538
|
font-weight: 700;
|
|
43527
43539
|
}
|
|
43528
|
-
.cn-object-parties__main-text[data-v-
|
|
43540
|
+
.cn-object-parties__main-text[data-v-24a3d77a] {
|
|
43529
43541
|
display: flex;
|
|
43530
43542
|
flex-direction: column;
|
|
43531
43543
|
}
|
|
43532
|
-
.cn-object-parties__main-name[data-v-
|
|
43544
|
+
.cn-object-parties__main-name[data-v-24a3d77a] {
|
|
43533
43545
|
font-size: 15px;
|
|
43534
43546
|
}
|
|
43535
|
-
.cn-object-parties__main-role[data-v-
|
|
43547
|
+
.cn-object-parties__main-role[data-v-24a3d77a] {
|
|
43536
43548
|
font-size: 13px;
|
|
43537
43549
|
}
|
|
43538
|
-
.cn-object-parties__main-email[data-v-
|
|
43550
|
+
.cn-object-parties__main-email[data-v-24a3d77a] {
|
|
43539
43551
|
display: flex;
|
|
43540
43552
|
align-items: center;
|
|
43541
43553
|
gap: calc(var(--default-grid-baseline, 4px) * 2.5);
|
|
43542
43554
|
color: var(--color-main-text);
|
|
43543
43555
|
overflow-wrap: anywhere;
|
|
43544
43556
|
}
|
|
43545
|
-
.cn-object-parties__main-link[data-v-
|
|
43557
|
+
.cn-object-parties__main-link[data-v-24a3d77a] {
|
|
43546
43558
|
color: var(--color-primary-element);
|
|
43547
43559
|
font-weight: 600;
|
|
43548
43560
|
}
|
|
43549
|
-
.cn-object-parties__accepted[data-v-
|
|
43561
|
+
.cn-object-parties__accepted[data-v-24a3d77a] {
|
|
43550
43562
|
display: flex;
|
|
43551
43563
|
flex-wrap: wrap;
|
|
43552
43564
|
align-items: center;
|
|
@@ -43555,10 +43567,10 @@ a.cn-record-list__inline-title[data-v-59c81065] {
|
|
|
43555
43567
|
border-radius: var(--border-radius-large, 10px);
|
|
43556
43568
|
background-color: var(--color-background-hover);
|
|
43557
43569
|
}
|
|
43558
|
-
.cn-object-parties__accepted-label[data-v-
|
|
43570
|
+
.cn-object-parties__accepted-label[data-v-24a3d77a] {
|
|
43559
43571
|
font-weight: 600;
|
|
43560
43572
|
}
|
|
43561
|
-
.cn-object-parties__accepted-kind[data-v-
|
|
43573
|
+
.cn-object-parties__accepted-kind[data-v-24a3d77a] {
|
|
43562
43574
|
border: 1px solid var(--color-border-dark);
|
|
43563
43575
|
}
|
|
43564
43576
|
|
|
@@ -177,6 +177,35 @@ function kindCode(kind) {
|
|
|
177
177
|
return String(kind?.code || kind?.key || '')
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Whether a party's kind is among the kinds a record accepts. Two
|
|
182
|
+
* vocabularies meet here: the party's kind is its schema's (`person`,
|
|
183
|
+
* `organisation`, `colleague`), while the accepted kinds may be role kinds
|
|
184
|
+
* that name the identity shapes they take (pipelinq's `aanvrager` with
|
|
185
|
+
* `identityShapes: ["naturalPerson", "organization"]`). When the accepted
|
|
186
|
+
* kinds name shapes, the party's own kind is matched by the shapes the
|
|
187
|
+
* listing gives it; a kind that names none cannot be judged and passes.
|
|
188
|
+
* Otherwise the codes are compared.
|
|
189
|
+
*
|
|
190
|
+
* @param {string} partyKind The party's kind key.
|
|
191
|
+
* @param {Array<object>} accepted The accepted kinds.
|
|
192
|
+
* @param {Array<object>} own The listing's own kinds (`{ key, identityShapes? }`).
|
|
193
|
+
* @return {boolean} False only when the party is known not to fit.
|
|
194
|
+
* @spec openspec/changes/parties-accepted-kinds-by-shape/specs/object-parties/spec.md#requirement-a-party-is-checked-against-the-accepted-kinds-in-one-vocabulary
|
|
195
|
+
*/
|
|
196
|
+
function partyKindAccepted(partyKind, accepted, own) {
|
|
197
|
+
const kinds = Array.isArray(accepted) ? accepted : [];
|
|
198
|
+
const shapes = new Set(kinds.flatMap((kind) => (Array.isArray(kind?.identityShapes) ? kind.identityShapes : [])));
|
|
199
|
+
if (shapes.size === 0) {
|
|
200
|
+
return kinds.some((kind) => kindCode(kind) === partyKind)
|
|
201
|
+
}
|
|
202
|
+
const mine = (Array.isArray(own) ? own : []).find((kind) => kindCode(kind) === partyKind)?.identityShapes;
|
|
203
|
+
if (!Array.isArray(mine) || mine.length === 0) {
|
|
204
|
+
return true
|
|
205
|
+
}
|
|
206
|
+
return mine.some((shape) => shapes.has(shape))
|
|
207
|
+
}
|
|
208
|
+
|
|
180
209
|
/**
|
|
181
210
|
* Write a value at a dotted path, creating the objects on the way.
|
|
182
211
|
*
|
|
@@ -254,5 +283,5 @@ function savedUuid(saved) {
|
|
|
254
283
|
return String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')
|
|
255
284
|
}
|
|
256
285
|
|
|
257
|
-
export { documentsOfParty, indicatorVerdict, indicatorsOf, kindCode, newPartyRecord, partiesInOrder, representedByMap, roleLabel, rolesInOrder, savedUuid };
|
|
286
|
+
export { documentsOfParty, indicatorVerdict, indicatorsOf, kindCode, newPartyRecord, partiesInOrder, partyKindAccepted, representedByMap, roleLabel, rolesInOrder, savedUuid };
|
|
258
287
|
//# sourceMappingURL=objectParties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectParties.js","sources":["../../../src/utils/objectParties.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * objectParties — reading the parties of a record as OpenRegister's party\n * model answers them (`GET .../objects/{register}/{schema}/{id}/parties`:\n * `{ primary, roles, kinds, byRole, results }`, and `GET .../parties/{uuid}`\n * for one party with its indicators).\n *\n * Pure functions, so CnObjectPartiesWidget and its tests read one shape.\n *\n * @module utils/objectParties\n */\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { readPath } from './readPath.js'\n\n/**\n * What a role is called: the app's own word (`roleLabels`), else the label\n * the listing declares, else the key. `other` is a party with no role.\n *\n * @param {string} key The role key.\n * @param {Array<{key: string, label?: string}>} roles The roles the listing declares.\n * @param {Record<string, string>} [roleLabels] The app's words, by key.\n * @return {string} The label.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function roleLabel(key, roles, roleLabels = {}) {\n\tif (roleLabels && typeof roleLabels[key] === 'string' && roleLabels[key] !== '') {\n\t\treturn roleLabels[key]\n\t}\n\tconst declared = (roles || []).find((role) => role && role.key === key)\n\tif (declared && declared.label) {\n\t\treturn declared.label\n\t}\n\treturn key === 'other' ? t('nextcloud-vue', 'No role') : key\n}\n\n/**\n * The parties of one role, the primary party first.\n *\n * @param {Array<object>} parties The role's rows.\n * @param {string|null} primary The primary party's uuid.\n * @return {Array<object>} The rows.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function partiesInOrder(parties, primary) {\n\tconst rows = Array.isArray(parties) ? parties.filter(Boolean) : []\n\tif (!primary) {\n\t\treturn rows\n\t}\n\treturn [\n\t\t...rows.filter((row) => row.partyUuid === primary),\n\t\t...rows.filter((row) => row.partyUuid !== primary),\n\t]\n}\n\n/**\n * The roles of a listing as groups, the group holding the primary party first.\n *\n * @param {object|null} listing The `/parties` answer.\n * @param {Record<string, string>} [roleLabels] The app's words for the roles.\n * @return {Array<{key: string, label: string, parties: Array<object>}>} The groups.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function rolesInOrder(listing, roleLabels = {}) {\n\tif (!listing || typeof listing !== 'object') {\n\t\treturn []\n\t}\n\tconst byRole = listing.byRole && typeof listing.byRole === 'object' ? listing.byRole : {}\n\tconst primary = listing.primary || null\n\tconst groups = Object.keys(byRole).map((key) => ({\n\t\tkey,\n\t\tlabel: roleLabel(key, listing.roles, roleLabels),\n\t\tparties: partiesInOrder(byRole[key], primary),\n\t}))\n\tconst holdsPrimary = (group) => !!primary && group.parties.some((party) => party.partyUuid === primary)\n\treturn [...groups.filter(holdsPrimary), ...groups.filter((group) => !holdsPrimary(group))]\n}\n\n/**\n * What an indicator means for what may be done: an indicator always carries\n * its verdict, never a bare chip. `refuse-publication` and `refuse-send` are\n * blocking (`error`); anything else asks to be read first (`warning`).\n *\n * @param {object} indicator The indicator (`{ key, label, effect }`).\n * @param {object} [labels] The app's words: `verdictPublication`, `verdictSend`, `verdictWarn`.\n * @return {{effect: string, severity: string, label: string, verdict: string}} The verdict.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorVerdict(indicator, labels = {}) {\n\tconst effect = String(indicator?.effect || '').trim()\n\tconst label = String(indicator?.label || indicator?.key || '').trim()\n\tif (effect === 'refuse-publication') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictPublication || t('nextcloud-vue', 'Publishing a file on this record is refused') }\n\t}\n\tif (effect === 'refuse-send') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictSend || t('nextcloud-vue', 'A message to this party is refused') }\n\t}\n\treturn { effect: effect === '' ? 'warn' : effect, severity: 'warning', label, verdict: labels.verdictWarn || t('nextcloud-vue', 'Read this before acting on the record') }\n}\n\n/**\n * Every indicator on a set of parties, each knowing whose it is.\n *\n * @param {Array<object>} parties The party records.\n * @return {Array<object>} The indicators with `party` and `partyName`.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorsOf(parties) {\n\tconst found = []\n\tfor (const party of parties || []) {\n\t\tif (!party) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const indicator of Array.isArray(party.indicators) ? party.indicators : []) {\n\t\t\tif (indicator) {\n\t\t\t\tfound.push({ ...indicator, party: party.id || party.uuid || '', partyName: party.name || party.displayName || '' })\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}\n\n/**\n * Who represents whom: participant uuid to the uuid of the party it acts for,\n * read from role rows (`{ participant, representedParty }`).\n *\n * @param {Array<object>|null} rows The role rows.\n * @return {Record<string, string>} The map.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function representedByMap(rows) {\n\tconst map = {}\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst participant = String(row?.participant || '').trim()\n\t\tconst represented = String(row?.representedParty?.id || row?.representedParty || '').trim()\n\t\tif (participant !== '' && represented !== '') {\n\t\t\tmap[participant] = represented\n\t\t}\n\t}\n\treturn map\n}\n\n/**\n * The documents a party sent and received: sender is the party, or the party\n * is among the recipients.\n *\n * @param {Array<object>} documents The documents.\n * @param {string} identifier The party's uuid.\n * @param {{senderField?: string, recipientsField?: string}} [fields] Where a document names them.\n * @return {{sent: Array<object>, received: Array<object>}} The two lists.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function documentsOfParty(documents, identifier, fields = {}) {\n\tconst id = String(identifier || '').trim()\n\tconst rows = Array.isArray(documents) ? documents : []\n\tif (id === '') {\n\t\treturn { sent: [], received: [] }\n\t}\n\tconst sender = fields.senderField || 'sender'\n\tconst recipients = fields.recipientsField || 'recipients'\n\treturn {\n\t\tsent: rows.filter((row) => String(row?.[sender] || '').trim() === id),\n\t\treceived: rows.filter((row) => (Array.isArray(row?.[recipients]) ? row[recipients] : []).map((entry) => String(entry || '').trim()).includes(id)),\n\t}\n}\n\n/**\n * The code of a party kind (`code`, else `key`).\n *\n * @param {object} kind The kind.\n * @return {string} The code.\n */\nexport function kindCode(kind) {\n\treturn String(kind?.code || kind?.key || '')\n}\n\n/**\n * Write a value at a dotted path, creating the objects on the way.\n *\n * @param {object} target The object written into.\n * @param {string} path The dotted path (`name.surname`).\n * @param {unknown} value The value.\n * @return {void}\n */\nfunction writePath(target, path, value) {\n\tconst keys = String(path).split('.').filter((key) => key !== '')\n\tlet node = target\n\tkeys.slice(0, -1).forEach((key) => {\n\t\tif (!node[key] || typeof node[key] !== 'object') {\n\t\t\tnode[key] = {}\n\t\t}\n\t\tnode = node[key]\n\t})\n\tif (keys.length > 0) {\n\t\tnode[keys[keys.length - 1]] = value\n\t}\n}\n\n/**\n * The record a new party is saved as, from the fields a host declares.\n *\n * Each field `{ key, path?, address? }` writes its trimmed value at `path`\n * (default `key`); a field with `address: { path, kind, type }` instead adds\n * `{ kind, type, value }` to the list at that path, the shape OpenRegister's\n * party model reads as the party's addresses. `compose` names the paths a\n * derived field joins with a space, skipping the empty ones\n * (`{ displayName: [\"name.givenNames\", \"name.namePrefix\", \"name.surname\"] }`).\n * A field of `type: \"integer\"` is saved as a number when it reads as one.\n * An empty value is left out.\n *\n * @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.\n * @param {Record<string, string>} values The values by field key.\n * @return {object} The record.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function newPartyRecord(create, values) {\n\tconst record = {}\n\tfor (const field of Array.isArray(create?.fields) ? create.fields : []) {\n\t\tconst value = String(values?.[field?.key] ?? '').trim()\n\t\tif (!field || !field.key || value === '') {\n\t\t\tcontinue\n\t\t}\n\t\tif (field.address && field.address.path) {\n\t\t\tconst list = readPath(record, field.address.path)\n\t\t\tconst entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }\n\t\t\twritePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])\n\t\t\tcontinue\n\t\t}\n\t\twritePath(record, field.path || field.key, field.type === 'integer' && /^-?\\d+$/.test(value) ? Number(value) : value)\n\t}\n\tfor (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {\n\t\tconst joined = (Array.isArray(paths) ? paths : [])\n\t\t\t.map((path) => String(readPath(record, path) ?? '').trim())\n\t\t\t.filter((part) => part !== '')\n\t\t\t.join(' ')\n\t\tif (joined !== '') {\n\t\t\twritePath(record, target, joined)\n\t\t}\n\t}\n\treturn record\n}\n\n/**\n * The uuid a create answered with: `id`, `uuid` or `@self.id`.\n *\n * @param {object} saved The saved object.\n * @return {string} The uuid, or ''.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function savedUuid(saved) {\n\treturn String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')\n}\n"],"names":["t"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,EAAE,EAAE;AACvD,CAAC,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;AAClF,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC;AACxB,EAAE;AACF,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAC;AACxE,CAAC,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE;AACjC,EAAE,OAAO,QAAQ,CAAC,KAAK;AACvB,EAAE;AACF,CAAC,OAAO,GAAG,KAAK,OAAO,GAA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MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;AACnD,IAAI,GAAG,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9D,IAAI,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;AACjC,IAAI,IAAI,CAAC,GAAG,EAAC;AACb,EAAE,IAAI,MAAM,KAAK,EAAE,EAAE;AACrB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC;AACpC,GAAG;AACH,EAAE;AACF,CAAC,OAAO,MAAM;AACd,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,CAAC,OAAO,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,EAAE,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC;AACtE;;;;"}
|
|
1
|
+
{"version":3,"file":"objectParties.js","sources":["../../../src/utils/objectParties.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * objectParties — reading the parties of a record as OpenRegister's party\n * model answers them (`GET .../objects/{register}/{schema}/{id}/parties`:\n * `{ primary, roles, kinds, byRole, results }`, and `GET .../parties/{uuid}`\n * for one party with its indicators).\n *\n * Pure functions, so CnObjectPartiesWidget and its tests read one shape.\n *\n * @module utils/objectParties\n */\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { readPath } from './readPath.js'\n\n/**\n * What a role is called: the app's own word (`roleLabels`), else the label\n * the listing declares, else the key. `other` is a party with no role.\n *\n * @param {string} key The role key.\n * @param {Array<{key: string, label?: string}>} roles The roles the listing declares.\n * @param {Record<string, string>} [roleLabels] The app's words, by key.\n * @return {string} The label.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function roleLabel(key, roles, roleLabels = {}) {\n\tif (roleLabels && typeof roleLabels[key] === 'string' && roleLabels[key] !== '') {\n\t\treturn roleLabels[key]\n\t}\n\tconst declared = (roles || []).find((role) => role && role.key === key)\n\tif (declared && declared.label) {\n\t\treturn declared.label\n\t}\n\treturn key === 'other' ? t('nextcloud-vue', 'No role') : key\n}\n\n/**\n * The parties of one role, the primary party first.\n *\n * @param {Array<object>} parties The role's rows.\n * @param {string|null} primary The primary party's uuid.\n * @return {Array<object>} The rows.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function partiesInOrder(parties, primary) {\n\tconst rows = Array.isArray(parties) ? parties.filter(Boolean) : []\n\tif (!primary) {\n\t\treturn rows\n\t}\n\treturn [\n\t\t...rows.filter((row) => row.partyUuid === primary),\n\t\t...rows.filter((row) => row.partyUuid !== primary),\n\t]\n}\n\n/**\n * The roles of a listing as groups, the group holding the primary party first.\n *\n * @param {object|null} listing The `/parties` answer.\n * @param {Record<string, string>} [roleLabels] The app's words for the roles.\n * @return {Array<{key: string, label: string, parties: Array<object>}>} The groups.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function rolesInOrder(listing, roleLabels = {}) {\n\tif (!listing || typeof listing !== 'object') {\n\t\treturn []\n\t}\n\tconst byRole = listing.byRole && typeof listing.byRole === 'object' ? listing.byRole : {}\n\tconst primary = listing.primary || null\n\tconst groups = Object.keys(byRole).map((key) => ({\n\t\tkey,\n\t\tlabel: roleLabel(key, listing.roles, roleLabels),\n\t\tparties: partiesInOrder(byRole[key], primary),\n\t}))\n\tconst holdsPrimary = (group) => !!primary && group.parties.some((party) => party.partyUuid === primary)\n\treturn [...groups.filter(holdsPrimary), ...groups.filter((group) => !holdsPrimary(group))]\n}\n\n/**\n * What an indicator means for what may be done: an indicator always carries\n * its verdict, never a bare chip. `refuse-publication` and `refuse-send` are\n * blocking (`error`); anything else asks to be read first (`warning`).\n *\n * @param {object} indicator The indicator (`{ key, label, effect }`).\n * @param {object} [labels] The app's words: `verdictPublication`, `verdictSend`, `verdictWarn`.\n * @return {{effect: string, severity: string, label: string, verdict: string}} The verdict.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorVerdict(indicator, labels = {}) {\n\tconst effect = String(indicator?.effect || '').trim()\n\tconst label = String(indicator?.label || indicator?.key || '').trim()\n\tif (effect === 'refuse-publication') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictPublication || t('nextcloud-vue', 'Publishing a file on this record is refused') }\n\t}\n\tif (effect === 'refuse-send') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictSend || t('nextcloud-vue', 'A message to this party is refused') }\n\t}\n\treturn { effect: effect === '' ? 'warn' : effect, severity: 'warning', label, verdict: labels.verdictWarn || t('nextcloud-vue', 'Read this before acting on the record') }\n}\n\n/**\n * Every indicator on a set of parties, each knowing whose it is.\n *\n * @param {Array<object>} parties The party records.\n * @return {Array<object>} The indicators with `party` and `partyName`.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorsOf(parties) {\n\tconst found = []\n\tfor (const party of parties || []) {\n\t\tif (!party) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const indicator of Array.isArray(party.indicators) ? party.indicators : []) {\n\t\t\tif (indicator) {\n\t\t\t\tfound.push({ ...indicator, party: party.id || party.uuid || '', partyName: party.name || party.displayName || '' })\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}\n\n/**\n * Who represents whom: participant uuid to the uuid of the party it acts for,\n * read from role rows (`{ participant, representedParty }`).\n *\n * @param {Array<object>|null} rows The role rows.\n * @return {Record<string, string>} The map.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function representedByMap(rows) {\n\tconst map = {}\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst participant = String(row?.participant || '').trim()\n\t\tconst represented = String(row?.representedParty?.id || row?.representedParty || '').trim()\n\t\tif (participant !== '' && represented !== '') {\n\t\t\tmap[participant] = represented\n\t\t}\n\t}\n\treturn map\n}\n\n/**\n * The documents a party sent and received: sender is the party, or the party\n * is among the recipients.\n *\n * @param {Array<object>} documents The documents.\n * @param {string} identifier The party's uuid.\n * @param {{senderField?: string, recipientsField?: string}} [fields] Where a document names them.\n * @return {{sent: Array<object>, received: Array<object>}} The two lists.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function documentsOfParty(documents, identifier, fields = {}) {\n\tconst id = String(identifier || '').trim()\n\tconst rows = Array.isArray(documents) ? documents : []\n\tif (id === '') {\n\t\treturn { sent: [], received: [] }\n\t}\n\tconst sender = fields.senderField || 'sender'\n\tconst recipients = fields.recipientsField || 'recipients'\n\treturn {\n\t\tsent: rows.filter((row) => String(row?.[sender] || '').trim() === id),\n\t\treceived: rows.filter((row) => (Array.isArray(row?.[recipients]) ? row[recipients] : []).map((entry) => String(entry || '').trim()).includes(id)),\n\t}\n}\n\n/**\n * The code of a party kind (`code`, else `key`).\n *\n * @param {object} kind The kind.\n * @return {string} The code.\n */\nexport function kindCode(kind) {\n\treturn String(kind?.code || kind?.key || '')\n}\n\n/**\n * Whether a party's kind is among the kinds a record accepts. Two\n * vocabularies meet here: the party's kind is its schema's (`person`,\n * `organisation`, `colleague`), while the accepted kinds may be role kinds\n * that name the identity shapes they take (pipelinq's `aanvrager` with\n * `identityShapes: [\"naturalPerson\", \"organization\"]`). When the accepted\n * kinds name shapes, the party's own kind is matched by the shapes the\n * listing gives it; a kind that names none cannot be judged and passes.\n * Otherwise the codes are compared.\n *\n * @param {string} partyKind The party's kind key.\n * @param {Array<object>} accepted The accepted kinds.\n * @param {Array<object>} own The listing's own kinds (`{ key, identityShapes? }`).\n * @return {boolean} False only when the party is known not to fit.\n * @spec openspec/changes/parties-accepted-kinds-by-shape/specs/object-parties/spec.md#requirement-a-party-is-checked-against-the-accepted-kinds-in-one-vocabulary\n */\nexport function partyKindAccepted(partyKind, accepted, own) {\n\tconst kinds = Array.isArray(accepted) ? accepted : []\n\tconst shapes = new Set(kinds.flatMap((kind) => (Array.isArray(kind?.identityShapes) ? kind.identityShapes : [])))\n\tif (shapes.size === 0) {\n\t\treturn kinds.some((kind) => kindCode(kind) === partyKind)\n\t}\n\tconst mine = (Array.isArray(own) ? own : []).find((kind) => kindCode(kind) === partyKind)?.identityShapes\n\tif (!Array.isArray(mine) || mine.length === 0) {\n\t\treturn true\n\t}\n\treturn mine.some((shape) => shapes.has(shape))\n}\n\n/**\n * Write a value at a dotted path, creating the objects on the way.\n *\n * @param {object} target The object written into.\n * @param {string} path The dotted path (`name.surname`).\n * @param {unknown} value The value.\n * @return {void}\n */\nfunction writePath(target, path, value) {\n\tconst keys = String(path).split('.').filter((key) => key !== '')\n\tlet node = target\n\tkeys.slice(0, -1).forEach((key) => {\n\t\tif (!node[key] || typeof node[key] !== 'object') {\n\t\t\tnode[key] = {}\n\t\t}\n\t\tnode = node[key]\n\t})\n\tif (keys.length > 0) {\n\t\tnode[keys[keys.length - 1]] = value\n\t}\n}\n\n/**\n * The record a new party is saved as, from the fields a host declares.\n *\n * Each field `{ key, path?, address? }` writes its trimmed value at `path`\n * (default `key`); a field with `address: { path, kind, type }` instead adds\n * `{ kind, type, value }` to the list at that path, the shape OpenRegister's\n * party model reads as the party's addresses. `compose` names the paths a\n * derived field joins with a space, skipping the empty ones\n * (`{ displayName: [\"name.givenNames\", \"name.namePrefix\", \"name.surname\"] }`).\n * A field of `type: \"integer\"` is saved as a number when it reads as one.\n * An empty value is left out.\n *\n * @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.\n * @param {Record<string, string>} values The values by field key.\n * @return {object} The record.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function newPartyRecord(create, values) {\n\tconst record = {}\n\tfor (const field of Array.isArray(create?.fields) ? create.fields : []) {\n\t\tconst value = String(values?.[field?.key] ?? '').trim()\n\t\tif (!field || !field.key || value === '') {\n\t\t\tcontinue\n\t\t}\n\t\tif (field.address && field.address.path) {\n\t\t\tconst list = readPath(record, field.address.path)\n\t\t\tconst entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }\n\t\t\twritePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])\n\t\t\tcontinue\n\t\t}\n\t\twritePath(record, field.path || field.key, field.type === 'integer' && /^-?\\d+$/.test(value) ? Number(value) : value)\n\t}\n\tfor (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {\n\t\tconst joined = (Array.isArray(paths) ? paths : [])\n\t\t\t.map((path) => String(readPath(record, path) ?? '').trim())\n\t\t\t.filter((part) => part !== '')\n\t\t\t.join(' ')\n\t\tif (joined !== '') {\n\t\t\twritePath(record, target, joined)\n\t\t}\n\t}\n\treturn record\n}\n\n/**\n * The uuid a create answered with: `id`, `uuid` or `@self.id`.\n *\n * @param {object} saved The saved object.\n * @return {string} The uuid, or ''.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function savedUuid(saved) {\n\treturn String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')\n}\n"],"names":["t"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,E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