Browse Source

UI: Add color picker input for multiple input widget

pull/9002/head
Artem Dzhereleiko 3 years ago
parent
commit
dc3f3ceafb
  1. 11
      ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html
  2. 2
      ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts
  3. 3
      ui-ngx/src/app/modules/home/components/widget/lib/settings/input/update-multiple-attributes-key-settings.component.html
  4. 1
      ui-ngx/src/assets/locale/locale.constant-en_US.json

11
ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html

@ -172,6 +172,17 @@
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="input-field" *ngIf="key.settings.dataKeyValueType === 'colorPicker'">
<tb-color-input fxFlex
label="{{key.label}}"
icon="{{key.settings.icon}}"
[required]="key.settings.required"
[colorClearButton]="true"
[requiredText]="getErrorMessageText(key.settings, 'required')"
openOnInput
formControlName="{{key.formId}}">
</tb-color-input>
</div>
</div> </div>
</div> </div>
</fieldset> </fieldset>

2
ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts

@ -54,7 +54,7 @@ type FieldAlignment = 'row' | 'column';
type MultipleInputWidgetDataKeyType = 'server' | 'shared' | 'timeseries'; type MultipleInputWidgetDataKeyType = 'server' | 'shared' | 'timeseries';
export type MultipleInputWidgetDataKeyValueType = 'string' | 'double' | 'integer' | export type MultipleInputWidgetDataKeyValueType = 'string' | 'double' | 'integer' |
'JSON' | 'booleanCheckbox' | 'booleanSwitch' | 'JSON' | 'booleanCheckbox' | 'booleanSwitch' |
'dateTime' | 'date' | 'time' | 'select'; 'dateTime' | 'date' | 'time' | 'select' | 'colorPicker';
type MultipleInputWidgetDataKeyEditableType = 'editable' | 'disabled' | 'readonly'; type MultipleInputWidgetDataKeyEditableType = 'editable' | 'disabled' | 'readonly';
type ConvertGetValueFunction = (value: any, ctx: WidgetContext) => any; type ConvertGetValueFunction = (value: any, ctx: WidgetContext) => any;

3
ui-ngx/src/app/modules/home/components/widget/lib/settings/input/update-multiple-attributes-key-settings.component.html

@ -69,6 +69,9 @@
<mat-option [value]="'JSON'"> <mat-option [value]="'JSON'">
{{ 'widgets.input-widgets.datakey-value-type-json' | translate }} {{ 'widgets.input-widgets.datakey-value-type-json' | translate }}
</mat-option> </mat-option>
<mat-option [value]="'colorPicker'">
{{ 'widgets.input-widgets.datakey-value-type-color-picker' | translate }}
</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</section> </section>

1
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -4792,6 +4792,7 @@
"datakey-value-type-date": "Date", "datakey-value-type-date": "Date",
"datakey-value-type-time": "Time", "datakey-value-type-time": "Time",
"datakey-value-type-select": "Select", "datakey-value-type-select": "Select",
"datakey-value-type-color-picker": "Color Picker",
"value-is-required": "Value is required", "value-is-required": "Value is required",
"ability-to-edit-attribute": "Ability to edit attribute", "ability-to-edit-attribute": "Ability to edit attribute",
"ability-to-edit-attribute-editable": "Editable (default)", "ability-to-edit-attribute-editable": "Editable (default)",

Loading…
Cancel
Save