@openmfp/ngx 0.14.7 → 0.14.9

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmfp/ngx",
3
- "version": "0.14.7",
3
+ "version": "0.14.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/openmfp/webcomponents.git"
@@ -249,15 +249,14 @@ interface DeleteResourceConfirmationConfig {
249
249
  cancelLabel?: string;
250
250
  }
251
251
  /**
252
- * One entry in the {@link TableCardConfig.filterTabs} strip rendered above the
253
- * table. Clicking a tab activates that filter; the host receives the selected
254
- * definition via the `filterTabChanged` output and is responsible for applying
255
- * the filter to its data set.
252
+ * One entry in the {@link TableCardSearchConfig.filterTabs} strip rendered
253
+ * above the table. Clicking a tab activates that filter; the host receives the
254
+ * selected definition via the `filterTabChanged` output and is responsible for
255
+ * applying the filter to its data set.
256
256
  *
257
257
  * The strip renders exactly the array of `FieldFilterDefinition` it receives
258
258
  * — no extra "All" / no-filter tab is auto-added. If the host wants such an
259
- * option it must author it as a regular filter entry (e.g.
260
- * `{ label: 'All', property: '<some-field>', value: '*' }`).
259
+ * option it must author it as a regular filter entry.
261
260
  */
262
261
  interface FieldFilterDefinition {
263
262
  /** Visible label rendered as the tab text. */
@@ -294,6 +293,37 @@ interface TableCardButtonSettings {
294
293
  /** Partial override for the per-row "Delete" button. */
295
294
  deleteButton?: Partial<ButtonSettings>;
296
295
  }
296
+ /**
297
+ * Groups all search/filter concerns for `<mfp-declarative-table-card>`. Passing
298
+ * this object opts the card into showing the search input and (if `filterTabs`
299
+ * is set) the filter-tab strip. Omit the whole object to hide both.
300
+ *
301
+ * `initialSearch` and `initialFilter` are **one-shot seeds** — read once when
302
+ * the card mounts (or when they first appear) and never re-applied afterwards.
303
+ * User-driven updates continue to flow through the `searchChanged` and
304
+ * `filterTabChanged` outputs; the host is expected to keep its own state.
305
+ */
306
+ interface TableCardSearchConfig {
307
+ /**
308
+ * One-shot seed for the search input. Applied to the internal `searchControl`
309
+ * on first render (or the first time `searchConfig` appears), without
310
+ * emitting `searchChanged`. Later changes to this value have no effect.
311
+ */
312
+ initialSearch?: string;
313
+ /**
314
+ * Predefined filters rendered as a horizontal tab strip above the table.
315
+ * Omit (or pass an empty array) to hide the strip while keeping the search
316
+ * input visible.
317
+ */
318
+ filterTabs?: FieldFilterDefinition[];
319
+ /**
320
+ * One-shot seed for the initially selected filter tab. Must match a
321
+ * `filterTabs` entry by `property`+`value` to take effect. When set, this
322
+ * takes precedence over any `default: true` flag on filter entries.
323
+ * User-driven tab changes afterwards flow through `filterTabChanged`.
324
+ */
325
+ initialFilter?: FieldFilterDefinition;
326
+ }
297
327
  /** Top-level configuration for `<mfp-declarative-table-card>`. */
298
328
  interface TableCardConfig {
299
329
  /** Card heading. */
@@ -304,19 +334,18 @@ interface TableCardConfig {
304
334
  tableConfig: TableConfig;
305
335
  /** Overrides for built-in toolbar and row-action buttons. */
306
336
  buttonSettings?: TableCardButtonSettings;
307
- /** When `true`, shows the search input and button in the card toolbar. */
308
- resourcesSearchable?: boolean;
337
+ /**
338
+ * Search-and-filter configuration. When present, the card shows the search
339
+ * input in the toolbar. Its `filterTabs` (if any) render as a strip above
340
+ * the table. Omit the whole object to hide the search UI and filter strip.
341
+ */
342
+ searchConfig?: TableCardSearchConfig;
309
343
  /** When set, enables the "Create" button and create dialog. */
310
344
  createResourceFormConfig?: ResourceFormConfig;
311
345
  /** When set, enables per-row "Edit" button and edit dialog. */
312
346
  editResourceFormConfig?: ResourceFormConfig;
313
347
  /** When set, enables per-row "Delete" button and confirmation dialog. */
314
348
  deleteResourceConfirmationConfig?: DeleteResourceConfirmationConfig;
315
- /**
316
- * Predefined filters rendered as a horizontal tab strip above the table.
317
- * Omit (or pass an empty array) to hide the strip entirely.
318
- */
319
- filterTabs?: FieldFilterDefinition[];
320
349
  }
321
350
 
322
351
  type SearchState = 'collapsed' | 'expanded' | 'collapsing';
@@ -361,9 +390,9 @@ declare class DeclarativeTableCard<T extends GenericResource> {
361
390
  protected searchButtonConfig: _angular_core.Signal<Partial<_openmfp_ngx.ButtonSettings> | undefined>;
362
391
  protected effectiveColumns: _angular_core.Signal<TableFieldDefinition[]>;
363
392
  protected editInitialValue: _angular_core.Signal<Record<string, unknown>>;
364
- /** Filter-tab definitions for the strip rendered above the table. */
393
+ protected searchConfig: _angular_core.Signal<_openmfp_ngx.TableCardSearchConfig | undefined>;
394
+ protected resourcesSearchable: _angular_core.Signal<boolean>;
365
395
  protected filterTabs: _angular_core.Signal<FieldFilterDefinition[]>;
366
- /** Whether the tab strip should render at all. */
367
396
  protected hasFilterTabs: _angular_core.Signal<boolean>;
368
397
  private readonly injector;
369
398
  constructor();
@@ -1296,4 +1325,4 @@ declare class WhatsNew {
1296
1325
  }
1297
1326
 
1298
1327
  export { BooleanValue, CARD_TYPES, Dashboard, DeclarativeForm, DeclarativeTable, DeclarativeTableCard, Favorites, LinkValue, ResourceField, SecretValue, ServiceStatusCard, TagListValue, VisitedServiceCard, WhatsNew };
1299
- export type { ButtonSettings, CardConfig, CardsType, CssRule, DashboardButtonsSettings, DashboardConfig, DeleteResourceConfirmationConfig, FieldDefinition, FieldFilterDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, MountCfg, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, RuleCondition, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableConfig, TableFieldDefinition, TransformType, UiSettings, ValueRule };
1328
+ export type { ButtonSettings, CardConfig, CardsType, CssRule, DashboardButtonsSettings, DashboardConfig, DeleteResourceConfirmationConfig, FieldDefinition, FieldFilterDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, MountCfg, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, RuleCondition, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableCardSearchConfig, TableConfig, TableFieldDefinition, TransformType, UiSettings, ValueRule };