w-web-perm 1.0.83 → 1.0.85

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 (86) hide show
  1. package/dist/css/{chunk-vendors.034f7a87.css → chunk-vendors.18034562.css} +1 -1
  2. package/dist/index.tmp +1 -1
  3. package/dist/js/app-legacy.aaaa3681.js +1 -0
  4. package/dist/js/app.aaaa3681.js +1 -0
  5. package/dist/js/{chunk-vendors-legacy.d0596078.js → chunk-vendors-legacy.7b6ae0b0.js} +3 -3
  6. package/dist/js/{chunk-vendors.d0596078.js → chunk-vendors.7b6ae0b0.js} +3 -3
  7. package/dist/w-web-perm.umd.js +2 -2
  8. package/dist/w-web-perm.umd.js.map +1 -1
  9. package/docs/WWebPerm.html +1 -1
  10. package/docs/global.html +1 -1
  11. package/docs/index.html +1 -1
  12. package/docs/server_WWebPerm.mjs.html +1 -1
  13. package/docs/server_procCore.mjs.html +1 -1
  14. package/docs/src_fetchJson.mjs.html +1 -1
  15. package/package.json +2 -2
  16. package/server/procLang.mjs +12 -4
  17. package/src/components/LayoutContentGrups.vue +6 -6
  18. package/src/components/LayoutContentPemis.vue +6 -6
  19. package/src/components/LayoutContentTargets.vue +2 -2
  20. package/src/components/LayoutContentUsers.vue +5 -3
  21. package/src/components/ModeSelectChip.vue +182 -0
  22. package/src/components/RelationChip.vue +114 -0
  23. package/src/components/RelationChips.vue +375 -0
  24. package/src/components/VeCgrups.vue +23 -20
  25. package/src/components/VeCpemis.vue +21 -20
  26. package/src/components/VeCrules.vue +8 -1
  27. package/src/components/VeGrupBlngUsers.vue +40 -51
  28. package/src/components/VePemiBlngGrups.vue +27 -41
  29. package/tableTags-web-perm.json +1 -1
  30. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/README.md +58 -0
  31. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/server_procLang.mjs.diff +31 -0
  32. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_App.vue.diff +19 -0
  33. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_LayoutContentGrups.vue.diff +40 -0
  34. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_LayoutContentPemis.vue.diff +40 -0
  35. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_ModeSelectChip.vue.new.diff +124 -0
  36. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_RelationChip.vue.new.diff +116 -0
  37. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_RelationChips.vue.new.diff +152 -0
  38. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeCgrups.vue.diff +76 -0
  39. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeCpemis.vue.diff +76 -0
  40. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeCrules.vue.diff +14 -0
  41. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeGrupBlngUsers.vue.diff +121 -0
  42. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VePemiBlngGrups.vue.diff +121 -0
  43. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/server/procLang.mjs +1049 -0
  44. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/App.vue +204 -0
  45. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/LayoutContentGrups.vue +1260 -0
  46. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/LayoutContentPemis.vue +1262 -0
  47. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/ModeSelectChip.vue +121 -0
  48. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/RelationChip.vue +113 -0
  49. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/RelationChips.vue +149 -0
  50. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeCgrups.vue +943 -0
  51. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeCpemis.vue +943 -0
  52. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeCrules.vue +848 -0
  53. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeGrupBlngUsers.vue +1157 -0
  54. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VePemiBlngGrups.vue +1157 -0
  55. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/A-/347/256/241/347/220/206/346/254/212/351/231/220/344/270/273/350/241/250.png +0 -0
  56. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/A-/347/256/241/347/220/206/346/254/212/351/231/220/347/276/244/347/265/204/344/270/273/350/241/250.png +0 -0
  57. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B1-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/260/215/350/251/261/346/241/206.png +0 -0
  58. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B2-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-hover/346/234/254/351/240/205chip.png +0 -0
  59. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B3-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/346/234/254/351/240/205chip/346/270/205/345/226/256.png +0 -0
  60. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B4-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/346/234/254/351/240/205chip/345/267/262/347/202/272AND.png +0 -0
  61. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B5-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/345/205/250/351/203/250/346/265/256/345/261/244.png +0 -0
  62. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B6-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/213/276/351/201/270/345/276/214/346/234/254/351/240/205chip/345/234/250/351/246/226/344/275/215.png +0 -0
  63. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/C1-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220-/345/260/215/350/251/261/346/241/206.png +0 -0
  64. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/C2-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220-hover/345/267/262/345/213/276/351/201/270/345/210/227/346/216/247/345/210/266/351/240/205.png +0 -0
  65. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/C3-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220-/345/261/225/351/226/213/346/270/205/345/226/256.png +0 -0
  66. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/D1-/347/267/250/350/274/257/346/211/200/345/261/254/344/275/277/347/224/250/350/200/205-/345/260/215/350/251/261/346/241/206.png +0 -0
  67. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/E1-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220/347/276/244/347/265/204-hover.png +0 -0
  68. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/E2-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/346/270/205/345/226/256.png +0 -0
  69. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/F1-/345/261/225/347/244/272/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/224/257/350/256/200/346/205/213.png +0 -0
  70. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/F2-/345/261/225/347/244/272/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/345/205/250/351/203/250.png +0 -0
  71. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/G1-zoom-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/211/215/345/205/255/345/210/227.png +0 -0
  72. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/G2-zoom-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-hover/346/234/254/351/240/205chip.png +0 -0
  73. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/G3-zoom-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/346/270/205/345/226/256.png +0 -0
  74. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/verify.json +390 -0
  75. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/build.log +93 -0
  76. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/lint.log +23 -0
  77. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/zz_perm_probe.mjs +321 -0
  78. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/zz_perm_zoom.mjs +173 -0
  79. package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/zz_wwp_verify.mjs +330 -0
  80. package//345/273/272/350/255/260w-aggrid-vue/350/252/277/346/225/264.md +193 -0
  81. package//345/273/272/350/255/260w-component-vue/350/210/207wsemi/350/252/277/346/225/264.md +76 -0
  82. package//345/273/272/350/255/260w-web-perm/350/252/277/346/225/264.md +244 -0
  83. package//346/226/275/345/267/245/345/226/256_/345/273/272/350/255/260w-web-perm/350/252/277/346/225/264.md +166 -0
  84. package/dist/index.html +0 -4
  85. package/dist/js/app-legacy.04fa72c9.js +0 -1
  86. package/dist/js/app.04fa72c9.js +0 -1
