pict-section-recordset 1.2.0 → 1.3.1
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/package.json
CHANGED
|
@@ -24,7 +24,7 @@ const _DEFAULT_CONFIGURATION_FilterPersistenceView = (
|
|
|
24
24
|
CSS: /*css*/`
|
|
25
25
|
.prsp-exp { display: flex; flex-direction: column; gap: 0.4rem; }
|
|
26
26
|
.prsp-exp-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--theme-color-text-muted, #6b7686); }
|
|
27
|
-
.prsp-exp-row { display: flex; align-items: center; gap: 0.5rem; }
|
|
27
|
+
.prsp-exp-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
|
|
28
28
|
.prsp-exp-row > span:empty { display: none; }
|
|
29
29
|
.prsp-exp-select, .prsp-exp-name { font: inherit; font-size: 0.9rem; padding: 0.42rem 0.6rem; border-radius: 8px;
|
|
30
30
|
border: 1px solid var(--theme-color-border-default, #d7dce3); background: var(--theme-color-background-primary, #fff); color: var(--theme-color-text-primary, #1f2733); }
|
|
@@ -58,12 +58,39 @@ const _DEFAULT_CONFIGURATION_SUBSET_Filter =
|
|
|
58
58
|
.prsp-filters-drawer-inner { overflow: hidden; min-height: 0; }
|
|
59
59
|
.prsp-filters.drawer-open .prsp-filters-drawer-inner { margin-top: 0.6rem; padding: 0.95rem 1.1rem;
|
|
60
60
|
border: 1px solid var(--theme-color-border-light, #e8ebf0); border-radius: 10px; background: var(--theme-color-background-panel, #fff); }
|
|
61
|
-
.prsp-filters-add { margin: 0.4rem 0 0.2rem; }
|
|
61
|
+
.prsp-filters-add { position: relative; margin: 0.4rem 0 0.2rem; }
|
|
62
|
+
.prsp-addfilter-trigger { display: inline-flex; align-items: center; gap: 0.35rem; }
|
|
62
63
|
/* Drawer footer: filter experience on the left, Clear/Reset/Apply on the right. */
|
|
63
64
|
.prsp-filters-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
|
|
64
65
|
margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--theme-color-border-light, #e8ebf0); }
|
|
65
66
|
.prsp-filters-experiences { flex: 0 1 auto; min-width: 0; }
|
|
66
67
|
.prsp-filters-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem; }
|
|
68
|
+
|
|
69
|
+
/* Module-owned "Add filter" popover (replaces the old native <select> pickers). */
|
|
70
|
+
.prsp-addfilter-pop { position: absolute; z-index: 30; top: calc(100% + 0.35rem); left: 0; min-width: 280px; max-width: 360px; display: none; }
|
|
71
|
+
.prsp-addfilter-pop.open { display: block; }
|
|
72
|
+
/* Transparent full-viewport backdrop: catches outside clicks to close (no document listener). */
|
|
73
|
+
.prsp-addfilter-backdrop { position: fixed; inset: 0; z-index: 0; }
|
|
74
|
+
.prsp-addfilter-panel { position: relative; z-index: 1; display: flex; flex-direction: column; max-height: min(70vh, 460px);
|
|
75
|
+
background: var(--theme-color-background-panel, #fff); border: 1px solid var(--theme-color-border-default, #d7dce3);
|
|
76
|
+
border-radius: 10px; box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14); overflow: hidden; }
|
|
77
|
+
.prsp-addfilter-search { flex: 0 0 auto; display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--theme-color-border-light, #e8ebf0); }
|
|
78
|
+
.prsp-addfilter-search-ic { display: inline-flex; color: var(--theme-color-text-muted, #6b7686); font-size: 0.9rem; }
|
|
79
|
+
.prsp-addfilter-search input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 0.9rem; border: none; outline: none; background: transparent; color: var(--theme-color-text-primary, #1f2733); }
|
|
80
|
+
.prsp-addfilter-list { flex: 1 1 auto; overflow-y: auto; }
|
|
81
|
+
.prsp-addfilter-empty { padding: 0.7rem 0.8rem; color: var(--theme-color-text-muted, #6b7686); font-size: 0.86rem; }
|
|
82
|
+
.prsp-addfilter-field { border-bottom: 1px solid var(--theme-color-border-light, #eef1f5); }
|
|
83
|
+
.prsp-addfilter-field:last-child { border-bottom: none; }
|
|
84
|
+
.prsp-addfilter-field-btn { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%;
|
|
85
|
+
font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; padding: 0.5rem 0.75rem; border: none; background: transparent; color: var(--theme-color-text-primary, #1f2733); }
|
|
86
|
+
.prsp-addfilter-field-btn:hover { background: var(--theme-color-background-tertiary, #eceef2); }
|
|
87
|
+
.prsp-addfilter-chev { display: inline-flex; flex: 0 0 auto; color: var(--theme-color-text-muted, #6b7686); font-size: 0.85rem; transition: transform 0.15s ease; }
|
|
88
|
+
.prsp-addfilter-field.is-expanded .prsp-addfilter-chev { transform: rotate(90deg); }
|
|
89
|
+
.prsp-addfilter-clauses { display: flex; flex-direction: column; }
|
|
90
|
+
.prsp-addfilter-clause { display: flex; align-items: center; gap: 0.4rem; width: 100%; text-align: left; cursor: pointer;
|
|
91
|
+
font: inherit; font-size: 0.85rem; padding: 0.4rem 0.8rem 0.4rem 1.6rem; border: none; background: transparent; color: var(--theme-color-text-secondary, #45505f); }
|
|
92
|
+
.prsp-addfilter-clause:hover { background: color-mix(in srgb, var(--theme-color-brand-primary, #156dd1) 10%, transparent); color: var(--theme-color-brand-primary, #156dd1); }
|
|
93
|
+
.prsp-addfilter-clause-ic { display: inline-flex; font-size: 0.8rem; }
|
|
67
94
|
`,
|
|
68
95
|
CSSPriority: 500,
|
|
69
96
|
|
|
@@ -149,54 +176,63 @@ const _DEFAULT_CONFIGURATION_SUBSET_Filter =
|
|
|
149
176
|
Template: /*html*/`
|
|
150
177
|
<!-- DefaultPackage pict view template: [PRSP-SUBSET-Filters-Template-AddFilter-Fieldset] -->
|
|
151
178
|
<div class="prsp-filters-add">
|
|
152
|
-
<button type="button" class="prsp-filters-btn-text" id="PRSP_Filter_Button_Add" title="Add a new filter clause" onclick="_Pict.views['PRSP-Filters'].
|
|
153
|
-
<div
|
|
179
|
+
<button type="button" class="prsp-filters-btn-text prsp-addfilter-trigger" id="PRSP_Filter_Button_Add" title="Add a new filter clause" onclick="_Pict.views['PRSP-Filters'].toggleAddFilterPopover(event, '{~D:Record.RecordSet~}', '{~D:Record.ViewContext~}')">{~I:Plus~} Add filter</button>
|
|
180
|
+
<div class="prsp-addfilter-pop" id="PRSP_AddFilter_Popover"></div>
|
|
154
181
|
</div>
|
|
155
182
|
<!-- DefaultPackage end view template: [PRSP-SUBSET-Filters-Template-AddFilter-Fieldset] -->
|
|
156
183
|
`
|
|
157
184
|
},
|
|
158
185
|
{
|
|
159
|
-
Hash: 'PRSP-
|
|
186
|
+
Hash: 'PRSP-AddFilter-Popover',
|
|
160
187
|
Template: /*html*/`
|
|
161
|
-
<!-- DefaultPackage pict view template: [PRSP-
|
|
162
|
-
<div>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
{~TS:PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-Entry:Scope.getFilterSchema()~}
|
|
171
|
-
</select>
|
|
172
|
-
<div id="PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-AddFilterClauseDropdown">
|
|
188
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-Popover] -->
|
|
189
|
+
<div class="prsp-addfilter-backdrop" onclick="_Pict.views['PRSP-Filters'].closeAddFilterPopover()"></div>
|
|
190
|
+
<div class="prsp-addfilter-panel">
|
|
191
|
+
<div class="prsp-addfilter-search">
|
|
192
|
+
<span class="prsp-addfilter-search-ic">{~I:Search~}</span>
|
|
193
|
+
<input type="text" id="PRSP_AddFilter_Search" placeholder="Search filters…" autocomplete="off" value="{~D:AppData.PRSPAddFilter.Search~}" oninput="_Pict.views['PRSP-Filters'].searchAddFilter(this.value)" onkeydown="if (event.key === 'Escape') { event.preventDefault(); _Pict.views['PRSP-Filters'].closeAddFilterPopover(); }">
|
|
194
|
+
</div>
|
|
195
|
+
<div class="prsp-addfilter-list" id="PRSP_AddFilter_List">
|
|
196
|
+
{~T:PRSP-AddFilter-List~}
|
|
173
197
|
</div>
|
|
174
198
|
</div>
|
|
175
|
-
<!-- DefaultPackage end view template:
|
|
199
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-Popover] -->
|
|
176
200
|
`
|
|
177
201
|
},
|
|
178
202
|
{
|
|
179
|
-
Hash: 'PRSP-
|
|
203
|
+
Hash: 'PRSP-AddFilter-List',
|
|
180
204
|
Template: /*html*/`
|
|
181
|
-
<!-- DefaultPackage pict view template: [PRSP-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
<button type="button" id="PRSP_Filter_Button_ConfirmAdd" onclick="_Pict.views['PRSP-Filters'].addFilter(event, '{~D:Record.RecordSet~}', '{~D:Record.ViewContext~}',
|
|
186
|
-
document.getElementById('PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-AddFilterClauseDropdown').querySelector('option:checked').getAttribute('data-i-filter-key'),
|
|
187
|
-
document.getElementById('PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-AddFilterClauseDropdown').querySelector('option:checked').getAttribute('data-i-clause-key'),
|
|
188
|
-
)">Add Filter</button>
|
|
189
|
-
<!-- DefaultPackage end view template: [PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-AddFilterClauseDropdown] -->
|
|
205
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-List] -->
|
|
206
|
+
{~TS:PRSP-AddFilter-Field:AppData.PRSPAddFilter.Fields~}
|
|
207
|
+
{~NE:AppData.PRSPAddFilter.IsEmpty^<div class="prsp-addfilter-empty">No filters found.</div>~}
|
|
208
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-List] -->
|
|
190
209
|
`
|
|
191
210
|
},
|
|
192
211
|
{
|
|
193
|
-
Hash: 'PRSP-
|
|
212
|
+
Hash: 'PRSP-AddFilter-Field',
|
|
194
213
|
Template: /*html*/`
|
|
195
|
-
<!-- DefaultPackage pict view template: [PRSP-
|
|
196
|
-
<
|
|
197
|
-
{~D:Record.
|
|
198
|
-
|
|
199
|
-
|
|
214
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-Field] -->
|
|
215
|
+
<div class="prsp-addfilter-field {~D:Record.ExpandedClass~}">
|
|
216
|
+
<button type="button" class="prsp-addfilter-field-btn" onclick="_Pict.views['PRSP-Filters'].toggleAddFilterField('{~D:Record.FilterKey~}')">
|
|
217
|
+
<span class="prsp-addfilter-field-name">{~D:Record.DisplayName~}</span>
|
|
218
|
+
<span class="prsp-addfilter-chev">{~I:ChevronRight~}</span>
|
|
219
|
+
</button>
|
|
220
|
+
<div class="prsp-addfilter-clauses">
|
|
221
|
+
{~TS:PRSP-AddFilter-Clause:Record.ClausesToShow~}
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-Field] -->
|
|
225
|
+
`
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
Hash: 'PRSP-AddFilter-Clause',
|
|
229
|
+
Template: /*html*/`
|
|
230
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-Clause] -->
|
|
231
|
+
<button type="button" class="prsp-addfilter-clause" onclick="_Pict.views['PRSP-Filters'].addFilter(event, '{~D:AppData.PRSPAddFilter.RecordSet~}', '{~D:AppData.PRSPAddFilter.ViewContext~}', '{~D:Record.FilterKey~}', '{~D:Record.ClauseKey~}')">
|
|
232
|
+
<span class="prsp-addfilter-clause-ic">{~I:Plus~}</span>
|
|
233
|
+
<span>{~D:Record.DisplayName~}</span>
|
|
234
|
+
</button>
|
|
235
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-Clause] -->
|
|
200
236
|
`
|
|
201
237
|
},
|
|
202
238
|
],
|
|
@@ -210,15 +246,15 @@ const _DEFAULT_CONFIGURATION_SUBSET_Filter =
|
|
|
210
246
|
RenderMethod: 'replace'
|
|
211
247
|
},
|
|
212
248
|
{
|
|
213
|
-
RenderableHash: '
|
|
214
|
-
TemplateHash: 'PRSP-
|
|
215
|
-
ContentDestinationAddress: '#
|
|
249
|
+
RenderableHash: 'PRSP_AddFilter_Popover',
|
|
250
|
+
TemplateHash: 'PRSP-AddFilter-Popover',
|
|
251
|
+
ContentDestinationAddress: '#PRSP_AddFilter_Popover',
|
|
216
252
|
RenderMethod: 'replace',
|
|
217
253
|
},
|
|
218
254
|
{
|
|
219
|
-
RenderableHash: '
|
|
220
|
-
TemplateHash: 'PRSP-
|
|
221
|
-
ContentDestinationAddress: '#
|
|
255
|
+
RenderableHash: 'PRSP_AddFilter_List',
|
|
256
|
+
TemplateHash: 'PRSP-AddFilter-List',
|
|
257
|
+
ContentDestinationAddress: '#PRSP_AddFilter_List',
|
|
222
258
|
RenderMethod: 'replace',
|
|
223
259
|
},
|
|
224
260
|
],
|
|
@@ -315,6 +351,15 @@ class ViewRecordSetSUBSETFilters extends libPictView
|
|
|
315
351
|
// stale callback doesn't clobber DOM that now belongs to a different
|
|
316
352
|
// filter experience.
|
|
317
353
|
this._renderEpoch = 0;
|
|
354
|
+
// Add-filter popover state (module-owned, replaces the old native <select> pickers).
|
|
355
|
+
this._addFilterOpen = false;
|
|
356
|
+
this._addFilterRecordSet = null;
|
|
357
|
+
this._addFilterViewContext = null;
|
|
358
|
+
this._addFilterSearch = '';
|
|
359
|
+
this._addFilterExpandedKey = null;
|
|
360
|
+
// FilterKeys to hide from the add-filter popover (e.g. internal/audit columns). Host apps
|
|
361
|
+
// set this; it is merged with a per-record-set config `FilterFieldBlacklist`.
|
|
362
|
+
this.filterFieldBlacklist = [];
|
|
318
363
|
}
|
|
319
364
|
|
|
320
365
|
/**
|
|
@@ -617,12 +662,96 @@ class ViewRecordSetSUBSETFilters extends libPictView
|
|
|
617
662
|
* @param {string} pRecordSet - The record set being filtered
|
|
618
663
|
* @param {string} pViewContext - The view context for the filter (ex. List, Dashboard)
|
|
619
664
|
*/
|
|
620
|
-
|
|
665
|
+
toggleAddFilterPopover(pEvent, pRecordSet, pViewContext)
|
|
621
666
|
{
|
|
622
|
-
if (pEvent) pEvent.preventDefault();
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
667
|
+
if (pEvent) { pEvent.preventDefault(); }
|
|
668
|
+
if (this._addFilterOpen)
|
|
669
|
+
{
|
|
670
|
+
return this.closeAddFilterPopover();
|
|
671
|
+
}
|
|
672
|
+
this._addFilterOpen = true;
|
|
673
|
+
this._addFilterRecordSet = pRecordSet;
|
|
674
|
+
this._addFilterViewContext = pViewContext;
|
|
675
|
+
this._addFilterSearch = '';
|
|
676
|
+
this._addFilterExpandedKey = null;
|
|
677
|
+
this._buildAddFilterFields(pRecordSet);
|
|
678
|
+
this.render('PRSP_AddFilter_Popover', undefined, { RecordSet: pRecordSet, ViewContext: pViewContext });
|
|
679
|
+
this._paintAddFilterOpenState();
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/** Close the add-filter popover. */
|
|
683
|
+
closeAddFilterPopover()
|
|
684
|
+
{
|
|
685
|
+
this._addFilterOpen = false;
|
|
686
|
+
this._addFilterExpandedKey = null;
|
|
687
|
+
this._paintAddFilterOpenState();
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Filter the add-filter field list by a search term, re-rendering only the list so the
|
|
692
|
+
* search input keeps focus.
|
|
693
|
+
* @param {string} pValue - The search term.
|
|
694
|
+
*/
|
|
695
|
+
searchAddFilter(pValue)
|
|
696
|
+
{
|
|
697
|
+
this._addFilterSearch = pValue || '';
|
|
698
|
+
this._buildAddFilterFields(this._addFilterRecordSet);
|
|
699
|
+
this.render('PRSP_AddFilter_List', undefined, { RecordSet: this._addFilterRecordSet, ViewContext: this._addFilterViewContext });
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Expand or collapse a field's available clauses in the add-filter popover.
|
|
704
|
+
* @param {string} pFilterKey - The field whose clauses to toggle.
|
|
705
|
+
*/
|
|
706
|
+
toggleAddFilterField(pFilterKey)
|
|
707
|
+
{
|
|
708
|
+
this._addFilterExpandedKey = (this._addFilterExpandedKey === pFilterKey) ? null : pFilterKey;
|
|
709
|
+
this._buildAddFilterFields(this._addFilterRecordSet);
|
|
710
|
+
this.render('PRSP_AddFilter_List', undefined, { RecordSet: this._addFilterRecordSet, ViewContext: this._addFilterViewContext });
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* (Re)build the add-filter popover's field list into AppData from the record set's filter
|
|
715
|
+
* schema, honouring the current search term and the expanded field.
|
|
716
|
+
* @param {string} pRecordSet - The record set whose filter schema to read.
|
|
717
|
+
*/
|
|
718
|
+
_buildAddFilterFields(pRecordSet)
|
|
719
|
+
{
|
|
720
|
+
const tmpProvider = this.pict.providers[`RSP-Provider-${pRecordSet}`];
|
|
721
|
+
const tmpSchema = (tmpProvider && typeof tmpProvider.getFilterSchema === 'function') ? tmpProvider.getFilterSchema() : {};
|
|
722
|
+
const tmpRecordSetConfig = this.pict.PictSectionRecordSet?.recordSetProviderConfigurations?.[pRecordSet] || {};
|
|
723
|
+
const tmpBlacklist = [].concat(this.filterFieldBlacklist || [], Array.isArray(tmpRecordSetConfig.FilterFieldBlacklist) ? tmpRecordSetConfig.FilterFieldBlacklist : []);
|
|
724
|
+
const tmpSearch = (this._addFilterSearch || '').toLowerCase();
|
|
725
|
+
const tmpFields = Object.values(tmpSchema)
|
|
726
|
+
.filter((pField) => Array.isArray(pField.AvailableClauses) && pField.AvailableClauses.length > 0)
|
|
727
|
+
.filter((pField) => !tmpBlacklist.includes(pField.FilterKey))
|
|
728
|
+
.filter((pField) => !tmpSearch || String(pField.DisplayName || pField.FilterKey).toLowerCase().includes(tmpSearch))
|
|
729
|
+
.sort((pA, pB) => String(pA.DisplayName || pA.FilterKey).localeCompare(String(pB.DisplayName || pB.FilterKey)))
|
|
730
|
+
.map((pField) =>
|
|
731
|
+
{
|
|
732
|
+
const tmpExpanded = (pField.FilterKey === this._addFilterExpandedKey);
|
|
733
|
+
return {
|
|
734
|
+
FilterKey: pField.FilterKey,
|
|
735
|
+
DisplayName: pField.DisplayName || pField.FilterKey,
|
|
736
|
+
ExpandedClass: tmpExpanded ? 'is-expanded' : '',
|
|
737
|
+
ClausesToShow: tmpExpanded ? pField.AvailableClauses : [],
|
|
738
|
+
};
|
|
739
|
+
});
|
|
740
|
+
this.pict.AppData.PRSPAddFilter =
|
|
741
|
+
{
|
|
742
|
+
RecordSet: pRecordSet,
|
|
743
|
+
ViewContext: this._addFilterViewContext,
|
|
744
|
+
Search: this._addFilterSearch || '',
|
|
745
|
+
IsEmpty: tmpFields.length === 0,
|
|
746
|
+
Fields: tmpFields,
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/** Reflect the add-filter popover's open/closed state on its container element. */
|
|
751
|
+
_paintAddFilterOpenState()
|
|
752
|
+
{
|
|
753
|
+
const tmpPopover = document.getElementById('PRSP_AddFilter_Popover');
|
|
754
|
+
if (tmpPopover) { tmpPopover.classList.toggle('open', !!this._addFilterOpen); }
|
|
626
755
|
}
|
|
627
756
|
|
|
628
757
|
/**
|
|
@@ -716,34 +845,15 @@ class ViewRecordSetSUBSETFilters extends libPictView
|
|
|
716
845
|
onAfterRender(pRenderable)
|
|
717
846
|
{
|
|
718
847
|
const res = super.onAfterRender(pRenderable);
|
|
719
|
-
|
|
848
|
+
// Add-filter popover sub-renders (the panel + its list) only repaint that widget — skip the
|
|
849
|
+
// heavy post-render pass below and just keep the open/closed class in sync.
|
|
850
|
+
if (pRenderable?.RenderableHash === 'PRSP_AddFilter_Popover' || pRenderable?.RenderableHash === 'PRSP_AddFilter_List')
|
|
720
851
|
{
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
const tmpRecord = { };
|
|
724
|
-
const tmpSelect = document.getElementById('PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-Select');
|
|
725
|
-
if (tmpSelect)
|
|
726
|
-
{
|
|
727
|
-
const tmpActiveOption = document.getElementById('PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-Select')?.querySelector('option:checked');
|
|
728
|
-
const tmpRecordSet = tmpActiveOption?.getAttribute('data-i-recordset');
|
|
729
|
-
const tmpFilterKey = tmpActiveOption?.getAttribute('data-i-filter-key');
|
|
730
|
-
const tmpViewContext = tmpSelect?.getAttribute('data-i-view-context');
|
|
731
|
-
if (tmpRecordSet && tmpFilterKey)
|
|
732
|
-
{
|
|
733
|
-
const tmpProvider = this.pict.providers[`RSP-Provider-${tmpRecordSet}`];
|
|
734
|
-
if (tmpProvider)
|
|
735
|
-
{
|
|
736
|
-
tmpRecord.RecordSet = tmpRecordSet;
|
|
737
|
-
tmpRecord.FilterKey = tmpFilterKey;
|
|
738
|
-
tmpRecord.ViewContext = tmpViewContext;
|
|
739
|
-
tmpRecord.AvailableClauses = tmpProvider.getFilterClauseSchemaForKey(tmpFilterKey).AvailableClauses;
|
|
740
|
-
if (Array.isArray(tmpRecord.AvailableClauses))
|
|
741
|
-
{
|
|
742
|
-
this.render('PRSP-SUBSET-Filters-Template-AddFilter-Dropdown-AddFilterClauseDropdown', undefined, tmpRecord, pRenderable);
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}
|
|
852
|
+
this._paintAddFilterOpenState();
|
|
853
|
+
return res;
|
|
746
854
|
}
|
|
855
|
+
// Any full re-render rebuilds the add-filter slot, so the popover is closed — reset its state.
|
|
856
|
+
this._addFilterOpen = false;
|
|
747
857
|
this.onMarshalToView();
|
|
748
858
|
|
|
749
859
|
// NOTE: This is where we ensure the filter experience is applied after a render.
|
|
@@ -21,6 +21,12 @@ declare class ViewRecordSetSUBSETFilters extends libPictView {
|
|
|
21
21
|
_drawerOpen: boolean;
|
|
22
22
|
_searchString: {};
|
|
23
23
|
_renderEpoch: number;
|
|
24
|
+
_addFilterOpen: boolean;
|
|
25
|
+
_addFilterRecordSet: string;
|
|
26
|
+
_addFilterViewContext: string;
|
|
27
|
+
_addFilterSearch: string;
|
|
28
|
+
_addFilterExpandedKey: any;
|
|
29
|
+
filterFieldBlacklist: any[];
|
|
24
30
|
/**
|
|
25
31
|
* Bump the render epoch. Call this whenever the active filter clauses are
|
|
26
32
|
* about to change in a way that would invalidate in-flight filter renders.
|
|
@@ -125,7 +131,28 @@ declare class ViewRecordSetSUBSETFilters extends libPictView {
|
|
|
125
131
|
* @param {string} pRecordSet - The record set being filtered
|
|
126
132
|
* @param {string} pViewContext - The view context for the filter (ex. List, Dashboard)
|
|
127
133
|
*/
|
|
128
|
-
|
|
134
|
+
toggleAddFilterPopover(pEvent: Event, pRecordSet: string, pViewContext: string): void;
|
|
135
|
+
/** Close the add-filter popover. */
|
|
136
|
+
closeAddFilterPopover(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Filter the add-filter field list by a search term, re-rendering only the list so the
|
|
139
|
+
* search input keeps focus.
|
|
140
|
+
* @param {string} pValue - The search term.
|
|
141
|
+
*/
|
|
142
|
+
searchAddFilter(pValue: string): void;
|
|
143
|
+
/**
|
|
144
|
+
* Expand or collapse a field's available clauses in the add-filter popover.
|
|
145
|
+
* @param {string} pFilterKey - The field whose clauses to toggle.
|
|
146
|
+
*/
|
|
147
|
+
toggleAddFilterField(pFilterKey: string): void;
|
|
148
|
+
/**
|
|
149
|
+
* (Re)build the add-filter popover's field list into AppData from the record set's filter
|
|
150
|
+
* schema, honouring the current search term and the expanded field.
|
|
151
|
+
* @param {string} pRecordSet - The record set whose filter schema to read.
|
|
152
|
+
*/
|
|
153
|
+
_buildAddFilterFields(pRecordSet: string): void;
|
|
154
|
+
/** Reflect the add-filter popover's open/closed state on its container element. */
|
|
155
|
+
_paintAddFilterOpenState(): void;
|
|
129
156
|
/**
|
|
130
157
|
* @param {Event} pEvent - The DOM event that triggered the search
|
|
131
158
|
* @param {string} pRecordSet - The record set being filtered
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordSet-Filters.d.ts","sourceRoot":"","sources":["../../source/views/RecordSet-Filters.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RecordSet-Filters.d.ts","sourceRoot":"","sources":["../../source/views/RecordSet-Filters.js"],"names":[],"mappings":";AAoTA;IAEC,2DAoDC;IAhDA,kHAAkH;IAClH,MADW,GAAe,GAAG,OAAO,MAAM,CAAC,GAAG;QAAE,oBAAoB,EAAE;;;;;;;;SAAsC,CAAA;KAAE,CACrG;IAeT,cAA+E;IAG/E,wCAA0E;IAK1E,gCAAmC;IACnC,4BAA6B;IAC7B,+BAAgC;IAGhC,qBAAwB;IACxB,kBAAuB;IAQvB,qBAAqB;IAErB,wBAA2B;IAC3B,4BAA+B;IAC/B,8BAAiC;IACjC,yBAA0B;IAC1B,2BAAiC;IAGjC,4BAA8B;IAG/B;;;;;OAKG;IACH,mBAFY,MAAM,CAMjB;IAED;;;OAGG;IACH,gDAGC;IAED;;;OAGG;IACH,mDAGC;IAED;;OAEG;IACH,gCAGC;IAED;;OAEG;IACH,mCAGC;IAED;;OAEG;IACH,6BAFY,MAAM,CAKjB;IAED;;;;OAIG;IACH,kCAJW,MAAM,GAEL,GAAG,CAMd;IAKD;;;OAGG;IACH,qBAFa,GAAG,CAaf;IAED;;;OAGG;IACH,mBAFa,GAAG,CAaf;IAED,iEAAiE;IACjE,8BAMC;IAED;;;;;;;OAOG;IACH,sBAFY,MAAM,CAcjB;IAED,yEAAyE;IACzE,8CAKC;IAED;;;;;;OAMG;IACH,iCAFW,MAAM,QAehB;IAED;;;;OAIG;IACH,qBAJW,KAAK,cACL,MAAM,gBACN,MAAM,QAUhB;IAED;;;;OAIG;IACH,0BAJW,MAAM,gBACN,MAAM,kBACN,MAAM,QAsDhB;IAED;;;;;OAKG;IACH,oBAJW,KAAK,cACL,MAAM,gBACN,MAAM,QAWhB;IAGD;;;;;OAKG;IACH,oBAJW,KAAK,cACL,MAAM,gBACN,MAAM,QAoBhB;IAED;;;;;MAKE;IACF,qBALW,KAAK,cACL,MAAM,gBACN,MAAM,GACJ,OAAO,CAQnB;IAED;;;;OAIG;IACH,+BAJW,KAAK,cACL,MAAM,gBACN,MAAM,QAiBhB;IAED,oCAAoC;IACpC,8BAKC;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,iCAFW,MAAM,QAOhB;IAED;;;;OAIG;IACH,kCAFW,MAAM,QAgChB;IAED,mFAAmF;IACnF,iCAIC;IAED;;;;;;OAMG;IACH,kBANW,KAAK,cACL,MAAM,gBACN,MAAM,cACN,MAAM,cACN,MAAM,QAWhB;IAED;;;;;OAKG;IACH,qBALW,KAAK,cACL,MAAM,gBACN,MAAM,sBACN,MAAM,QAWhB;IAED;;;;OAIG;IACH,4BAHW,MAAM,GACL,KAAK,CAAC,GAAG,CAAC,CAMrB;IAgGD;;;;OAIG;IACH,uCAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClB,OAAO,CAAC,MAAM,CAAC,CAiB1B;IAED;;;;OAIG;IACH,yCAHW,MAAM,GACL,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAUvC;IAED;;;;OAIG;IACH,iBAJW,MAAM,aACN,iBAAiB,GAChB,OAAO,CAAC,WAAW,CAAC,CAU/B;IAED;;;OAGG;IACH,sBAHW,UAAU,aACV,iBAAiB,mBAa3B;IAED;;;OAGG;IACH,oBAHW,WAAW,GACV,MAAM,CA2BjB;IAED;;;OAGG;IACH,eAHW,MAAM,GACL,WAAW,CAsCtB;CACD;;;;;;;AA3gCD,kCAAkC;AAClC,oDADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAoQ5B"}
|