pict-section-recordset 1.21.0 → 1.21.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-recordset",
3
- "version": "1.21.0",
3
+ "version": "1.21.1",
4
4
  "description": "Pict dynamic record set management views",
5
5
  "main": "source/Pict-Section-RecordSet.js",
6
6
  "files": [
@@ -59,6 +59,18 @@ const _DEFAULT_CONFIGURATION__Read = (
59
59
  .prsp-record-read input.input[readonly], .prsp-record-read input.input[disabled], .prsp-record-read textarea[readonly], .prsp-record-read textarea[disabled], .prsp-record-read select[disabled] { background: transparent !important; border-color: transparent !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important; height: auto !important; min-height: 0 !important; opacity: 1 !important; cursor: default !important; color: var(--theme-color-text-primary, #1f2733) !important; -webkit-text-fill-color: var(--theme-color-text-primary, #1f2733) !important; font-weight: 600 !important; font-size: 1.1rem !important; }
60
60
  .prsp-record-read .label { font-size: 0.68rem !important; font-weight: 600 !important; text-transform: uppercase !important; letter-spacing: 0.05em !important; color: var(--theme-color-text-muted, #6b7686) !important; margin-bottom: 0.05rem !important; }
61
61
  .prsp-record-read .section-header { background: var(--theme-color-background-selected, #e3edfb) !important; color: var(--theme-color-brand-primary, #156dd1) !important; font-size: 0.74rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.06em !important; padding: 0.4rem 0.8rem !important; border-radius: 6px !important; border-bottom: 0 !important; margin: 1.1rem 0 0.7rem !important; }
62
+ /* Record header — a readable title (the record's own name, via a heuristic) with the entity
63
+ type as an eyebrow, instead of a raw "RecordSet GUIDField [guid]" string. */
64
+ .prsp-read-head { margin: 0 0 1.1rem; }
65
+ .prsp-read-eyebrow { font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--theme-color-text-muted, #6b7686); }
66
+ .prsp-read-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin: 0.1rem 0 0; color: var(--theme-color-text-primary, #1f2733); }
67
+ /* Read-view association tabs — pill nav, shared by the Tab and Split layouts (single source;
68
+ layouts style only their own nav container). */
69
+ .psrs-tab { padding: 0.4rem 0.85rem; border: 1px solid var(--theme-color-border-default, #d7dce3); border-radius: 8px; cursor: pointer; font-size: 0.88rem; color: var(--theme-color-text-secondary, #45505f); background: var(--theme-color-background-panel, #fff); user-select: none; transition: all 0.15s ease; }
70
+ .psrs-tab:hover { background: var(--theme-color-background-tertiary, #eceef2); color: var(--theme-color-text-primary, #1f2733); }
71
+ .psrs-tab.is-active { border-color: var(--theme-color-brand-primary, #156dd1); background: var(--theme-color-background-selected, #e3edfb); color: var(--theme-color-brand-primary, #156dd1); font-weight: 600; }
72
+ .psrs-tab-body { display: none; }
73
+ .psrs-tab-body.is-active { display: block; }
62
74
  `,
63
75
  CSSPriority: 500,
64
76
 
@@ -119,11 +131,22 @@ const _DEFAULT_CONFIGURATION__Read = (
119
131
  Hash: 'PRSP-Read-RecordTabNav-Template',
120
132
  Template: /*html*/`<!-- Placeholder for tabs, something has gone wrong if this comment is rendered. -->`
121
133
  },
134
+ {
135
+ // Readable record header, shared by all three layouts: the record's display name (heuristic)
136
+ // over a small entity-type eyebrow, falling back to the GUID field + value when the record
137
+ // has no obvious name. DisplayTitle / TitleEyebrow are computed in renderRead().
138
+ Hash: 'PRSP-Read-Header-Template',
139
+ Template: /*html*/`
140
+ <div class="prsp-read-head">
141
+ <div class="prsp-read-eyebrow">{~D:Record.TitleEyebrow~}</div>
142
+ <h1 class="prsp-read-title">{~D:Record.DisplayTitle~}</h1>
143
+ </div>`
144
+ },
122
145
  {
123
146
  Hash: 'PRSP-Read-Basic-Template',
124
147
  Template: /*html*/`
125
148
  <!-- DefaultPackage pict view template: [PRSP-Read-Basic-Template] -->
126
- <h1>{~D:Record.RecordSet~} {~D:Record.GUIDAddress~} [{~D:Record.RecordConfiguration.GUIDRecord~}]</h1>
149
+ {~T:PRSP-Read-Header-Template~}
127
150
  <!--
128
151
  {~DJ:Record~}
129
152
  -->
@@ -156,7 +179,7 @@ const _DEFAULT_CONFIGURATION__Read = (
156
179
  .psrs-split-view.psrs-collapsed #psrs-resize { display: none; }
157
180
  .psrs-split-view.psrs-collapsed .psrs-left-panel { min-width: 100% !important; width: 100%; }
158
181
  </style>
159
- <h1>{~D:Record.RecordSet~} {~D:Record.GUIDAddress~} [{~D:Record.RecordConfiguration.GUIDRecord~}]</h1>
182
+ {~T:PRSP-Read-Header-Template~}
160
183
  <div class="psrs-split-tabnav">{~T:PRSP-Read-RecordTabNav-Template~}</div>
161
184
  <div class="psrs-split-view psrs-collapsed">
162
185
  <div class="psrs-left-panel" style="min-width: {~D:Record.SplitLeftWidth~};">
@@ -174,36 +197,14 @@ const _DEFAULT_CONFIGURATION__Read = (
174
197
  Hash: 'PRSP-Read-Tab-Template',
175
198
  Template: /*html*/`
176
199
  <!-- DefaultPackage pict view template: [PRSP-Read-Tab-Template] -->
177
- <h1>{~D:Record.RecordSet~} {~D:Record.GUIDAddress~} [{~D:Record.RecordConfiguration.GUIDRecord~}]</h1>
200
+ {~T:PRSP-Read-Header-Template~}
178
201
  <!--
179
202
  {~DJ:Record~}
180
203
  -->
181
204
  <style>
182
- #PRSP-Read-Tab-Nav
183
- {
184
- display: flex;
185
- border-bottom: 1px solid rgba(0,0,0,0.5);
186
- margin-bottom: 20px;
187
- width: 100%;
188
- }
189
- .psrs-tab.is-active
190
- {
191
- border: 1px solid rgba(0,0,0,0.5);
192
- }
193
- .psrs-tab
194
- {
195
- padding: 10px;
196
- border-right: 1px solid rgba(0,0,0,0.5);
197
- border-left: 1px solid rgba(0,0,0,0.5);
198
- }
199
- .psrs-tab-body
200
- {
201
- display: none;
202
- }
203
- .psrs-tab-body.is-active
204
- {
205
- display: inherit;
206
- }
205
+ /* Tab layout owns only its nav container; the pill styling for .psrs-tab /
206
+ .psrs-tab-body is shared from the view's persistent CSS block. */
207
+ #PRSP-Read-Tab-Nav { display: flex; flex-wrap: wrap; gap: 0.35rem; width: 100%; margin: 0 0 1.25rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--theme-color-border-light, #e8ebf0); }
207
208
  </style>
208
209
  <div class="psrs-tab-view">
209
210
  <div id="PRSP-Read-Tabs-Container">
@@ -821,6 +822,14 @@ class viewRecordSetRead extends libPictRecordSetRecordView
821
822
  `);
822
823
  }
823
824
 
825
+ // Readable record header: the record's own name (heuristic — Name / Title / DisplayName / …),
826
+ // with the entity type (camelCase split) as an eyebrow. Falls back to the GUID field + value
827
+ // when the record has no obvious display field. Computed before onBeforeRenderRead so apps can
828
+ // still override DisplayTitle / TitleEyebrow there.
829
+ const tmpReadableName = this._computeDisplayName(tmpRecordReadData.Record);
830
+ tmpRecordReadData.DisplayTitle = tmpReadableName || `${ tmpRecordReadData.GUIDAddress } [${ pRecordConfiguration.GUIDRecord }]`;
831
+ tmpRecordReadData.TitleEyebrow = String(pRecordConfiguration.RecordSet || '').replace(/([a-z0-9])([A-Z])/g, '$1 $2');
832
+
824
833
  tmpRecordReadData = this.onBeforeRenderRead(tmpRecordReadData);
825
834
 
826
835
  this.renderAsync(`PRSP_Renderable_Read_${ this.layoutType }`, tmpRecordReadData.RenderDestination, tmpRecordReadData,