@@ -0,0 +1,121 @@
1
+ <template>
2
+ <div
3
+ :style="`display:inline-block; vertical-align:middle; line-height:20px; border-radius:${attached?'4px 0 0 4px':'4px'}; overflow:hidden;`"
4
+ >
5
+ <WTextSelect
6
+ :style="`width:${width}px;`"
7
+ :items="items"
8
+ :value="value"
9
+ :editable="editable"
10
+ :paddingStyle="{v:0,h:5}"
11
+ :borderRadius="0"
12
+ :shadow="false"
13
+ :textFontSize="'12px'"
14
+ :textColor="useTextColor"
15
+ :backgroundColor="useBackgroundColor"
16
+ :backgroundColorHover="useBackgroundColorHover"
17
+ :backgroundColorFocus="useBackgroundColorHover"
18
+ :borderColor="useBorderColor"
19
+ :borderColorHover="useBorderColorHover"
20
+ :borderColorFocus="useBorderColorHover"
21
+ :showExpansionIcon="editable"
22
+ :expansionIconSize="14"
23
+ :expansionIconColor="useIconColor"
24
+ :itemPaddingStyle="{v:6,h:10}"
25
+ :itemTextFontSize="'12px'"
26
+ :minWidth="width"
27
+ :placementDistX="placementDistX"
28
+ :labelContent="labelContent"
29
+ @input="(item)=>{$emit('input',item)}"
30
+ ></WTextSelect>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import WTextSelect from 'w-component-vue/src/components/WTextSelect.vue'
36
+
37
+
38
+ //合併模式(OR/AND)控制項, 外觀為關聯 chip 之模式段(方角 4px、高 22px、字 12px), 內核仍為 WTextSelect(選項清單 Teleport 至 body, 屬性 wtlp 為 labelContent)
39
+ // - 獨立使用(VeCgrups/VeCpemis 之「合併…模式」欄): attached=false, 四角圓角
40
+ // - 嵌於本項 chip 之左段(VeGrupBlngUsers/VePemiBlngGrups): attached=true, 只有左側圓角, 右側與名稱段相接
41
+ // - 尺寸: 寬 56 = 最長項 'AND' 於 12px 之墨跡 27 + 左右內距 5×2 + 展開箭頭 14 + 箭頭前間隙 2 + 邊框 1×2 (取整), 固定寬使 OR/AND 切換時不跳動;
42
+ // 高 22 = line-height 20 + 上下邊框 1×2, 落在 ag-grid balham 之 27px 儲存格內不被裁切
43
+ // - 唯讀(editable=false): 沿用 WShellEllipse 之透明度 0.6 與無手指游標, 並不渲染展開箭頭
44
+ // - 清單浮層: minWidth 給整顆寬度使清單不窄於控制項(WPopup 之 autoFitMinWidth 只量觸發文字區, 會比外框窄), placementDistX 使清單左緣對齊外框左緣
45
+ export default {
46
+ components: {
47
+ WTextSelect,
48
+ },
49
+ props: {
50
+ value: {
51
+ type: String,
52
+ default: 'OR',
53
+ },
54
+ editable: {
55
+ type: Boolean,
56
+ default: true,
57
+ },
58
+ highlight: { //true 為本項(醒目色, 與 chip 醒目態同色), false 為一般(白底灰邊)
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ attached: { //true 為嵌於 chip 左段(右側無圓角)
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ width: {
67
+ type: Number,
68
+ default: 56,
69
+ },
70
+ placementDistX: { //清單浮層錨定於觸發文字, 往左退回內距 5 與邊框 1 使清單左緣對齊控制項外框左緣
71
+ type: Number,
72
+ default: -6,
73
+ },
74
+ labelContent: {
75
+ type: String,
76
+ default: 'modeSelect',
77
+ },
78
+ },
79
+ data: function() {
80
+ return {
81
+ items: ['OR', 'AND'],
82
+ }
83
+ },
84
+ computed: {
85
+
86
+ useTextColor: function() {
87
+ let vo = this
88
+ return vo.highlight ? '#fff' : '#555'
89
+ },
90
+
91
+ useIconColor: function() {
92
+ let vo = this
93
+ return vo.highlight ? '#fff' : '#777'
94
+ },
95
+
96
+ useBackgroundColor: function() {
97
+ let vo = this
98
+ return vo.highlight ? '#be295a' : '#fff'
99
+ },
100
+
101
+ useBackgroundColorHover: function() { //同色系加深, 不翻轉
102
+ let vo = this
103
+ return vo.highlight ? '#ac2451' : '#f5f5f5'
104
+ },
105
+
106
+ useBorderColor: function() {
107
+ let vo = this
108
+ return vo.highlight ? '#ac2451' : '#aaa'
109
+ },
110
+
111
+ useBorderColorHover: function() {
112
+ let vo = this
113
+ return vo.highlight ? '#9e2149' : '#888'
114
+ },
115
+
116
+ },
117
+ }
118
+ </script>
119
+
120
+ <style scoped>
121
+ </style>
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <div
3
+ :style="`display:inline-flex; align-items:stretch; height:22px; line-height:20px; font-size:12px; vertical-align:middle; white-space:nowrap;`"
4
+ :title="name"
5
+ >
6
+
7
+ <!-- 模式段: 本項且可編輯時為下拉控制項, 其餘為純文字 -->
8
+ <ModeSelectChip
9
+ :value="mode"
10
+ :editable="true"
11
+ :highlight="true"
12
+ :attached="true"
13
+ :labelContent="labelContent"
14
+ @input="(item)=>{$emit('input',item)}"
15
+ v-if="modeEditable"
16
+ ></ModeSelectChip>
17
+ <div
18
+ :style="`box-sizing:border-box; height:22px; padding:0 5px; border-radius:4px 0 0 4px; border:1px solid ${useModeBorderColor}; border-right-color:${useModeBorderRightColor}; background:${useModeBackgroundColor}; color:${useTextColor};`"
19
+ v-else
20
+ >
21
+ {{ mode }}
22
+ </div>
23
+
24
+ <!-- 名稱段: 超長名稱以省略號截斷, 全名放於 title -->
25
+ <div
26
+ :style="`box-sizing:border-box; height:22px; padding:0 5px; border-radius:0 4px 4px 0; border:1px solid ${useNameBorderColor}; border-left:none; background:${useNameBackgroundColor}; color:${useTextColor}; max-width:${nameMaxWidth}px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;`"
27
+ >
28
+ {{ name }}
29
+ </div>
30
+
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import ModeSelectChip from './ModeSelectChip.vue'
36
+
37
+
38
+ //單顆關聯 chip: [模式段 | 名稱段], 整顆高 22px、方角 4px、字 12px
39
+ // - isCurrent=true 為本項(該列與對話框當前對象之關係), 醒目色; 其餘為白底灰邊之一般色
40
+ // - editable=true 且 isCurrent=true 時, 模式段即 ModeSelectChip(chip 即下拉); 其他 chip 之模式段只顯示不可改
41
+ export default {
42
+ components: {
43
+ ModeSelectChip,
44
+ },
45
+ props: {
46
+ name: {
47
+ type: String,
48
+ default: '',
49
+ },
50
+ mode: {
51
+ type: String,
52
+ default: 'OR',
53
+ },
54
+ isCurrent: {
55
+ type: Boolean,
56
+ default: false,
57
+ },
58
+ editable: {
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ nameMaxWidth: {
63
+ type: Number,
64
+ default: 240,
65
+ },
66
+ labelContent: {
67
+ type: String,
68
+ default: 'modeSelect',
69
+ },
70
+ },
71
+ computed: {
72
+
73
+ modeEditable: function() {
74
+ let vo = this
75
+ return vo.editable && vo.isCurrent
76
+ },
77
+
78
+ useTextColor: function() {
79
+ let vo = this
80
+ return vo.isCurrent ? '#fff' : '#555'
81
+ },
82
+
83
+ useModeBackgroundColor: function() {
84
+ let vo = this
85
+ return vo.isCurrent ? '#be295a' : '#fff'
86
+ },
87
+
88
+ useModeBorderColor: function() {
89
+ let vo = this
90
+ return vo.isCurrent ? '#ac2451' : '#aaa'
91
+ },
92
+
93
+ useModeBorderRightColor: function() {
94
+ let vo = this
95
+ return vo.isCurrent ? '#9e2149' : '#aaa'
96
+ },
97
+
98
+ useNameBackgroundColor: function() {
99
+ let vo = this
100
+ return vo.isCurrent ? '#d22f64' : '#eee'
101
+ },
102
+
103
+ useNameBorderColor: function() {
104
+ let vo = this
105
+ return vo.isCurrent ? '#ac2451' : '#aaa'
106
+ },
107
+
108
+ },
109
+ }
110
+ </script>
111
+
112
+ <style scoped>
113
+ </style>
@@ -0,0 +1,149 @@
1
+ <template>
2
+ <span style="white-space:nowrap;">
3
+
4
+ <!-- 展開全部: 固定在最左, 不隨 chip 溢出被裁; 點擊以浮層列出全部 chip(可換行、可捲動) -->
5
+ <!-- WPopup(WTooltip) 之 displayType: 'block' 為 inline-block、'line' 為 block(命名與 CSS 相反), 此處須為行內元素以與其後之 chip 同列 -->
6
+ <template v-if="n > 0">
7
+ <WPopup
8
+ style="vertical-align:middle;"
9
+ :displayType="'block'"
10
+ :isolated="true"
11
+ :placement="'bottom-start'"
12
+ :paddingStyle="{v:8,h:10}"
13
+ :minWidth="320"
14
+ :maxWidth="560"
15
+ :labelContent="labelContentAll"
16
+ >
17
+ <template v-slot:trigger>
18
+ <div
19
+ :style="`display:inline-flex; align-items:center; box-sizing:border-box; height:22px; margin-right:4px; padding:0 6px; border:1px solid ${hoverAll?'#888':'#aaa'}; border-radius:4px; background:${hoverAll?'#f5f5f5':'#fff'}; color:${hoverAll?'#333':'#555'}; font-size:12px; line-height:20px; vertical-align:middle; cursor:pointer; user-select:none; transition:all 0.3s;`"
20
+ :title="tooltipAll"
21
+ @mouseenter="hoverAll=true"
22
+ @mouseleave="hoverAll=false"
23
+ >
24
+ <WIcon
25
+ :icon="mdiDotsHorizontal"
26
+ :size="14"
27
+ :color="hoverAll?'#333':'#555'"
28
+ :colorHover="'#333'"
29
+ ></WIcon>
30
+ <span style="padding-left:3px;">{{ n }}</span>
31
+ </div>
32
+ </template>
33
+ <template v-slot:content>
34
+ <div style="font-size:12px; color:#666; padding-bottom:6px;">
35
+ {{ usePopupTitle }}
36
+ </div>
37
+ <!-- 最大高 50vh: 於 900px 高之視窗自列位往下展開仍留得住底邊, 超過即於浮層內捲動 -->
38
+ <div style="display:flex; flex-wrap:wrap; gap:4px 6px; max-height:50vh; max-width:540px; overflow:auto;">
39
+ <RelationChip
40
+ v-for="(item, kitem) in itemsSorted"
41
+ :key="`p-${kitem}`"
42
+ :name="item.name"
43
+ :mode="item.mode"
44
+ :isCurrent="item.enable==='y'"
45
+ :editable="false"
46
+ :nameMaxWidth="600"
47
+ ></RelationChip>
48
+ </div>
49
+ </template>
50
+ </WPopup>
51
+ </template>
52
+
53
+ <!-- 儲存格內之 chip: 本項永遠第 1 顆; 相鄰間距 4px; 溢出由儲存格裁切 -->
54
+ <RelationChip
55
+ v-for="(item, kitem) in itemsSorted"
56
+ :key="`c-${kitem}`"
57
+ :style="`margin-right:4px;`"
58
+ :name="item.name"
59
+ :mode="item.mode"
60
+ :isCurrent="item.enable==='y'"
61
+ :editable="editable"
62
+ :labelContent="labelContent"
63
+ @input="(item)=>{$emit('input',item)}"
64
+ ></RelationChip>
65
+
66
+ </span>
67
+ </template>
68
+
69
+ <script>
70
+ import { mdiDotsHorizontal } from '@mdi/js/mdi.js'
71
+ import get from 'lodash-es/get.js'
72
+ import size from 'lodash-es/size.js'
73
+ import filter from 'lodash-es/filter.js'
74
+ import WIcon from 'w-component-vue/src/components/WIcon.vue'
75
+ import WPopup from 'w-component-vue/src/components/WPopup.vue'
76
+ import RelationChip from './RelationChip.vue'
77
+
78
+
79
+ //關聯 chip 列表(供 VeGrupBlngUsers 之「所屬權限群組名稱」欄與 VePemiBlngGrups 之「所屬權限名稱」欄)
80
+ // - items: genItems 產生之 grups/pemis 陣列, 各項含 name、mode、enable('y' 為本項)
81
+ // - 顯示順序: enable='y'(本項)永遠第 1 顆, 其餘依原順序; 只改顯示, 不改儲存之 cgrups/cpemis 字串(權限合併結果與順序無關, 見 mShare.mjs 之 mergeRules)
82
+ // - 本項 chip 之模式段即下拉(RelationChip 之 ModeSelectChip), 變更以 input 事件回傳新模式, 由呼叫端沿用既有 showXxxToggleItemModeByName 處理
83
+ // - 「展開全部」鈕固定於最左, 浮層(WPopup, Teleport 至 body, 與 WDialog 共用 z-index 池故可疊於對話框上)內以 flex-wrap 列出全部 chip
84
+ export default {
85
+ components: {
86
+ WIcon,
87
+ WPopup,
88
+ RelationChip,
89
+ },
90
+ props: {
91
+ items: {
92
+ type: Array,
93
+ default: () => [],
94
+ },
95
+ editable: {
96
+ type: Boolean,
97
+ default: false,
98
+ },
99
+ popupTitle: { //浮層標題所用之欄名(如「所屬權限名稱」), 與數量合成 chipsPopupTitle
100
+ type: String,
101
+ default: '',
102
+ },
103
+ tooltipAll: {
104
+ type: String,
105
+ default: '',
106
+ },
107
+ labelContent: { //本項 chip 之模式下拉浮層之 wtlp 屬性值
108
+ type: String,
109
+ default: 'modeSelect',
110
+ },
111
+ labelContentAll: { //展開全部之浮層之 wtlp 屬性值
112
+ type: String,
113
+ default: 'relationChipsAll',
114
+ },
115
+ },
116
+ data: function() {
117
+ return {
118
+ mdiDotsHorizontal,
119
+ hoverAll: false,
120
+ }
121
+ },
122
+ computed: {
123
+
124
+ n: function() {
125
+ let vo = this
126
+ return size(vo.items)
127
+ },
128
+
129
+ itemsSorted: function() {
130
+ let vo = this
131
+ let a = filter(vo.items, (v) => get(v, 'enable', '') === 'y')
132
+ let b = filter(vo.items, (v) => get(v, 'enable', '') !== 'y')
133
+ return [...a, ...b]
134
+ },
135
+
136
+ usePopupTitle: function() {
137
+ let vo = this
138
+ let t = vo.$t('chipsPopupTitle')
139
+ t = t.replace('{title}', vo.popupTitle)
140
+ t = t.replace('{n}', vo.n)
141
+ return t
142
+ },
143
+
144
+ },
145
+ }
146
+ </script>
147
+
148
+ <style scoped>
149
+ </style>