jupiter-dynamic-forms 1.7.0 → 1.7.2

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/index.mjs CHANGED
@@ -2215,8 +2215,34 @@ let JupiterAddColumnDialog = class extends LitElement {
2215
2215
  this._instantDate = today;
2216
2216
  this._selectedType = this.periodType === "instant" ? "instant" : "duration";
2217
2217
  this._selectedDimensions.clear();
2218
+ this._autoSelectSingleMemberDimensions();
2218
2219
  this.requestUpdate();
2219
2220
  }
2221
+ _autoSelectSingleMemberDimensions() {
2222
+ this.availableDimensions.forEach((dimension) => {
2223
+ if (dimension.members && dimension.members.length === 1) {
2224
+ const member = dimension.members[0];
2225
+ const selection = {
2226
+ axisId: dimension.id,
2227
+ axisLabel: dimension.axisLabel,
2228
+ memberId: member.id,
2229
+ memberLabel: member.label,
2230
+ isTyped: false
2231
+ };
2232
+ this._selectedDimensions.set(dimension.id, selection);
2233
+ console.log(`🎯 Auto-selected single member: ${dimension.axisLabel} -> ${member.label}`);
2234
+ } else if (dimension.typedMember && (!dimension.members || dimension.members.length === 0)) {
2235
+ const selection = {
2236
+ axisId: dimension.id,
2237
+ axisLabel: dimension.axisLabel,
2238
+ isTyped: true
2239
+ // Note: typedValue will be entered in column header, not here
2240
+ };
2241
+ this._selectedDimensions.set(dimension.id, selection);
2242
+ console.log(`🎯 Auto-selected typed dimension: ${dimension.axisLabel} (value will be entered in column header)`);
2243
+ }
2244
+ });
2245
+ }
2220
2246
  render() {
2221
2247
  if (!this.open)
2222
2248
  return html``;
@@ -2225,9 +2251,7 @@ let JupiterAddColumnDialog = class extends LitElement {
2225
2251
  <div class="dialog" @click="${(e2) => e2.stopPropagation()}">
2226
2252
  <div class="dialog-header">
2227
2253
  <h2 class="dialog-title">Add Column</h2>
2228
- <p class="dialog-description">
2229
- ${this.periodType === "instant" ? "Add a new instant period column by specifying the date." : this.periodType === "duration" ? "Add a new duration period column by specifying the start and end dates." : "This section contains both instant and duration concepts. Choose the type of column to add."}
2230
- </p>
2254
+
2231
2255
  </div>
2232
2256
 
2233
2257
  <div class="dialog-content">
@@ -2258,25 +2282,27 @@ let JupiterAddColumnDialog = class extends LitElement {
2258
2282
  />
2259
2283
  </div>
2260
2284
  ` : html`
2261
- <div class="form-group">
2262
- <label class="form-label required">Start Period Date</label>
2263
- <input
2264
- type="date"
2265
- class="form-input"
2266
- .value="${this._startDate}"
2267
- @change="${this._handleStartDateChange}"
2268
- required
2269
- />
2270
- </div>
2271
- <div class="form-group">
2272
- <label class="form-label required">End Period Date</label>
2273
- <input
2274
- type="date"
2275
- class="form-input"
2276
- .value="${this._endDate}"
2277
- @change="${this._handleEndDateChange}"
2278
- required
2279
- />
2285
+ <div class="form-group date-row">
2286
+ <div class="date-field">
2287
+ <label class="form-label required">Start Period Date</label>
2288
+ <input
2289
+ type="date"
2290
+ class="form-input"
2291
+ .value="${this._startDate}"
2292
+ @change="${this._handleStartDateChange}"
2293
+ required
2294
+ />
2295
+ </div>
2296
+ <div class="date-field">
2297
+ <label class="form-label required">End Period Date</label>
2298
+ <input
2299
+ type="date"
2300
+ class="form-input"
2301
+ .value="${this._endDate}"
2302
+ @change="${this._handleEndDateChange}"
2303
+ required
2304
+ />
2305
+ </div>
2280
2306
  </div>
2281
2307
  `}
2282
2308
 
@@ -2284,7 +2310,7 @@ let JupiterAddColumnDialog = class extends LitElement {
2284
2310
  ${this.availableDimensions.length > 0 ? html`
2285
2311
  <div class="dimensions-section">
2286
2312
  <h3>Available Dimensions</h3>
2287
- <p class="form-description">Select dimensions to include in the column. You can choose specific members or enter typed values.</p>
2313
+ <p class="form-description">Select dimensions to include in the column. Domain members can be selected here, while typed dimension values will be entered directly in the column header.</p>
2288
2314
 
2289
2315
  ${this.availableDimensions.map((dimension) => {
2290
2316
  const isSelected = this._selectedDimensions.has(dimension.id);
@@ -2398,9 +2424,12 @@ JupiterAddColumnDialog.styles = css`
2398
2424
  padding: 24px;
2399
2425
  min-width: 400px;
2400
2426
  max-width: 500px;
2427
+ max-height: 90vh;
2401
2428
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
2402
2429
  transform: scale(0.9);
2403
2430
  transition: transform 0.3s ease;
2431
+ display: flex;
2432
+ flex-direction: column;
2404
2433
  }
2405
2434
 
2406
2435
  :host([open]) .dialog {
@@ -2409,6 +2438,7 @@ JupiterAddColumnDialog.styles = css`
2409
2438
 
2410
2439
  .dialog-header {
2411
2440
  margin-bottom: 20px;
2441
+ flex-shrink: 0;
2412
2442
  }
2413
2443
 
2414
2444
  .dialog-title {
@@ -2426,12 +2456,24 @@ JupiterAddColumnDialog.styles = css`
2426
2456
 
2427
2457
  .dialog-content {
2428
2458
  margin-bottom: 24px;
2459
+ flex: 1;
2460
+ overflow-y: auto;
2461
+ max-height: calc(90vh - 160px);
2429
2462
  }
2430
2463
 
2431
2464
  .form-group {
2432
2465
  margin-bottom: 16px;
2433
2466
  }
2434
2467
 
2468
+ .form-group.date-row {
2469
+ display: flex;
2470
+ gap: 12px;
2471
+ }
2472
+
2473
+ .form-group.date-row .date-field {
2474
+ flex: 1;
2475
+ }
2476
+
2435
2477
  .form-label {
2436
2478
  display: block;
2437
2479
  font-weight: 500;
@@ -2471,6 +2513,10 @@ JupiterAddColumnDialog.styles = css`
2471
2513
  display: flex;
2472
2514
  gap: 12px;
2473
2515
  justify-content: flex-end;
2516
+ flex-shrink: 0;
2517
+ border-top: 1px solid var(--jupiter-border-color, #ddd);
2518
+ padding-top: 16px;
2519
+ margin-top: 16px;
2474
2520
  }
2475
2521
 
2476
2522
  .btn {
@@ -4278,6 +4324,33 @@ let JupiterDynamicForm = class extends LitElement {
4278
4324
  removable: true,
4279
4325
  dimensionData
4280
4326
  };
4327
+ if (request.selectedDimensions && request.selectedDimensions.length > 0) {
4328
+ const typedMembers = {};
4329
+ let hasTypedDimensions = false;
4330
+ for (const dimSelection of request.selectedDimensions) {
4331
+ if (dimSelection.isTyped) {
4332
+ typedMembers[dimSelection.axisId] = dimSelection.typedValue || "";
4333
+ hasTypedDimensions = true;
4334
+ console.log(`💾 Initializing typed member data: ${dimSelection.axisLabel} = "${dimSelection.typedValue || "(empty - will be entered in column header)"}"`);
4335
+ }
4336
+ }
4337
+ if (hasTypedDimensions) {
4338
+ this._typedMemberData[newColumnId] = typedMembers;
4339
+ if (newColumn.dimensionData) {
4340
+ newColumn.dimensionData.hasTypedMembers = true;
4341
+ newColumn.dimensionData.typedMembers = request.selectedDimensions.filter((dim) => dim.isTyped).map((dim) => ({
4342
+ axisId: dim.axisId,
4343
+ axisLabel: dim.axisLabel,
4344
+ typedMemberId: dim.axisId,
4345
+ // Use axisId as typedMemberId for typed dimensions
4346
+ memberLabel: dim.axisLabel
4347
+ // Use axisLabel as memberLabel
4348
+ }));
4349
+ console.log(`� Added typed members to column dimension data:`, newColumn.dimensionData.typedMembers);
4350
+ }
4351
+ console.log(`� Initialized typed member data for column ${newColumnId}:`, typedMembers);
4352
+ }
4353
+ }
4281
4354
  if (this._currentSchema) {
4282
4355
  const targetSection = this._currentSchema.sections.find((section) => section.id === sectionId);
4283
4356
  if (targetSection) {