Skip to content

Commit

Permalink
feat(editor): add readonly option to DualInput Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding-SE committed Apr 27, 2020
1 parent 4c978b2 commit 4217c41
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions packages/common/src/editors/dualInputEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ export class DualInputEditor implements Editor {
input.autocomplete = 'off';
input.placeholder = editorSideParams.placeholder || '';
input.title = editorSideParams.title || '';
if (fieldType === 'readonly') {
input.readOnly = true;
}
if (fieldType === 'number') {
input.step = this.getInputDecimalSteps(position);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface EditorComboInput extends Partial<ColumnEditor> {
field: string;

/** Editor Type */
type: 'integer' | 'float' | 'number' | 'password' | 'text';
type: 'integer' | 'float' | 'number' | 'password' | 'text' | 'readonly';
}

export interface ColumnEditorComboInput {
Expand Down
19 changes: 10 additions & 9 deletions packages/common/src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ $column-picker-checkbox-opacity-hover: 0.35 !default;
$column-picker-checkbox-width: 13px !default;
$column-picker-close-btn-bg-color: #ffffff !default;
$column-picker-close-btn-cursor: pointer !default;
$column-picker-close-btn-font-size: 21px;
$column-picker-close-btn-font-size: 21px !default;
$column-picker-close-btn-border: 0px solid #9c9c9c !default;
$column-picker-close-btn-height: 21px !default;
$column-picker-close-btn-width: 15px !default;
Expand Down Expand Up @@ -390,10 +390,10 @@ $checkbox-selector-opacity: 0.15 !default;
$checkbox-selector-opacity-hover: 0.35 !default;

/* Editors */
$editor-focus-border-color: lighten($primary-color, 10%);
$editor-focus-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(lighten($primary-color, 3%), .3);
$date-editor-focus-border-color: $editor-focus-border-color;
$date-editor-focus-box-shadow: $editor-focus-box-shadow;
$editor-focus-border-color: lighten($primary-color, 10%) !default;
$editor-focus-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(lighten($primary-color, 3%), .3) !default;
$date-editor-focus-border-color: $editor-focus-border-color !default;
$date-editor-focus-box-shadow: $editor-focus-box-shadow !default;
$large-editor-background-color: #ffffff !default;
$large-editor-border: 2px solid #a0a0a0 !default;
$large-editor-text-padding: 5px !default;
Expand All @@ -413,13 +413,14 @@ $text-editor-padding-bottom: 0 !default;
$text-editor-padding-left: 2px !default;
$text-editor-padding-right: 0 !default;
$text-editor-padding-top: 0 !default;
$text-editor-focus-border-color: $editor-focus-border-color;
$text-editor-focus-box-shadow: $editor-focus-box-shadow;
$text-editor-focus-border-color: $editor-focus-border-color !default;
$text-editor-focus-box-shadow: $editor-focus-box-shadow !default;
$text-editor-readonly-color: #f0f0f0 !default;
$slider-editor-height: 24px !default;
$slider-editor-runnable-track-padding: 0 6px !default;
$slider-editor-number-padding: 4px 6px !default;
$slider-editor-focus-border-color: $editor-focus-border-color;
$slider-editor-focus-box-shadow: $editor-focus-box-shadow;
$slider-editor-focus-border-color: $editor-focus-border-color !default;
$slider-editor-focus-box-shadow: $editor-focus-box-shadow !default;

/* Compound Filters */
$compound-filter-bgcolor: #e4eacf !default;
Expand Down
4 changes: 4 additions & 0 deletions packages/common/src/styles/slick-editors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
&.right {
margin-left: calc(#{$text-editor-margin-left + 9px});
}

&[readonly] {
background-color: $text-editor-readonly-color;
}
}

.slider-editor-input {
Expand Down

0 comments on commit 4217c41

Please sign in to comment.