@tekkare/romulus 0.1.32 → 0.1.34
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/module.json
CHANGED
|
@@ -75,6 +75,26 @@ function toggle(which: RmFilterBarPanel) {
|
|
|
75
75
|
panel.value = panel.value === which ? null : which
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Le lien de recherche avancee est pose DANS le champ, a son bout : le champ
|
|
80
|
+
* doit donc lui reserver sa place, sinon le texte saisi et la croix passent
|
|
81
|
+
* dessous. La largeur se mesure — « Recherche avancee » et « Advanced search »
|
|
82
|
+
* ne font pas la meme longueur.
|
|
83
|
+
*/
|
|
84
|
+
const advancedLink = ref<HTMLElement | null>(null)
|
|
85
|
+
const advancedWidth = ref(0)
|
|
86
|
+
let advancedSize: ResizeObserver | null = null
|
|
87
|
+
|
|
88
|
+
function watchAdvanced() {
|
|
89
|
+
if (!advancedLink.value) return
|
|
90
|
+
advancedSize?.disconnect()
|
|
91
|
+
advancedSize = new ResizeObserver(() => {
|
|
92
|
+
advancedWidth.value = advancedLink.value?.offsetWidth ?? 0
|
|
93
|
+
})
|
|
94
|
+
advancedSize.observe(advancedLink.value)
|
|
95
|
+
advancedWidth.value = advancedLink.value.offsetWidth
|
|
96
|
+
}
|
|
97
|
+
|
|
78
98
|
/** Onglets de vue publies par la page. */
|
|
79
99
|
const { view } = useRmFilterBarView()
|
|
80
100
|
|
|
@@ -100,11 +120,16 @@ function watchHeader() {
|
|
|
100
120
|
stickyTop.value = header.offsetHeight
|
|
101
121
|
}
|
|
102
122
|
|
|
103
|
-
onMounted(() =>
|
|
123
|
+
onMounted(() => {
|
|
124
|
+
watchHeader()
|
|
125
|
+
watchAdvanced()
|
|
126
|
+
})
|
|
104
127
|
|
|
105
128
|
onBeforeUnmount(() => {
|
|
106
129
|
headerSize?.disconnect()
|
|
107
130
|
headerSize = null
|
|
131
|
+
advancedSize?.disconnect()
|
|
132
|
+
advancedSize = null
|
|
108
133
|
})
|
|
109
134
|
</script>
|
|
110
135
|
|
|
@@ -113,7 +138,7 @@ onBeforeUnmount(() => {
|
|
|
113
138
|
id="rm_filter_bar"
|
|
114
139
|
class="rm-fbar"
|
|
115
140
|
:class="panel ? 'rm-fbar--open' : 'rm-fbar--closed'"
|
|
116
|
-
:style="{ top: `${stickyTop}px` }"
|
|
141
|
+
:style="{ top: `${stickyTop}px`, '--rm-fbar-advanced-w': `${advancedWidth}px` }"
|
|
117
142
|
>
|
|
118
143
|
<div class="rm-fbar__row">
|
|
119
144
|
<div v-if="view" class="rm-fbar__view">
|
|
@@ -132,23 +157,6 @@ onBeforeUnmount(() => {
|
|
|
132
157
|
<span v-if="filtersAmount" class="rm-fbar__badge">{{ filtersAmount }}</span>
|
|
133
158
|
</button>
|
|
134
159
|
|
|
135
|
-
<div class="rm-fbar__search">
|
|
136
|
-
<slot name="Search" />
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<!-- La recherche avancee s'ouvre par un lien pose au bout du champ : elle
|
|
140
|
-
prolonge la recherche, elle n'est pas un troisieme reglage a cote de
|
|
141
|
-
« Filtres » et « Personnaliser ». -->
|
|
142
|
-
<button
|
|
143
|
-
v-if="hasAdvanced"
|
|
144
|
-
type="button"
|
|
145
|
-
class="rm-fbar__advanced"
|
|
146
|
-
:class="{ 'is-active': advancedOpen }"
|
|
147
|
-
@click="toggle('advanced')"
|
|
148
|
-
>
|
|
149
|
-
{{ t.advanced }}
|
|
150
|
-
</button>
|
|
151
|
-
|
|
152
160
|
<button
|
|
153
161
|
v-if="hasCustomize"
|
|
154
162
|
type="button"
|
|
@@ -159,6 +167,25 @@ onBeforeUnmount(() => {
|
|
|
159
167
|
<RmIcon name="SlidersHorizontal" :size="16" />
|
|
160
168
|
<span>{{ t.customize }}</span>
|
|
161
169
|
</button>
|
|
170
|
+
|
|
171
|
+
<div class="rm-fbar__search">
|
|
172
|
+
<slot name="Search" />
|
|
173
|
+
|
|
174
|
+
<!-- La recherche avancee s'ouvre par un lien pose dans le champ, a son
|
|
175
|
+
bout : elle prolonge la recherche, elle n'est pas un troisieme
|
|
176
|
+
reglage a cote de « Filtres » et « Personnaliser ». -->
|
|
177
|
+
<button
|
|
178
|
+
v-if="hasAdvanced"
|
|
179
|
+
ref="advancedLink"
|
|
180
|
+
type="button"
|
|
181
|
+
class="rm-fbar__advanced"
|
|
182
|
+
:class="{ 'is-active': advancedOpen }"
|
|
183
|
+
@click="toggle('advanced')"
|
|
184
|
+
>
|
|
185
|
+
{{ t.advanced }}
|
|
186
|
+
</button>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
162
189
|
</div>
|
|
163
190
|
|
|
164
191
|
<div v-show="open" class="rm-fbar__panel">
|
|
@@ -207,5 +234,5 @@ onBeforeUnmount(() => {
|
|
|
207
234
|
</template>
|
|
208
235
|
|
|
209
236
|
<style scoped>
|
|
210
|
-
.rm-fbar{margin-inline:calc((min(var(--oip-content-max, 100%), 100%) - var(--oip-main-w, 100%))/2);position:sticky;width:var(--oip-main-w,100%);z-index:91;--rm-fbar-field-h:32px;backdrop-filter:blur(12px);background:rgba(245,245,249,.8);border-bottom:1px solid var(--border-default);display:flex;flex-direction:column;font-family:var(--font-sans)}.rm-fbar__row{align-items:flex-start;display:flex;gap:12px;padding-block:8px;padding-inline:max(32px,(100% - var(--oip-content-max,100%))/2 + 32px)}.rm-fbar--open .rm-fbar__row{border-bottom:1px solid var(--border-default)}.rm-fbar__toggle :deep(p),.rm-fbar__toggle :deep(span){font-size:inherit;font-weight:inherit;line-height:inherit;margin:0}.rm-fbar__toggle{align-items:center;background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-pill);color:var(--text-primary);cursor:pointer;display:flex;flex:0 0 auto;font-family:inherit;font-size:var(--font-14);font-weight:var(--weight-medium);gap:6px;height:var(--rm-fbar-field-h);justify-content:center;padding:0 14px}.rm-fbar__toggle:hover{background:var(--bg-surface-3)}.rm-fbar__toggle.is-active,.rm-fbar__toggle.is-active:hover{background:var(--color-primary);border-color:var(--color-primary);color:var(--color-text-inverse)}.rm-fbar__toggle.is-active .rm-fbar__badge{background:var(--color-text-inverse);color:var(--color-primary)}.rm-fbar__badge{align-items:center;background:var(--color-primary);border-radius:16px;color:var(--color-text-inverse);display:inline-flex;font-size:var(--font-11);font-weight:var(--weight-bold);justify-content:center;min-width:18px;padding:0 5px}.rm-fbar__view{align-items:center;display:flex;flex:0 0 auto}.rm-fbar__advanced{align-items:center;background:none;border:none;color:var(--color-primary);cursor:pointer;display:inline-flex;
|
|
237
|
+
.rm-fbar{margin-inline:calc((min(var(--oip-content-max, 100%), 100%) - var(--oip-main-w, 100%))/2);position:sticky;width:var(--oip-main-w,100%);z-index:91;--rm-fbar-field-h:32px;backdrop-filter:blur(12px);background:rgba(245,245,249,.8);border-bottom:1px solid var(--border-default);display:flex;flex-direction:column;font-family:var(--font-sans)}.rm-fbar__row{align-items:flex-start;display:flex;gap:12px;padding-block:8px;padding-inline:max(32px,(100% - var(--oip-content-max,100%))/2 + 32px)}.rm-fbar--open .rm-fbar__row{border-bottom:1px solid var(--border-default)}.rm-fbar__toggle :deep(p),.rm-fbar__toggle :deep(span){font-size:inherit;font-weight:inherit;line-height:inherit;margin:0}.rm-fbar__toggle{align-items:center;background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-pill);color:var(--text-primary);cursor:pointer;display:flex;flex:0 0 auto;font-family:inherit;font-size:var(--font-14);font-weight:var(--weight-medium);gap:6px;height:var(--rm-fbar-field-h);justify-content:center;padding:0 14px}.rm-fbar__toggle:hover{background:var(--bg-surface-3)}.rm-fbar__toggle.is-active,.rm-fbar__toggle.is-active:hover{background:var(--color-primary);border-color:var(--color-primary);color:var(--color-text-inverse)}.rm-fbar__toggle.is-active .rm-fbar__badge{background:var(--color-text-inverse);color:var(--color-primary)}.rm-fbar__badge{align-items:center;background:var(--color-primary);border-radius:16px;color:var(--color-text-inverse);display:inline-flex;font-size:var(--font-11);font-weight:var(--weight-bold);justify-content:center;min-width:18px;padding:0 5px}.rm-fbar__view{align-items:center;display:flex;flex:0 0 auto}.rm-fbar__advanced{align-items:center;background:none;border:none;border-left:1px solid var(--border-default);color:var(--color-primary);cursor:pointer;display:inline-flex;font-family:inherit;font-size:var(--font-13);font-weight:var(--weight-medium);height:var(--rm-fbar-field-h);padding:0 0 0 12px;position:absolute;right:14px;text-decoration-line:underline;top:0;white-space:nowrap;z-index:2}.rm-fbar__advanced.is-active,.rm-fbar__advanced:hover{color:var(--color-primary-hover,var(--color-primary));text-decoration-thickness:2px}.rm-fbar__search{align-items:center;display:flex;flex:1 1 auto;gap:8px;min-width:0;position:relative}.rm-fbar__search:empty{display:none}.rm-fbar__search :deep(.filters_input_search){border-radius:var(--radius-pill);box-sizing:border-box;height:auto;min-height:var(--rm-fbar-field-h);padding-right:calc(var(--rm-fbar-advanced-w, 0px) + 12px);width:100%}.rm-fbar__search :deep(.research_tags:not(:has(*))){display:none}.rm-fbar__search :deep(.select_shortcut){box-sizing:border-box;font-size:var(--font-11);height:24px;padding-block:0}.rm-fbar__search :deep(.select_shortcut:hover){background:var(--bg-surface-3)!important;border-color:var(--border-default)!important;color:inherit!important}.rm-fbar__search :deep(.select_shortcut:hover svg){color:inherit!important}.rm-fbar__search :deep(.remove_search_section){border-left:none;border-radius:0 var(--radius-pill) var(--radius-pill) 0}.rm-fbar__search :deep(.remove_search_section:hover){background:transparent!important}.rm-fbar__search :deep(.remove_search_section:hover svg){color:var(--text-primary)!important}.rm-fbar__search :deep(.filters_input_search.no_bottom){border-bottom:1.5px solid var(--color-primary)!important;border-radius:var(--radius-pill)}.rm-fbar__search :deep(.search_suggestions){border:1px solid var(--border-default);border-radius:var(--radius-2xl);box-shadow:var(--shadow-lg);left:0;padding:6px;right:0;top:calc(100% + 6px);width:auto}.rm-fbar__search :deep(.sugg_container>*){border-radius:var(--radius-lg)}.rm-fbar__search :deep(.sugg_container>.selected){background:color-mix(in srgb,var(--color-primary) 6%,transparent)!important}.rm-fbar__panel{--rm-filter-col:224px;align-items:end;display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(0,var(--rm-filter-col)));justify-content:center;padding-block:16px 20px;padding-inline:56px}.rm-fbar__panel--wide{align-items:stretch;display:flex;flex-direction:column;gap:12px}.rm-fbar__filters{display:contents}.rm-fbar__panel-head{align-items:baseline;display:flex;gap:16px;grid-column:1/-1;width:100%}.rm-fbar__customize{grid-column:1/-1}.rm-fbar__panel :deep(.filters_row_break){grid-column:1/-1}.rm-fbar__panel-title{font-size:var(--font-18);font-weight:800;margin:0}.rm-fbar__action{background:none;border:none;cursor:pointer;font-family:inherit;font-size:var(--font-14);font-weight:var(--weight-medium);padding:0;text-decoration-line:underline}.rm-fbar__action--save{color:var(--color-primary)}.rm-fbar__action--clear{color:var(--text-secondary)}
|
|
211
238
|
</style>
|