ngx-form-designer 0.0.24 → 0.0.26
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/fesm2022/ngx-form-designer.mjs +23 -17
- package/fesm2022/ngx-form-designer.mjs.map +1 -1
- package/lib/form-designer/data-panel/data-panel.component.d.ts +2 -0
- package/lib/form-designer/widget-inspector.component.d.ts +1 -1
- package/lib/widgets/field-widgets/checkbox/checkbox-widget.component.d.ts +2 -2
- package/lib/widgets/field-widgets/file-upload/file-upload-widget.component.d.ts +2 -2
- package/lib/widgets/field-widgets/radio/radio-widget.component.d.ts +3 -3
- package/lib/widgets/field-widgets/search/search-widget.component.d.ts +3 -3
- package/lib/widgets/field-widgets/select/select-widget.component.d.ts +2 -2
- package/lib/widgets/field-widgets/text-field/text-field.component.d.ts +2 -2
- package/lib/widgets/widget-theme.d.ts +5 -5
- package/package.json +1 -1
- package/style-test-bug.scss +0 -2571
|
@@ -12180,7 +12180,10 @@ class DataPanelComponent {
|
|
|
12180
12180
|
return this.sourceType === 'source' && (this.isSelectedSourceEventBacked() || !!this.rowsPathSuggestion || !!this.rowsPath);
|
|
12181
12181
|
}
|
|
12182
12182
|
showScalarMappingControls() {
|
|
12183
|
-
return this.sourceType === 'source' && this.bindingShape === 'scalar';
|
|
12183
|
+
return this.sourceType === 'source' && this.bindingShape === 'scalar' && this.widgetType !== 'search';
|
|
12184
|
+
}
|
|
12185
|
+
showOptionMappingControls() {
|
|
12186
|
+
return this.sourceType === 'source' && this.widgetType !== 'table' && this.usesOptionMapping();
|
|
12184
12187
|
}
|
|
12185
12188
|
rowsPathPreviewRows() {
|
|
12186
12189
|
const effectiveRowsPath = this.effectiveRowsPath();
|
|
@@ -12215,17 +12218,20 @@ class DataPanelComponent {
|
|
|
12215
12218
|
return sample ? collectArrayPaths(sample) : [];
|
|
12216
12219
|
}
|
|
12217
12220
|
shouldPersistStructuredLabelPath() {
|
|
12218
|
-
if (this.
|
|
12221
|
+
if (!this.usesOptionMapping() || !this.labelKey)
|
|
12219
12222
|
return false;
|
|
12220
12223
|
return !!this.normalizedRowsPath() || !!this.childRowsPath || hasPathSyntax$1(this.labelKey);
|
|
12221
12224
|
}
|
|
12222
12225
|
shouldPersistStructuredValuePath() {
|
|
12223
12226
|
if (!this.valueKey)
|
|
12224
12227
|
return false;
|
|
12225
|
-
if (this.
|
|
12228
|
+
if (!this.usesOptionMapping())
|
|
12226
12229
|
return true;
|
|
12227
12230
|
return !!this.normalizedRowsPath() || !!this.childRowsPath || hasPathSyntax$1(this.valueKey);
|
|
12228
12231
|
}
|
|
12232
|
+
usesOptionMapping() {
|
|
12233
|
+
return this.bindingShape === 'list' || this.widgetType === 'search';
|
|
12234
|
+
}
|
|
12229
12235
|
updatePreviewPathState() {
|
|
12230
12236
|
const firstPreviewRow = this.previewRows[0];
|
|
12231
12237
|
this.rootPathOptions = firstPreviewRow ? collectArrayPaths(firstPreviewRow) : [];
|
|
@@ -12499,8 +12505,8 @@ class DataPanelComponent {
|
|
|
12499
12505
|
</div>
|
|
12500
12506
|
</div>
|
|
12501
12507
|
|
|
12502
|
-
<!-- Mapping
|
|
12503
|
-
<div class="flex flex-col gap-2" *ngIf="
|
|
12508
|
+
<!-- Option Mapping -->
|
|
12509
|
+
<div class="flex flex-col gap-2" *ngIf="showOptionMappingControls()">
|
|
12504
12510
|
<div class="flex items-center justify-between">
|
|
12505
12511
|
<span class="text-xs font-semibold text-gray-500 uppercase tracking-wide">Column Mapping</span>
|
|
12506
12512
|
<button (click)="autoMapKeys()" class="text-blue-600 hover:text-blue-700 text-xs font-medium flex items-center gap-1" title="Guess columns based on names">
|
|
@@ -13086,8 +13092,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
13086
13092
|
</div>
|
|
13087
13093
|
</div>
|
|
13088
13094
|
|
|
13089
|
-
<!-- Mapping
|
|
13090
|
-
<div class="flex flex-col gap-2" *ngIf="
|
|
13095
|
+
<!-- Option Mapping -->
|
|
13096
|
+
<div class="flex flex-col gap-2" *ngIf="showOptionMappingControls()">
|
|
13091
13097
|
<div class="flex items-center justify-between">
|
|
13092
13098
|
<span class="text-xs font-semibold text-gray-500 uppercase tracking-wide">Column Mapping</span>
|
|
13093
13099
|
<button (click)="autoMapKeys()" class="text-blue-600 hover:text-blue-700 text-xs font-medium flex items-center gap-1" title="Guess columns based on names">
|
|
@@ -26149,18 +26155,18 @@ function joinClasses(...classNames) {
|
|
|
26149
26155
|
// border-default: #E6EAF0
|
|
26150
26156
|
// surface-default: #FFFFFF
|
|
26151
26157
|
// focus-border: #7FB2FF
|
|
26152
|
-
const TEXT_CONTROL_BASE_CLASS = 'block w-full rounded-[4px] border bg-transparent px-3 text-
|
|
26158
|
+
const TEXT_CONTROL_BASE_CLASS = 'block w-full rounded-[4px] border bg-transparent px-3 text-sm text-[#1C2431] transition-all placeholder:text-transparent hover:border-[#1C2431]/40 focus:outline-none disabled:cursor-not-allowed disabled:border-[#E6EAF0] disabled:bg-[#E6EAF0]/40 disabled:text-[#1C2431]/40';
|
|
26153
26159
|
const TEXT_CONTROL_VALID_CLASS = 'border-[#E6EAF0] focus:border-[#7FB2FF] focus:border-2 focus:ring-0';
|
|
26154
26160
|
const TEXT_CONTROL_INVALID_CLASS = 'border-red-500 border-2 text-red-700 placeholder:text-red-300 focus:border-red-500 focus:ring-0';
|
|
26155
26161
|
const FIELD_CONTAINER_CLASS = 'relative w-full font-sans';
|
|
26156
|
-
const FIELD_LABEL_CLASS = 'mb-[0.25em] block font-sans text-
|
|
26162
|
+
const FIELD_LABEL_CLASS = 'mb-[0.25em] block font-sans text-xs font-normal tracking-[0.00937em] text-[#1C2431]/70';
|
|
26157
26163
|
const FIELD_REQUIRED_CLASS = 'text-red-500';
|
|
26158
|
-
const FIELD_HELP_CLASS = 'mt-1 text-
|
|
26159
|
-
const FIELD_ERROR_CLASS = 'mt-1 text-
|
|
26164
|
+
const FIELD_HELP_CLASS = 'mt-1 text-xs leading-5 tracking-[0.03333em] text-[#1C2431]/50';
|
|
26165
|
+
const FIELD_ERROR_CLASS = 'mt-1 text-xs font-normal leading-5 tracking-[0.03333em] text-red-500';
|
|
26160
26166
|
const FIELD_CHOICE_SURFACE_CLASS = 'flex items-start gap-3 rounded-[4px] border border-[#E6EAF0] bg-[#FFFFFF] px-3 py-3';
|
|
26161
|
-
const FIELD_CHOICE_LABEL_CLASS = 'text-
|
|
26167
|
+
const FIELD_CHOICE_LABEL_CLASS = 'text-sm leading-6 tracking-[0.01786em] text-[#1C2431]';
|
|
26162
26168
|
const FIELD_RESULTS_PANEL_CLASS = 'absolute z-30 mt-1 max-h-64 w-full overflow-auto rounded-[4px] border-0 bg-[#FFFFFF] py-2 shadow-[0_5px_5px_-3px_rgba(0,0,0,.2),0_8px_10px_1px_rgba(0,0,0,.14),0_3px_14px_2px_rgba(0,0,0,.12)]';
|
|
26163
|
-
const FIELD_OPTION_CLASS = 'block w-full px-4 py-3 text-left text-
|
|
26169
|
+
const FIELD_OPTION_CLASS = 'block w-full px-4 py-3 text-left text-sm tracking-[0.01786em] text-[#1C2431] transition hover:bg-[#7FB2FF]/[0.08] active:bg-[#7FB2FF]/[0.14]';
|
|
26164
26170
|
const FILE_UPLOAD_SHELL_CLASS = 'rounded-[4px] border border-dashed border-[#E6EAF0] bg-transparent';
|
|
26165
26171
|
const FILE_UPLOAD_CARD_CLASS = 'flex flex-col gap-0.5 rounded-[4px] border border-[#E6EAF0] bg-[#FFFFFF] px-3 py-2 text-xs text-[#1C2431] shadow-[0_1px_2px_0_rgba(0,0,0,.08)]';
|
|
26166
26172
|
const CONTENT_TEXT_CLASS = 'mb-4 leading-6 tracking-[0.03125em] text-[#1C2431] text-[0.875rem]';
|
|
@@ -26202,13 +26208,13 @@ const TABLE_ICON_BUTTON_CLASS = 'inline-flex h-10 w-10 items-center justify-cent
|
|
|
26202
26208
|
function getTextControlClass(options) {
|
|
26203
26209
|
const multiline = options?.multiline === true;
|
|
26204
26210
|
const compact = options?.compact === true;
|
|
26205
|
-
return joinClasses(TEXT_CONTROL_BASE_CLASS, options?.invalid ? TEXT_CONTROL_INVALID_CLASS : TEXT_CONTROL_VALID_CLASS, multiline ? 'min-h-[96px] py-2 leading-6 resize-y' : compact ? 'min-h-[20px] py-0.5' : 'min-h-[20px] py-0.5', options?.leadingInset && 'pl-
|
|
26211
|
+
return joinClasses(TEXT_CONTROL_BASE_CLASS, options?.invalid ? TEXT_CONTROL_INVALID_CLASS : TEXT_CONTROL_VALID_CLASS, multiline ? 'min-h-[96px] py-2 leading-6 resize-y' : compact ? 'min-h-[20px] py-0.5' : 'min-h-[20px] py-0.5', options?.leadingInset && 'pl-10', options?.trailingInset && 'pr-10');
|
|
26206
26212
|
}
|
|
26207
26213
|
function getChoiceControlClass(options) {
|
|
26208
26214
|
return joinClasses('mt-0.5 h-[18px] w-[18px] border-2 bg-[#FFFFFF] text-[#7FB2FF] transition focus:ring-2 focus:ring-[#7FB2FF] focus:ring-offset-0', options?.radio ? 'rounded-full' : 'rounded-[2px]', options?.invalid ? 'border-red-500 focus:ring-red-200' : 'border-[#1C2431]/40 checked:border-[#7FB2FF]');
|
|
26209
26215
|
}
|
|
26210
26216
|
function getFileInputClass(options) {
|
|
26211
|
-
return joinClasses('block w-full cursor-pointer rounded-[4px] border bg-transparent px-3 py-3 text-
|
|
26217
|
+
return joinClasses('block w-full cursor-pointer rounded-[4px] border bg-transparent px-3 py-3 text-sm tracking-[0.01786em] text-[#1C2431] transition hover:border-[#1C2431]/40 focus-visible:outline-none focus-visible:border-2 disabled:cursor-not-allowed disabled:border-[#E6EAF0] disabled:bg-[#E6EAF0]/40', 'file:mr-3 file:rounded-[2px] file:border file:px-3 file:py-1.5 file:text-xs file:font-medium file:tracking-[0.08929em] file:uppercase', 'file:border-[#7FB2FF] file:bg-transparent file:text-[#1C2431] hover:file:bg-[#7FB2FF]/[0.08]', options?.invalid
|
|
26212
26218
|
? 'border-red-500 border-2 text-red-700 focus-visible:border-red-500'
|
|
26213
26219
|
: 'border-[#E6EAF0] focus-visible:border-[#7FB2FF]');
|
|
26214
26220
|
}
|
|
@@ -27436,7 +27442,7 @@ class SelectWidgetComponent {
|
|
|
27436
27442
|
<p [id]="helpTextId" [class]="fieldHelpClass" data-fd="field-help">{{ config.helpText }}</p>
|
|
27437
27443
|
}
|
|
27438
27444
|
</div>
|
|
27439
|
-
`, isInline: true, styles: [":host ::ng-deep ng-select.fd-select{display:block}:host ::ng-deep ng-select.fd-select .ng-select-container{min-height:20px;border:1px solid #E6EAF0;border-radius:4px;background:#fff;box-shadow:none;transition:border-color .2s ease,box-shadow .2s ease}:host ::ng-deep ng-select.fd-select.ng-select-focused:not(.ng-select-opened) .ng-select-container,:host ::ng-deep ng-select.fd-select.ng-select-opened .ng-select-container{border-width:2px;border-color:#7fb2ff}:host ::ng-deep ng-select.fd-select[data-fd-field-state=invalid] .ng-select-container{border-width:2px;border-color:#ef4444}:host ::ng-deep ng-select.fd-select .ng-value-container{padding:2px 12px;gap:4px}:host ::ng-deep ng-select.fd-select .ng-placeholder,:host ::ng-deep ng-select.fd-select .ng-value-label,:host ::ng-deep ng-select.fd-select .ng-input>input{font-family:inherit;font-size
|
|
27445
|
+
`, isInline: true, styles: [":host ::ng-deep ng-select.fd-select{display:block}:host ::ng-deep ng-select.fd-select .ng-select-container{min-height:20px;border:1px solid #E6EAF0;border-radius:4px;background:#fff;box-shadow:none;transition:border-color .2s ease,box-shadow .2s ease}:host ::ng-deep ng-select.fd-select.ng-select-focused:not(.ng-select-opened) .ng-select-container,:host ::ng-deep ng-select.fd-select.ng-select-opened .ng-select-container{border-width:2px;border-color:#7fb2ff}:host ::ng-deep ng-select.fd-select[data-fd-field-state=invalid] .ng-select-container{border-width:2px;border-color:#ef4444}:host ::ng-deep ng-select.fd-select .ng-value-container{padding:2px 12px;gap:4px}:host ::ng-deep ng-select.fd-select .ng-placeholder,:host ::ng-deep ng-select.fd-select .ng-value-label,:host ::ng-deep ng-select.fd-select .ng-input>input{font-family:inherit;font-size:14px;line-height:20px}:host ::ng-deep ng-select.fd-select .ng-placeholder{color:#1c243166}:host ::ng-deep ng-select.fd-select .ng-select-container.ng-has-value .ng-placeholder{display:none}:host ::ng-deep ng-select.fd-select .ng-arrow-wrapper{padding-right:12px}:host ::ng-deep ng-select.fd-select .ng-arrow{border-color:rgba(28,36,49,.6) transparent transparent}:host ::ng-deep ng-select.fd-select .ng-clear-wrapper{color:#1c243199}:host ::ng-deep .ng-dropdown-panel{border:1px solid #E6EAF0;border-radius:8px;background:#fff;box-shadow:0 10px 30px #0000001f}:host ::ng-deep .ng-dropdown-panel .ng-option{padding:10px 14px;font-size:14px;line-height:20px;background:#fff;color:#1c2431}:host ::ng-deep .ng-dropdown-panel .ng-option.ng-option-marked{background:#7fb2ff14;color:#1c2431}:host ::ng-deep .ng-dropdown-panel .ng-option.ng-option-selected{background:#7fb2ff24;color:#1c2431}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }] });
|
|
27440
27446
|
}
|
|
27441
27447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectWidgetComponent, decorators: [{
|
|
27442
27448
|
type: Component,
|
|
@@ -27484,7 +27490,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
27484
27490
|
<p [id]="helpTextId" [class]="fieldHelpClass" data-fd="field-help">{{ config.helpText }}</p>
|
|
27485
27491
|
}
|
|
27486
27492
|
</div>
|
|
27487
|
-
`, styles: [":host ::ng-deep ng-select.fd-select{display:block}:host ::ng-deep ng-select.fd-select .ng-select-container{min-height:20px;border:1px solid #E6EAF0;border-radius:4px;background:#fff;box-shadow:none;transition:border-color .2s ease,box-shadow .2s ease}:host ::ng-deep ng-select.fd-select.ng-select-focused:not(.ng-select-opened) .ng-select-container,:host ::ng-deep ng-select.fd-select.ng-select-opened .ng-select-container{border-width:2px;border-color:#7fb2ff}:host ::ng-deep ng-select.fd-select[data-fd-field-state=invalid] .ng-select-container{border-width:2px;border-color:#ef4444}:host ::ng-deep ng-select.fd-select .ng-value-container{padding:2px 12px;gap:4px}:host ::ng-deep ng-select.fd-select .ng-placeholder,:host ::ng-deep ng-select.fd-select .ng-value-label,:host ::ng-deep ng-select.fd-select .ng-input>input{font-family:inherit;font-size
|
|
27493
|
+
`, styles: [":host ::ng-deep ng-select.fd-select{display:block}:host ::ng-deep ng-select.fd-select .ng-select-container{min-height:20px;border:1px solid #E6EAF0;border-radius:4px;background:#fff;box-shadow:none;transition:border-color .2s ease,box-shadow .2s ease}:host ::ng-deep ng-select.fd-select.ng-select-focused:not(.ng-select-opened) .ng-select-container,:host ::ng-deep ng-select.fd-select.ng-select-opened .ng-select-container{border-width:2px;border-color:#7fb2ff}:host ::ng-deep ng-select.fd-select[data-fd-field-state=invalid] .ng-select-container{border-width:2px;border-color:#ef4444}:host ::ng-deep ng-select.fd-select .ng-value-container{padding:2px 12px;gap:4px}:host ::ng-deep ng-select.fd-select .ng-placeholder,:host ::ng-deep ng-select.fd-select .ng-value-label,:host ::ng-deep ng-select.fd-select .ng-input>input{font-family:inherit;font-size:14px;line-height:20px}:host ::ng-deep ng-select.fd-select .ng-placeholder{color:#1c243166}:host ::ng-deep ng-select.fd-select .ng-select-container.ng-has-value .ng-placeholder{display:none}:host ::ng-deep ng-select.fd-select .ng-arrow-wrapper{padding-right:12px}:host ::ng-deep ng-select.fd-select .ng-arrow{border-color:rgba(28,36,49,.6) transparent transparent}:host ::ng-deep ng-select.fd-select .ng-clear-wrapper{color:#1c243199}:host ::ng-deep .ng-dropdown-panel{border:1px solid #E6EAF0;border-radius:8px;background:#fff;box-shadow:0 10px 30px #0000001f}:host ::ng-deep .ng-dropdown-panel .ng-option{padding:10px 14px;font-size:14px;line-height:20px;background:#fff;color:#1c2431}:host ::ng-deep .ng-dropdown-panel .ng-option.ng-option-marked{background:#7fb2ff14;color:#1c2431}:host ::ng-deep .ng-dropdown-panel .ng-option.ng-option-selected{background:#7fb2ff24;color:#1c2431}\n"] }]
|
|
27488
27494
|
}], propDecorators: { config: [{
|
|
27489
27495
|
type: Input
|
|
27490
27496
|
}], engine: [{
|