@dvrd/dvr-controls 1.0.18 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvrd/dvr-controls",
3
- "version": "1.0.18",
3
+ "version": "1.0.21",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "files": ["src/**/*"],
@@ -37,7 +37,7 @@ export default function DvrdDatePicker(props: Props) {
37
37
  }
38
38
 
39
39
  const onChangePicker = (daySelected: boolean) => (value: Moment) => {
40
- onChange(value);
40
+ onChange(value.clone());
41
41
  if (closeOnChange && daySelected) onClosePicker();
42
42
  };
43
43
 
@@ -180,8 +180,9 @@ export default class PdfText extends PdfElement<Props, State> {
180
180
  this.initialWidth = this.initialWidth ?? this.field.scrollWidth;
181
181
  if (this.field.scrollWidth > maxWidth && this.draggable) {
182
182
  this.draggable.setPosition({x: PAGE_WIDTH - this.field.scrollWidth}, () => {
183
- dispatchCustomEvent('onLinkedElementMoved',
184
- {position: this.draggable.getPosition(), id: linkedID, elementId: this.id});
183
+ if (this.draggable)
184
+ dispatchCustomEvent('onLinkedElementMoved',
185
+ {position: this.draggable.getPosition(), id: linkedID, elementId: this.id});
185
186
  });
186
187
  }
187
188
  }
@@ -145,7 +145,8 @@ export default class DvrdSelect extends PureComponent<Props, State> {
145
145
  };
146
146
 
147
147
  renderItem = (item: SelectItemShape, index: number) => {
148
- const {label, value} = item;
148
+ const {value, selectableItemLabel} = item;
149
+ const label = selectableItemLabel ?? item.label;
149
150
  const {itemClassName} = this.props;
150
151
  if (['number', 'string'].includes(typeof label)) return (
151
152
  <label key={index} className={classNames('dvrd-select-item', itemClassName)}
@@ -50,6 +50,7 @@ export interface SelectItemShape {
50
50
  labelClass?: string;
51
51
  labelStyle?: CSSProperties;
52
52
  valueLabel?: string;
53
+ selectableItemLabel?: string | number;
53
54
 
54
55
  [key: string]: any,
55
56
  }