jupiter-dynamic-forms 1.7.0 → 1.7.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/dist/core/add-column-dialog.d.ts +1 -0
- package/dist/core/add-column-dialog.d.ts.map +1 -1
- package/dist/index.js +44 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ export declare class JupiterAddColumnDialog extends LitElement {
|
|
|
53
53
|
private _handleMemberSelection;
|
|
54
54
|
private _handleTypedValueChange;
|
|
55
55
|
private _resetForm;
|
|
56
|
+
private _autoSelectSingleMemberDimensions;
|
|
56
57
|
render(): import('lit-html').TemplateResult<1>;
|
|
57
58
|
}
|
|
58
59
|
//# sourceMappingURL=add-column-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-column-dialog.d.ts","sourceRoot":"","sources":["../../src/core/add-column-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE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
|
package/dist/index.js
CHANGED
|
@@ -206,7 +206,7 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
206
206
|
margin: 0;
|
|
207
207
|
width: auto;
|
|
208
208
|
}
|
|
209
|
-
`,k([w({type:Object})],exports.JupiterFormField.prototype,"field",2),k([w({type:String})],exports.JupiterFormField.prototype,"conceptId",2),k([w({type:String})],exports.JupiterFormField.prototype,"columnId",2),k([w()],exports.JupiterFormField.prototype,"value",2),k([w({type:Boolean})],exports.JupiterFormField.prototype,"disabled",2),k([w({type:String})],exports.JupiterFormField.prototype,"locale",2),k([w({type:Boolean})],exports.JupiterFormField.prototype,"hideLabel",2),k([C()],exports.JupiterFormField.prototype,"_errors",2),k([C()],exports.JupiterFormField.prototype,"_touched",2),exports.JupiterFormField=k([t("jupiter-form-field")],exports.JupiterFormField);var j=Object.defineProperty,L=Object.getOwnPropertyDescriptor,
|
|
209
|
+
`,k([w({type:Object})],exports.JupiterFormField.prototype,"field",2),k([w({type:String})],exports.JupiterFormField.prototype,"conceptId",2),k([w({type:String})],exports.JupiterFormField.prototype,"columnId",2),k([w()],exports.JupiterFormField.prototype,"value",2),k([w({type:Boolean})],exports.JupiterFormField.prototype,"disabled",2),k([w({type:String})],exports.JupiterFormField.prototype,"locale",2),k([w({type:Boolean})],exports.JupiterFormField.prototype,"hideLabel",2),k([C()],exports.JupiterFormField.prototype,"_errors",2),k([C()],exports.JupiterFormField.prototype,"_touched",2),exports.JupiterFormField=k([t("jupiter-form-field")],exports.JupiterFormField);var j=Object.defineProperty,L=Object.getOwnPropertyDescriptor,R=(e,t,i,o)=>{for(var r,n=o>1?void 0:o?L(t,i):t,s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o?r(t,i,n):r(n))||n);return o&&n&&j(t,i,n),n};exports.JupiterConceptTree=class extends e.LitElement{constructor(){super(...arguments),this.columns=[],this.formData={},this.disabled=!1,this.locale="en-US",this.expandedConcepts=new Set,this._expanded=!0}connectedCallback(){super.connectedCallback(),this._expanded=this.expandedConcepts.has(this.concept.id)}willUpdate(e){super.willUpdate(e),e.has("expandedConcepts")&&(this._expanded=this.expandedConcepts.has(this.concept.id))}_toggleExpanded(){this._expanded=!this._expanded,this.dispatchEvent(new CustomEvent("concept-expand",{detail:{conceptId:this.concept.id,expanded:this._expanded},bubbles:!0}))}_getFieldForColumn(e){var t;return null==(t=this.concept.fields)?void 0:t.find(t=>t.columnId===e)}_getFieldValue(e){var t;return null==(t=this.formData[this.concept.id])?void 0:t[e.columnId]}_handleFieldChange(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("field-change",{detail:e.detail,bubbles:!0}))}render(){const t=this.concept.children&&this.concept.children.length>0,i=this.concept.level||0,o=this.concept.abstract||!1;return e.html`
|
|
210
210
|
<!-- Concept Name Cell (Left Column) -->
|
|
211
211
|
<td class="concept-name-cell ${o?"abstract":t?"":"leaf"}">
|
|
212
212
|
<div class="concept-content" style="--level: ${i}">
|
|
@@ -342,13 +342,11 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
|
|
345
|
-
`,
|
|
345
|
+
`,R([w({type:Object})],exports.JupiterConceptTree.prototype,"concept",2),R([w({type:Array})],exports.JupiterConceptTree.prototype,"columns",2),R([w({type:Object})],exports.JupiterConceptTree.prototype,"formData",2),R([w({type:Boolean})],exports.JupiterConceptTree.prototype,"disabled",2),R([w({type:String})],exports.JupiterConceptTree.prototype,"locale",2),R([w({type:Set})],exports.JupiterConceptTree.prototype,"expandedConcepts",2),R([C()],exports.JupiterConceptTree.prototype,"_expanded",2),exports.JupiterConceptTree=R([t("jupiter-concept-tree")],exports.JupiterConceptTree);var A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,P=(e,t,i,o)=>{for(var r,n=o>1?void 0:o?M(t,i):t,s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o?r(t,i,n):r(n))||n);return o&&n&&A(t,i,n),n};exports.JupiterAddColumnDialog=class extends e.LitElement{constructor(){super(...arguments),this.periodType="duration",this.open=!1,this.availableDimensions=[],this._startDate="",this._endDate="",this._instantDate="",this._selectedType="duration",this._selectedDimensions=new Map}updated(e){e.has("open")&&this.open&&this._resetForm(),e.has("availableDimensions")&&console.log(`🎯 Add Column Dialog received ${this.availableDimensions.length} dimensions:`,this.availableDimensions.map(e=>e.axisLabel))}connectedCallback(){super.connectedCallback(),this._resetForm()}willUpdate(e){super.willUpdate(e),e.has("open")&&this.open&&this._resetForm()}_handleCancel(){this.open=!1,this.dispatchEvent(new CustomEvent("dialog-cancel",{bubbles:!0}))}_handleConfirm(){if(!this._isFormValid())return;const e={periodType:"mixed"===this.periodType?this._selectedType:this.periodType};"instant"===this.periodType||"mixed"===this.periodType&&"instant"===this._selectedType?e.instantDate=this._instantDate:(e.startDate=this._startDate,e.endDate=this._endDate),this._selectedDimensions.size>0&&(e.selectedDimensions=Array.from(this._selectedDimensions.values())),this.dispatchEvent(new CustomEvent("column-add",{detail:e,bubbles:!0}))}_isFormValid(){return"mixed"===this.periodType?"instant"===this._selectedType?!!this._instantDate:!!this._startDate&&!!this._endDate&&this._startDate<=this._endDate:"duration"===this.periodType?!!this._startDate&&!!this._endDate&&this._startDate<=this._endDate:"instant"===this.periodType&&!!this._instantDate}_handleStartDateChange(e){this._startDate=e.target.value}_handleEndDateChange(e){this._endDate=e.target.value}_handleSelectedTypeChange(e){this._selectedType=e.target.value}_handleInstantDateChange(e){this._instantDate=e.target.value}_handleDimensionToggle(e,t){if(t.target.checked){const t=this.availableDimensions.find(t=>t.id===e);if(t){const i={axisId:t.id,axisLabel:t.axisLabel,isTyped:!(!t.typedMember||t.members&&0!==t.members.length)};this._selectedDimensions.set(e,i)}}else this._selectedDimensions.delete(e);this.requestUpdate()}_handleMemberSelection(e,t,i){const o=this._selectedDimensions.get(e);o&&(o.memberId=t,o.memberLabel=i,this._selectedDimensions.set(e,o),this.requestUpdate())}_handleTypedValueChange(e,t){const i=t.target,o=this._selectedDimensions.get(e);o&&(o.typedValue=i.value,this._selectedDimensions.set(e,o))}_resetForm(){const e=(new Date).toISOString().split("T")[0];this._startDate=e,this._endDate=e,this._instantDate=e,this._selectedType="instant"===this.periodType?"instant":"duration",this._selectedDimensions.clear(),this._autoSelectSingleMemberDimensions(),this.requestUpdate()}_autoSelectSingleMemberDimensions(){this.availableDimensions.forEach(e=>{if(e.members&&1===e.members.length){const t=e.members[0],i={axisId:e.id,axisLabel:e.axisLabel,memberId:t.id,memberLabel:t.label,isTyped:!1};this._selectedDimensions.set(e.id,i),console.log(`🎯 Auto-selected single member: ${e.axisLabel} -> ${t.label}`)}})}render(){if(!this.open)return e.html``;const t=this._isFormValid();return e.html`
|
|
346
346
|
<div class="dialog" @click="${e=>e.stopPropagation()}">
|
|
347
347
|
<div class="dialog-header">
|
|
348
348
|
<h2 class="dialog-title">Add Column</h2>
|
|
349
|
-
|
|
350
|
-
${"instant"===this.periodType?"Add a new instant period column by specifying the date.":"duration"===this.periodType?"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."}
|
|
351
|
-
</p>
|
|
349
|
+
|
|
352
350
|
</div>
|
|
353
351
|
|
|
354
352
|
<div class="dialog-content">
|
|
@@ -379,25 +377,27 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
379
377
|
/>
|
|
380
378
|
</div>
|
|
381
379
|
`:e.html`
|
|
382
|
-
<div class="form-group">
|
|
383
|
-
<
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
<
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
380
|
+
<div class="form-group date-row">
|
|
381
|
+
<div class="date-field">
|
|
382
|
+
<label class="form-label required">Start Period Date</label>
|
|
383
|
+
<input
|
|
384
|
+
type="date"
|
|
385
|
+
class="form-input"
|
|
386
|
+
.value="${this._startDate}"
|
|
387
|
+
@change="${this._handleStartDateChange}"
|
|
388
|
+
required
|
|
389
|
+
/>
|
|
390
|
+
</div>
|
|
391
|
+
<div class="date-field">
|
|
392
|
+
<label class="form-label required">End Period Date</label>
|
|
393
|
+
<input
|
|
394
|
+
type="date"
|
|
395
|
+
class="form-input"
|
|
396
|
+
.value="${this._endDate}"
|
|
397
|
+
@change="${this._handleEndDateChange}"
|
|
398
|
+
required
|
|
399
|
+
/>
|
|
400
|
+
</div>
|
|
401
401
|
</div>
|
|
402
402
|
`}
|
|
403
403
|
|
|
@@ -511,9 +511,12 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
511
511
|
padding: 24px;
|
|
512
512
|
min-width: 400px;
|
|
513
513
|
max-width: 500px;
|
|
514
|
+
max-height: 90vh;
|
|
514
515
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
|
515
516
|
transform: scale(0.9);
|
|
516
517
|
transition: transform 0.3s ease;
|
|
518
|
+
display: flex;
|
|
519
|
+
flex-direction: column;
|
|
517
520
|
}
|
|
518
521
|
|
|
519
522
|
:host([open]) .dialog {
|
|
@@ -522,6 +525,7 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
522
525
|
|
|
523
526
|
.dialog-header {
|
|
524
527
|
margin-bottom: 20px;
|
|
528
|
+
flex-shrink: 0;
|
|
525
529
|
}
|
|
526
530
|
|
|
527
531
|
.dialog-title {
|
|
@@ -539,12 +543,24 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
539
543
|
|
|
540
544
|
.dialog-content {
|
|
541
545
|
margin-bottom: 24px;
|
|
546
|
+
flex: 1;
|
|
547
|
+
overflow-y: auto;
|
|
548
|
+
max-height: calc(90vh - 160px);
|
|
542
549
|
}
|
|
543
550
|
|
|
544
551
|
.form-group {
|
|
545
552
|
margin-bottom: 16px;
|
|
546
553
|
}
|
|
547
554
|
|
|
555
|
+
.form-group.date-row {
|
|
556
|
+
display: flex;
|
|
557
|
+
gap: 12px;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.form-group.date-row .date-field {
|
|
561
|
+
flex: 1;
|
|
562
|
+
}
|
|
563
|
+
|
|
548
564
|
.form-label {
|
|
549
565
|
display: block;
|
|
550
566
|
font-weight: 500;
|
|
@@ -584,6 +600,10 @@ const I={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x},D=(e=I,t,
|
|
|
584
600
|
display: flex;
|
|
585
601
|
gap: 12px;
|
|
586
602
|
justify-content: flex-end;
|
|
603
|
+
flex-shrink: 0;
|
|
604
|
+
border-top: 1px solid var(--jupiter-border-color, #ddd);
|
|
605
|
+
padding-top: 16px;
|
|
606
|
+
margin-top: 16px;
|
|
587
607
|
}
|
|
588
608
|
|
|
589
609
|
.btn {
|