pict-section-recordset 1.2.0 → 1.3.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/package.json
CHANGED
|
@@ -58,12 +58,36 @@ 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: 250px; max-width: 340px; display: none; }
|
|
71
|
+
.prsp-addfilter-pop.open { display: block; }
|
|
72
|
+
.prsp-addfilter-panel { background: var(--theme-color-background-panel, #fff); border: 1px solid var(--theme-color-border-default, #d7dce3);
|
|
73
|
+
border-radius: 10px; box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14); overflow: hidden; }
|
|
74
|
+
.prsp-addfilter-search { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--theme-color-border-light, #e8ebf0); }
|
|
75
|
+
.prsp-addfilter-search-ic { display: inline-flex; color: var(--theme-color-text-muted, #6b7686); font-size: 0.9rem; }
|
|
76
|
+
.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); }
|
|
77
|
+
.prsp-addfilter-list { max-height: 280px; overflow-y: auto; }
|
|
78
|
+
.prsp-addfilter-empty { padding: 0.7rem 0.8rem; color: var(--theme-color-text-muted, #6b7686); font-size: 0.86rem; }
|
|
79
|
+
.prsp-addfilter-field { border-bottom: 1px solid var(--theme-color-border-light, #eef1f5); }
|
|
80
|
+
.prsp-addfilter-field:last-child { border-bottom: none; }
|
|
81
|
+
.prsp-addfilter-field-btn { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%;
|
|
82
|
+
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); }
|
|
83
|
+
.prsp-addfilter-field-btn:hover { background: var(--theme-color-background-tertiary, #eceef2); }
|
|
84
|
+
.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; }
|
|
85
|
+
.prsp-addfilter-field.is-expanded .prsp-addfilter-chev { transform: rotate(90deg); }
|
|
86
|
+
.prsp-addfilter-clauses { display: flex; flex-direction: column; }
|
|
87
|
+
.prsp-addfilter-clause { display: flex; align-items: center; gap: 0.4rem; width: 100%; text-align: left; cursor: pointer;
|
|
88
|
+
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); }
|
|
89
|
+
.prsp-addfilter-clause:hover { background: color-mix(in srgb, var(--theme-color-brand-primary, #156dd1) 10%, transparent); color: var(--theme-color-brand-primary, #156dd1); }
|
|
90
|
+
.prsp-addfilter-clause-ic { display: inline-flex; font-size: 0.8rem; }
|
|
67
91
|
`,
|
|
68
92
|
CSSPriority: 500,
|
|
69
93
|
|
|
@@ -149,54 +173,62 @@ const _DEFAULT_CONFIGURATION_SUBSET_Filter =
|
|
|
149
173
|
Template: /*html*/`
|
|
150
174
|
<!-- DefaultPackage pict view template: [PRSP-SUBSET-Filters-Template-AddFilter-Fieldset] -->
|
|
151
175
|
<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
|
|
176
|
+
<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>
|
|
177
|
+
<div class="prsp-addfilter-pop" id="PRSP_AddFilter_Popover"></div>
|
|
154
178
|
</div>
|
|
155
179
|
<!-- DefaultPackage end view template: [PRSP-SUBSET-Filters-Template-AddFilter-Fieldset] -->
|
|
156
180
|
`
|
|
157
181
|
},
|
|
158
182
|
{
|
|
159
|
-
Hash: 'PRSP-
|
|
183
|
+
Hash: 'PRSP-AddFilter-Popover',
|
|
160
184
|
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">
|
|
185
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-Popover] -->
|
|
186
|
+
<div class="prsp-addfilter-panel">
|
|
187
|
+
<div class="prsp-addfilter-search">
|
|
188
|
+
<span class="prsp-addfilter-search-ic">{~I:Search~}</span>
|
|
189
|
+
<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(); }">
|
|
190
|
+
</div>
|
|
191
|
+
<div class="prsp-addfilter-list" id="PRSP_AddFilter_List">
|
|
192
|
+
{~T:PRSP-AddFilter-List~}
|
|
173
193
|
</div>
|
|
174
194
|
</div>
|
|
175
|
-
<!-- DefaultPackage end view template:
|
|
195
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-Popover] -->
|
|
176
196
|
`
|
|
177
197
|
},
|
|
178
198
|
{
|
|
179
|
-
Hash: 'PRSP-
|
|
199
|
+
Hash: 'PRSP-AddFilter-List',
|
|
180
200
|
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] -->
|
|
201
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-List] -->
|
|
202
|
+
{~TS:PRSP-AddFilter-Field:AppData.PRSPAddFilter.Fields~}
|
|
203
|
+
{~NE:AppData.PRSPAddFilter.IsEmpty^<div class="prsp-addfilter-empty">No filters found.</div>~}
|
|
204
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-List] -->
|
|
190
205
|
`
|
|
191
206
|
},
|
|
192
207
|
{
|
|
193
|
-
Hash: 'PRSP-
|
|
208
|
+
Hash: 'PRSP-AddFilter-Field',
|
|
194
209
|
Template: /*html*/`
|
|
195
|
-
<!-- DefaultPackage pict view template: [PRSP-
|
|
196
|
-
<
|
|
197
|
-
{~D:Record.
|
|
198
|
-
|
|
199
|
-
|
|
210
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-Field] -->
|
|
211
|
+
<div class="prsp-addfilter-field {~D:Record.ExpandedClass~}">
|
|
212
|
+
<button type="button" class="prsp-addfilter-field-btn" onclick="_Pict.views['PRSP-Filters'].toggleAddFilterField('{~D:Record.FilterKey~}')">
|
|
213
|
+
<span class="prsp-addfilter-field-name">{~D:Record.DisplayName~}</span>
|
|
214
|
+
<span class="prsp-addfilter-chev">{~I:ChevronRight~}</span>
|
|
215
|
+
</button>
|
|
216
|
+
<div class="prsp-addfilter-clauses">
|
|
217
|
+
{~TS:PRSP-AddFilter-Clause:Record.ClausesToShow~}
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-Field] -->
|
|
221
|
+
`
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
Hash: 'PRSP-AddFilter-Clause',
|
|
225
|
+
Template: /*html*/`
|
|
226
|
+
<!-- DefaultPackage pict view template: [PRSP-AddFilter-Clause] -->
|
|
227
|
+
<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~}')">
|
|
228
|
+
<span class="prsp-addfilter-clause-ic">{~I:Plus~}</span>
|
|
229
|
+
<span>{~D:Record.DisplayName~}</span>
|
|
230
|
+
</button>
|
|
231
|
+
<!-- DefaultPackage end view template: [PRSP-AddFilter-Clause] -->
|
|
200
232
|
`
|
|
201
233
|
},
|
|
202
234
|
],
|
|
@@ -210,15 +242,15 @@ const _DEFAULT_CONFIGURATION_SUBSET_Filter =
|
|
|
210
242
|
RenderMethod: 'replace'
|
|
211
243
|
},
|
|
212
244
|
{
|
|
213
|
-
RenderableHash: '
|
|
214
|
-
TemplateHash: 'PRSP-
|
|
215
|
-
ContentDestinationAddress: '#
|
|
245
|
+
RenderableHash: 'PRSP_AddFilter_Popover',
|
|
246
|
+
TemplateHash: 'PRSP-AddFilter-Popover',
|
|
247
|
+
ContentDestinationAddress: '#PRSP_AddFilter_Popover',
|
|
216
248
|
RenderMethod: 'replace',
|
|
217
249
|
},
|
|
218
250
|
{
|
|
219
|
-
RenderableHash: '
|
|
220
|
-
TemplateHash: 'PRSP-
|
|
221
|
-
ContentDestinationAddress: '#
|
|
251
|
+
RenderableHash: 'PRSP_AddFilter_List',
|
|
252
|
+
TemplateHash: 'PRSP-AddFilter-List',
|
|
253
|
+
ContentDestinationAddress: '#PRSP_AddFilter_List',
|
|
222
254
|
RenderMethod: 'replace',
|
|
223
255
|
},
|
|
224
256
|
],
|
|
@@ -315,6 +347,15 @@ class ViewRecordSetSUBSETFilters extends libPictView
|
|
|
315
347
|
// stale callback doesn't clobber DOM that now belongs to a different
|
|
316
348
|
// filter experience.
|
|
317
349
|
this._renderEpoch = 0;
|
|
350
|
+
// Add-filter popover state (module-owned, replaces the old native <select> pickers).
|
|
351
|
+
this._addFilterOpen = false;
|
|
352
|
+
this._addFilterRecordSet = null;
|
|
353
|
+
this._addFilterViewContext = null;
|
|
354
|
+
this._addFilterSearch = '';
|
|
355
|
+
this._addFilterExpandedKey = null;
|
|
356
|
+
// FilterKeys to hide from the add-filter popover (e.g. internal/audit columns). Host apps
|
|
357
|
+
// set this; it is merged with a per-record-set config `FilterFieldBlacklist`.
|
|
358
|
+
this.filterFieldBlacklist = [];
|
|
318
359
|
}
|
|
319
360
|
|
|
320
361
|
/**
|
|
@@ -617,12 +658,96 @@ class ViewRecordSetSUBSETFilters extends libPictView
|
|
|
617
658
|
* @param {string} pRecordSet - The record set being filtered
|
|
618
659
|
* @param {string} pViewContext - The view context for the filter (ex. List, Dashboard)
|
|
619
660
|
*/
|
|
620
|
-
|
|
661
|
+
toggleAddFilterPopover(pEvent, pRecordSet, pViewContext)
|
|
621
662
|
{
|
|
622
|
-
if (pEvent) pEvent.preventDefault();
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
663
|
+
if (pEvent) { pEvent.preventDefault(); }
|
|
664
|
+
if (this._addFilterOpen)
|
|
665
|
+
{
|
|
666
|
+
return this.closeAddFilterPopover();
|
|
667
|
+
}
|
|
668
|
+
this._addFilterOpen = true;
|
|
669
|
+
this._addFilterRecordSet = pRecordSet;
|
|
670
|
+
this._addFilterViewContext = pViewContext;
|
|
671
|
+
this._addFilterSearch = '';
|
|
672
|
+
this._addFilterExpandedKey = null;
|
|
673
|
+
this._buildAddFilterFields(pRecordSet);
|
|
674
|
+
this.render('PRSP_AddFilter_Popover', undefined, { RecordSet: pRecordSet, ViewContext: pViewContext });
|
|
675
|
+
this._paintAddFilterOpenState();
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/** Close the add-filter popover. */
|
|
679
|
+
closeAddFilterPopover()
|
|
680
|
+
{
|
|
681
|
+
this._addFilterOpen = false;
|
|
682
|
+
this._addFilterExpandedKey = null;
|
|
683
|
+
this._paintAddFilterOpenState();
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Filter the add-filter field list by a search term, re-rendering only the list so the
|
|
688
|
+
* search input keeps focus.
|
|
689
|
+
* @param {string} pValue - The search term.
|
|
690
|
+
*/
|
|
691
|
+
searchAddFilter(pValue)
|
|
692
|
+
{
|
|
693
|
+
this._addFilterSearch = pValue || '';
|
|
694
|
+
this._buildAddFilterFields(this._addFilterRecordSet);
|
|
695
|
+
this.render('PRSP_AddFilter_List', undefined, { RecordSet: this._addFilterRecordSet, ViewContext: this._addFilterViewContext });
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Expand or collapse a field's available clauses in the add-filter popover.
|
|
700
|
+
* @param {string} pFilterKey - The field whose clauses to toggle.
|
|
701
|
+
*/
|
|
702
|
+
toggleAddFilterField(pFilterKey)
|
|
703
|
+
{
|
|
704
|
+
this._addFilterExpandedKey = (this._addFilterExpandedKey === pFilterKey) ? null : pFilterKey;
|
|
705
|
+
this._buildAddFilterFields(this._addFilterRecordSet);
|
|
706
|
+
this.render('PRSP_AddFilter_List', undefined, { RecordSet: this._addFilterRecordSet, ViewContext: this._addFilterViewContext });
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* (Re)build the add-filter popover's field list into AppData from the record set's filter
|
|
711
|
+
* schema, honouring the current search term and the expanded field.
|
|
712
|
+
* @param {string} pRecordSet - The record set whose filter schema to read.
|
|
713
|
+
*/
|
|
714
|
+
_buildAddFilterFields(pRecordSet)
|
|
715
|
+
{
|
|
716
|
+
const tmpProvider = this.pict.providers[`RSP-Provider-${pRecordSet}`];
|
|
717
|
+
const tmpSchema = (tmpProvider && typeof tmpProvider.getFilterSchema === 'function') ? tmpProvider.getFilterSchema() : {};
|
|
718
|
+
const tmpRecordSetConfig = this.pict.PictSectionRecordSet?.recordSetProviderConfigurations?.[pRecordSet] || {};
|
|
719
|
+
const tmpBlacklist = [].concat(this.filterFieldBlacklist || [], Array.isArray(tmpRecordSetConfig.FilterFieldBlacklist) ? tmpRecordSetConfig.FilterFieldBlacklist : []);
|
|
720
|
+
const tmpSearch = (this._addFilterSearch || '').toLowerCase();
|
|
721
|
+
const tmpFields = Object.values(tmpSchema)
|
|
722
|
+
.filter((pField) => Array.isArray(pField.AvailableClauses) && pField.AvailableClauses.length > 0)
|
|
723
|
+
.filter((pField) => !tmpBlacklist.includes(pField.FilterKey))
|
|
724
|
+
.filter((pField) => !tmpSearch || String(pField.DisplayName || pField.FilterKey).toLowerCase().includes(tmpSearch))
|
|
725
|
+
.sort((pA, pB) => String(pA.DisplayName || pA.FilterKey).localeCompare(String(pB.DisplayName || pB.FilterKey)))
|
|
726
|
+
.map((pField) =>
|
|
727
|
+
{
|
|
728
|
+
const tmpExpanded = (pField.FilterKey === this._addFilterExpandedKey);
|
|
729
|
+
return {
|
|
730
|
+
FilterKey: pField.FilterKey,
|
|
731
|
+
DisplayName: pField.DisplayName || pField.FilterKey,
|
|
732
|
+
ExpandedClass: tmpExpanded ? 'is-expanded' : '',
|
|
733
|
+
ClausesToShow: tmpExpanded ? pField.AvailableClauses : [],
|
|
734
|
+
};
|
|
735
|
+
});
|
|
736
|
+
this.pict.AppData.PRSPAddFilter =
|
|
737
|
+
{
|
|
738
|
+
RecordSet: pRecordSet,
|
|
739
|
+
ViewContext: this._addFilterViewContext,
|
|
740
|
+
Search: this._addFilterSearch || '',
|
|
741
|
+
IsEmpty: tmpFields.length === 0,
|
|
742
|
+
Fields: tmpFields,
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/** Reflect the add-filter popover's open/closed state on its container element. */
|
|
747
|
+
_paintAddFilterOpenState()
|
|
748
|
+
{
|
|
749
|
+
const tmpPopover = document.getElementById('PRSP_AddFilter_Popover');
|
|
750
|
+
if (tmpPopover) { tmpPopover.classList.toggle('open', !!this._addFilterOpen); }
|
|
626
751
|
}
|
|
627
752
|
|
|
628
753
|
/**
|
|
@@ -716,34 +841,15 @@ class ViewRecordSetSUBSETFilters extends libPictView
|
|
|
716
841
|
onAfterRender(pRenderable)
|
|
717
842
|
{
|
|
718
843
|
const res = super.onAfterRender(pRenderable);
|
|
719
|
-
|
|
844
|
+
// Add-filter popover sub-renders (the panel + its list) only repaint that widget — skip the
|
|
845
|
+
// heavy post-render pass below and just keep the open/closed class in sync.
|
|
846
|
+
if (pRenderable?.RenderableHash === 'PRSP_AddFilter_Popover' || pRenderable?.RenderableHash === 'PRSP_AddFilter_List')
|
|
720
847
|
{
|
|
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
|
-
}
|
|
848
|
+
this._paintAddFilterOpenState();
|
|
849
|
+
return res;
|
|
746
850
|
}
|
|
851
|
+
// Any full re-render rebuilds the add-filter slot, so the popover is closed — reset its state.
|
|
852
|
+
this._addFilterOpen = false;
|
|
747
853
|
this.onMarshalToView();
|
|
748
854
|
|
|
749
855
|
// 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":";AAgTA;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;;;;;;;AAvgCD,kCAAkC;AAClC,oDADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgQ5B"}
|