@spicainternational/ngx-sds-components 5.8.0 → 5.9.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.
Files changed (32) hide show
  1. package/esm2020/src/lib/color-picker/color-picker.component.mjs +42 -5
  2. package/esm2020/src/lib/date-picker/date-picker.component.mjs +17 -5
  3. package/esm2020/src/lib/duration-box/duration-box.component.mjs +46 -34
  4. package/esm2020/src/lib/duration-box/duration.service.mjs +6 -3
  5. package/esm2020/src/lib/modal/dialog/dialog.component.mjs +16 -4
  6. package/esm2020/src/lib/modal/modal.component.mjs +5 -4
  7. package/esm2020/src/lib/modal/modal.module.mjs +5 -1
  8. package/esm2020/src/lib/navigation/navigation-group/navigation-group.component.mjs +1 -1
  9. package/fesm2015/spicainternational-ngx-sds-components-src-lib-color-picker.mjs +41 -4
  10. package/fesm2015/spicainternational-ngx-sds-components-src-lib-color-picker.mjs.map +1 -1
  11. package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-picker.mjs +17 -4
  12. package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-picker.mjs.map +1 -1
  13. package/fesm2015/spicainternational-ngx-sds-components-src-lib-duration-box.mjs +51 -35
  14. package/fesm2015/spicainternational-ngx-sds-components-src-lib-duration-box.mjs.map +1 -1
  15. package/fesm2015/spicainternational-ngx-sds-components-src-lib-modal.mjs +22 -5
  16. package/fesm2015/spicainternational-ngx-sds-components-src-lib-modal.mjs.map +1 -1
  17. package/fesm2015/spicainternational-ngx-sds-components-src-lib-navigation.mjs.map +1 -1
  18. package/fesm2020/spicainternational-ngx-sds-components-src-lib-color-picker.mjs +41 -4
  19. package/fesm2020/spicainternational-ngx-sds-components-src-lib-color-picker.mjs.map +1 -1
  20. package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-picker.mjs +16 -4
  21. package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-picker.mjs.map +1 -1
  22. package/fesm2020/spicainternational-ngx-sds-components-src-lib-duration-box.mjs +50 -35
  23. package/fesm2020/spicainternational-ngx-sds-components-src-lib-duration-box.mjs.map +1 -1
  24. package/fesm2020/spicainternational-ngx-sds-components-src-lib-modal.mjs +22 -5
  25. package/fesm2020/spicainternational-ngx-sds-components-src-lib-modal.mjs.map +1 -1
  26. package/fesm2020/spicainternational-ngx-sds-components-src-lib-navigation.mjs.map +1 -1
  27. package/package.json +8 -7
  28. package/src/lib/color-picker/color-picker.component.d.ts +5 -1
  29. package/src/lib/date-picker/date-picker.component.d.ts +2 -1
  30. package/src/lib/duration-box/duration-box.component.d.ts +1 -0
  31. package/src/lib/modal/dialog/dialog.component.d.ts +6 -2
  32. package/src/lib/modal/modal.module.d.ts +3 -2
@@ -13,7 +13,7 @@ class DurationService {
13
13
  constructor() { }
14
14
  resolve(input) {
15
15
  if (!input || input.length === 0) {
16
- return 0;
16
+ return null;
17
17
  }
18
18
  const inputSegments = input.split(':');
19
19
  if (inputSegments.length > 2) {
@@ -47,6 +47,9 @@ class DurationService {
47
47
  return 0;
48
48
  }
49
49
  isValidInput(input) {
50
+ if (input === '') {
51
+ return true;
52
+ }
50
53
  const regexNumbersOnly = /^[+-]?\d+$/;
51
54
  const regexColonSeparated = /^[+-]?\d+:\d+$/;
52
55
  return regexNumbersOnly.test(input) || regexColonSeparated.test(input);
@@ -64,7 +67,7 @@ class DurationService {
64
67
  return defaultValue;
65
68
  }
66
69
  isValueWithinLimits(value, min, max) {
67
- return !((min && value < min) || (max && value > max));
70
+ return !((min != undefined && value < min) || (max != undefined && value > max));
68
71
  }
69
72
  }
70
73
  DurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: DurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -178,38 +181,17 @@ class SdsDurationBoxComponent {
178
181
  }
179
182
  ngAfterViewInit() {
180
183
  if (this._validationRule) {
181
- this._validationRule.validationCallback = () => { return this.checkIfValid(); };
184
+ this._validationRule.validationCallback = () => {
185
+ return this.checkIfValid();
186
+ };
182
187
  }
183
188
  }
184
189
  ngOnChanges(changes) {
185
- if (changes['value']) {
186
- if (this.value === null) {
187
- // handle null input
188
- if (this.allowEmptyValue) {
189
- this.setValue(null);
190
- }
191
- else {
192
- this.setValue(this._durationInputResolver.getDefaultValue());
193
- this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
194
- }
195
- }
196
- else {
197
- // handle value input
198
- if (this._durationInputResolver.isValueWithinLimits(this.value, this.min, this.max)) {
199
- this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
200
- }
201
- else {
202
- // value is out of range
203
- if (this.rangeViolationHandling === 'autoResolve') {
204
- this.setValue(this._durationInputResolver.getDefaultValue(this.min, this.max));
205
- this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
206
- }
207
- else {
208
- this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
209
- this.setValidationStatusAndValidate(false);
210
- }
211
- }
212
- }
190
+ if (changes['value'] ||
191
+ changes['min'] || changes['max'] ||
192
+ changes['rangeViolationHandling'] ||
193
+ changes['allowEmptyValue']) {
194
+ this.validateInputs();
213
195
  }
214
196
  }
215
197
  ngOnInit() { }
@@ -262,6 +244,40 @@ class SdsDurationBoxComponent {
262
244
  checkIfValid() {
263
245
  return this.isValid;
264
246
  }
247
+ validateInputs() {
248
+ var _a;
249
+ if (this.value === null) {
250
+ // handle null input
251
+ if (this.allowEmptyValue) {
252
+ this.setValue(null);
253
+ }
254
+ else {
255
+ this.setValue(this._durationInputResolver.getDefaultValue());
256
+ this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
257
+ }
258
+ this.setValidationStatusAndValidate(true);
259
+ }
260
+ else {
261
+ // handle value input
262
+ if (this._durationInputResolver.isValueWithinLimits(this.value, this.min, this.max)) {
263
+ this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
264
+ this.setValidationStatusAndValidate(true);
265
+ }
266
+ else {
267
+ // value is out of range
268
+ if (this.rangeViolationHandling === 'autoResolve') {
269
+ this.setValue(this._durationInputResolver.getDefaultValue(this.min, this.max));
270
+ this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
271
+ this.setValidationStatusAndValidate(true);
272
+ }
273
+ else {
274
+ this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);
275
+ this.setValidationStatusAndValidate(false);
276
+ }
277
+ }
278
+ (_a = this._validator) === null || _a === void 0 ? void 0 : _a.instance.validate();
279
+ }
280
+ }
265
281
  setValue(value) {
266
282
  this.isValueEmpty = (value === null);
267
283
  this.value = value;
@@ -274,17 +290,17 @@ class SdsDurationBoxComponent {
274
290
  this.inputValue = this._durationPipe.transform(value, this.emptyValueText);
275
291
  }, 0);
276
292
  }
277
- setValidationStatusAndValidate(isValid) {
293
+ setValidationStatusAndValidate(isWithinRange) {
278
294
  var _a;
279
- this.isValid = (this.rangeViolationHandling === 'autoResolve') || isValid;
295
+ this.isValid = (this.rangeViolationHandling === 'autoResolve') || isWithinRange;
280
296
  (_a = this._validator) === null || _a === void 0 ? void 0 : _a.instance.validate();
281
297
  }
282
298
  }
283
299
  SdsDurationBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsDurationBoxComponent, deps: [{ token: DurationService }], target: i0.ɵɵFactoryTarget.Component });
284
- SdsDurationBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsDurationBoxComponent, selector: "sds-duration-box", inputs: { value: "value", allowEmptyValue: "allowEmptyValue", emptyValueText: "emptyValueText", options: "options", width: "width", disabled: "disabled", showClearButton: "showClearButton", max: "max", min: "min", rangeViolationHandling: "rangeViolationHandling", rangeViolationText: "rangeViolationText" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "_validationRule", first: true, predicate: ["validationRule"], descendants: true }, { propertyName: "_validator", first: true, predicate: ["validator"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<dx-text-box\r\n #textbox\r\n [id]=\"elementUUID\"\r\n class=\"sds-durationbox\"\r\n [(value)]=\"inputValue\"\r\n (onKeyDown)=\"blockNonNumberOrSemicolon($event)\"\r\n (onChange)=\"resolveInput()\"\r\n [width]=\"width\"\r\n [disabled]=\"disabled\"\r\n >\r\n\r\n <dx-validator \r\n #validator\r\n *ngIf=\"rangeViolationHandling === 'markAsInvalid'\">\r\n <dxi-validation-rule\r\n #validationRule\r\n type=\"custom\"\r\n [message]=\"rangeViolationText\"\r\n [reevaluate]=\"true\"\r\n ></dxi-validation-rule>\r\n </dx-validator>\r\n\r\n <dxi-button\r\n *ngIf=\"allowEmptyValue && showClearButton\"\r\n name=\"clearValue\"\r\n location=\"after\"\r\n [options]=\"clearValueButton\"\r\n ></dxi-button>\r\n \r\n <dxi-button\r\n *ngIf=\"options && options.length > 0\"\r\n name=\"optionsDropdown\"\r\n location=\"after\"\r\n [options]=\"optionsDropdownButton\"\r\n ></dxi-button>\r\n</dx-text-box>\r\n\r\n\r\n<dx-popover\r\n target=\"#{{elementUUID}}\"\r\n [(visible)]=\"showOptions\"\r\n [minWidth]=\"width\"\r\n [hideOnOutsideClick]=\"true\"\r\n [wrapperAttr]=\"{ class: 'sds-durationbox-options-popover' }\"\r\n >\r\n\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view>\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"isValueEmpty\"\r\n (click)=\"applyOption(null)\"\r\n > {{ emptyValueText}}\r\n </button>\r\n\r\n <div *ngFor=\"let option of options\">\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"option === value\"\r\n (click)=\"applyOption(option)\"\r\n > {{option | sdsDurationFormat}}\r\n </button>\r\n </div>\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popover>", styles: ["::ng-deep .sds-durationbox .sds-durationbox-clear-button .dx-icon{color:#999}::ng-deep .sds-durationbox-options-popover .dx-popup-content{padding:.25rem;font-size:1rem}::ng-deep .sds-durationbox-options-popover .dropdown-item{padding:.5rem}::ng-deep .sds-durationbox-options-popover .dropdown-item:hover{background-color:#f8f9fa}::ng-deep .sds-durationbox-options-popover .dropdown-item:focus{outline:none}::ng-deep .sds-durationbox-options-popover .dropdown-item.selected{background-color:#dee2e6}\n"], components: [{ type: i2.DxTextBoxComponent, selector: "dx-text-box", inputs: ["accessKey", "activeStateEnabled", "buttons", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "inputAttr", "isValid", "label", "labelMode", "mask", "maskChar", "maskInvalidMessage", "maskRules", "maxLength", "mode", "name", "placeholder", "readOnly", "rtlEnabled", "showClearButton", "showMaskMode", "spellcheck", "stylingMode", "tabIndex", "text", "useMaskedValue", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChangeEvent", "visible", "width"], outputs: ["onChange", "onContentReady", "onCopy", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onKeyDown", "onKeyUp", "onOptionChanged", "onPaste", "onValueChanged", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isValidChange", "labelChange", "labelModeChange", "maskChange", "maskCharChange", "maskInvalidMessageChange", "maskRulesChange", "maxLengthChange", "modeChange", "nameChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "showClearButtonChange", "showMaskModeChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useMaskedValueChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "visibleChange", "widthChange", "onBlur"] }, { type: i2.DxValidatorComponent, selector: "dx-validator", inputs: ["adapter", "elementAttr", "height", "name", "validationGroup", "validationRules", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onValidated", "adapterChange", "elementAttrChange", "heightChange", "nameChange", "validationGroupChange", "validationRulesChange", "widthChange"] }, { type: i3.DxiValidationRuleComponent, selector: "dxi-validation-rule", inputs: ["message", "trim", "type", "ignoreEmptyValue", "max", "min", "reevaluate", "validationCallback", "comparisonTarget", "comparisonType", "pattern"] }, { type: i3.DxiButtonComponent, selector: "dxi-button", inputs: ["location", "name", "options", "cssClass", "disabled", "hint", "icon", "onClick", "template", "text", "visible"] }, { type: i2.DxPopoverComponent, selector: "dx-popover", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showCloseButton", "showEvent", "showTitle", "target", "title", "titleTemplate", "toolbarItems", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "onTitleRendered", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showCloseButtonChange", "showEventChange", "showTitleChange", "targetChange", "titleChange", "titleTemplateChange", "toolbarItemsChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { type: i2.DxScrollViewComponent, selector: "dx-scroll-view", inputs: ["bounceEnabled", "direction", "disabled", "elementAttr", "height", "pulledDownText", "pullingDownText", "reachBottomText", "refreshingText", "rtlEnabled", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onPullDown", "onReachBottom", "onScroll", "onUpdated", "bounceEnabledChange", "directionChange", "disabledChange", "elementAttrChange", "heightChange", "pulledDownTextChange", "pullingDownTextChange", "reachBottomTextChange", "refreshingTextChange", "rtlEnabledChange", "scrollByContentChange", "scrollByThumbChange", "showScrollbarChange", "useNativeChange", "widthChange"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "sdsDurationFormat": i6.SdsDurationFormatPipe } });
300
+ SdsDurationBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsDurationBoxComponent, selector: "sds-duration-box", inputs: { value: "value", allowEmptyValue: "allowEmptyValue", emptyValueText: "emptyValueText", options: "options", width: "width", disabled: "disabled", showClearButton: "showClearButton", max: "max", min: "min", rangeViolationHandling: "rangeViolationHandling", rangeViolationText: "rangeViolationText" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "_validationRule", first: true, predicate: ["validationRule"], descendants: true }, { propertyName: "_validator", first: true, predicate: ["validator"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<dx-text-box\r\n #textbox\r\n [id]=\"elementUUID\"\r\n class=\"sds-durationbox\"\r\n [(value)]=\"inputValue\"\r\n (onKeyDown)=\"blockNonNumberOrSemicolon($event)\"\r\n (onChange)=\"resolveInput()\"\r\n [width]=\"width\"\r\n [disabled]=\"disabled\"\r\n >\r\n\r\n <dx-validator \r\n #validator>\r\n <dxi-validation-rule\r\n #validationRule\r\n type=\"custom\"\r\n [message]=\"rangeViolationText\"\r\n [reevaluate]=\"true\"\r\n ></dxi-validation-rule>\r\n </dx-validator>\r\n\r\n <dxi-button\r\n *ngIf=\"allowEmptyValue && showClearButton\"\r\n name=\"clearValue\"\r\n location=\"after\"\r\n [options]=\"clearValueButton\"\r\n ></dxi-button>\r\n \r\n <dxi-button\r\n *ngIf=\"options && options.length > 0\"\r\n name=\"optionsDropdown\"\r\n location=\"after\"\r\n [options]=\"optionsDropdownButton\"\r\n ></dxi-button>\r\n</dx-text-box>\r\n\r\n\r\n<dx-popover\r\n target=\"#{{elementUUID}}\"\r\n [(visible)]=\"showOptions\"\r\n [minWidth]=\"width\"\r\n [closeOnOutsideClick]=\"true\"\r\n [wrapperAttr]=\"{ class: 'sds-durationbox-options-popover' }\"\r\n >\r\n\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view>\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"isValueEmpty\"\r\n (click)=\"applyOption(null)\"\r\n > {{ emptyValueText}}\r\n </button>\r\n\r\n <div *ngFor=\"let option of options\">\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"option === value\"\r\n (click)=\"applyOption(option)\"\r\n > {{option | sdsDurationFormat}}\r\n </button>\r\n </div>\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popover>", styles: ["::ng-deep .sds-durationbox .sds-durationbox-clear-button .dx-icon{color:#999}::ng-deep .sds-durationbox-options-popover .dx-popup-content{padding:.25rem;font-size:1rem}::ng-deep .sds-durationbox-options-popover .dropdown-item{padding:.5rem}::ng-deep .sds-durationbox-options-popover .dropdown-item:hover{background-color:#f8f9fa}::ng-deep .sds-durationbox-options-popover .dropdown-item:focus{outline:none}::ng-deep .sds-durationbox-options-popover .dropdown-item.selected{background-color:#dee2e6}\n"], components: [{ type: i2.DxTextBoxComponent, selector: "dx-text-box", inputs: ["accessKey", "activeStateEnabled", "buttons", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "inputAttr", "isValid", "label", "labelMode", "mask", "maskChar", "maskInvalidMessage", "maskRules", "maxLength", "mode", "name", "placeholder", "readOnly", "rtlEnabled", "showClearButton", "showMaskMode", "spellcheck", "stylingMode", "tabIndex", "text", "useMaskedValue", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChangeEvent", "visible", "width"], outputs: ["onChange", "onContentReady", "onCopy", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onKeyDown", "onKeyUp", "onOptionChanged", "onPaste", "onValueChanged", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isValidChange", "labelChange", "labelModeChange", "maskChange", "maskCharChange", "maskInvalidMessageChange", "maskRulesChange", "maxLengthChange", "modeChange", "nameChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "showClearButtonChange", "showMaskModeChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useMaskedValueChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "visibleChange", "widthChange", "onBlur"] }, { type: i2.DxValidatorComponent, selector: "dx-validator", inputs: ["adapter", "elementAttr", "height", "name", "validationGroup", "validationRules", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onValidated", "adapterChange", "elementAttrChange", "heightChange", "nameChange", "validationGroupChange", "validationRulesChange", "widthChange"] }, { type: i3.DxiValidationRuleComponent, selector: "dxi-validation-rule", inputs: ["message", "trim", "type", "ignoreEmptyValue", "max", "min", "reevaluate", "validationCallback", "comparisonTarget", "comparisonType", "pattern"] }, { type: i3.DxiButtonComponent, selector: "dxi-button", inputs: ["location", "name", "options", "cssClass", "disabled", "hint", "icon", "onClick", "template", "text", "visible"] }, { type: i2.DxPopoverComponent, selector: "dx-popover", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showCloseButton", "showEvent", "showTitle", "target", "title", "titleTemplate", "toolbarItems", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "onTitleRendered", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showCloseButtonChange", "showEventChange", "showTitleChange", "targetChange", "titleChange", "titleTemplateChange", "toolbarItemsChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { type: i2.DxScrollViewComponent, selector: "dx-scroll-view", inputs: ["bounceEnabled", "direction", "disabled", "elementAttr", "height", "pulledDownText", "pullingDownText", "reachBottomText", "refreshingText", "rtlEnabled", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onPullDown", "onReachBottom", "onScroll", "onUpdated", "bounceEnabledChange", "directionChange", "disabledChange", "elementAttrChange", "heightChange", "pulledDownTextChange", "pullingDownTextChange", "reachBottomTextChange", "refreshingTextChange", "rtlEnabledChange", "scrollByContentChange", "scrollByThumbChange", "showScrollbarChange", "useNativeChange", "widthChange"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "sdsDurationFormat": i6.SdsDurationFormatPipe } });
285
301
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsDurationBoxComponent, decorators: [{
286
302
  type: Component,
287
- args: [{ selector: 'sds-duration-box', template: "<dx-text-box\r\n #textbox\r\n [id]=\"elementUUID\"\r\n class=\"sds-durationbox\"\r\n [(value)]=\"inputValue\"\r\n (onKeyDown)=\"blockNonNumberOrSemicolon($event)\"\r\n (onChange)=\"resolveInput()\"\r\n [width]=\"width\"\r\n [disabled]=\"disabled\"\r\n >\r\n\r\n <dx-validator \r\n #validator\r\n *ngIf=\"rangeViolationHandling === 'markAsInvalid'\">\r\n <dxi-validation-rule\r\n #validationRule\r\n type=\"custom\"\r\n [message]=\"rangeViolationText\"\r\n [reevaluate]=\"true\"\r\n ></dxi-validation-rule>\r\n </dx-validator>\r\n\r\n <dxi-button\r\n *ngIf=\"allowEmptyValue && showClearButton\"\r\n name=\"clearValue\"\r\n location=\"after\"\r\n [options]=\"clearValueButton\"\r\n ></dxi-button>\r\n \r\n <dxi-button\r\n *ngIf=\"options && options.length > 0\"\r\n name=\"optionsDropdown\"\r\n location=\"after\"\r\n [options]=\"optionsDropdownButton\"\r\n ></dxi-button>\r\n</dx-text-box>\r\n\r\n\r\n<dx-popover\r\n target=\"#{{elementUUID}}\"\r\n [(visible)]=\"showOptions\"\r\n [minWidth]=\"width\"\r\n [hideOnOutsideClick]=\"true\"\r\n [wrapperAttr]=\"{ class: 'sds-durationbox-options-popover' }\"\r\n >\r\n\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view>\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"isValueEmpty\"\r\n (click)=\"applyOption(null)\"\r\n > {{ emptyValueText}}\r\n </button>\r\n\r\n <div *ngFor=\"let option of options\">\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"option === value\"\r\n (click)=\"applyOption(option)\"\r\n > {{option | sdsDurationFormat}}\r\n </button>\r\n </div>\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popover>", styles: ["::ng-deep .sds-durationbox .sds-durationbox-clear-button .dx-icon{color:#999}::ng-deep .sds-durationbox-options-popover .dx-popup-content{padding:.25rem;font-size:1rem}::ng-deep .sds-durationbox-options-popover .dropdown-item{padding:.5rem}::ng-deep .sds-durationbox-options-popover .dropdown-item:hover{background-color:#f8f9fa}::ng-deep .sds-durationbox-options-popover .dropdown-item:focus{outline:none}::ng-deep .sds-durationbox-options-popover .dropdown-item.selected{background-color:#dee2e6}\n"] }]
303
+ args: [{ selector: 'sds-duration-box', template: "<dx-text-box\r\n #textbox\r\n [id]=\"elementUUID\"\r\n class=\"sds-durationbox\"\r\n [(value)]=\"inputValue\"\r\n (onKeyDown)=\"blockNonNumberOrSemicolon($event)\"\r\n (onChange)=\"resolveInput()\"\r\n [width]=\"width\"\r\n [disabled]=\"disabled\"\r\n >\r\n\r\n <dx-validator \r\n #validator>\r\n <dxi-validation-rule\r\n #validationRule\r\n type=\"custom\"\r\n [message]=\"rangeViolationText\"\r\n [reevaluate]=\"true\"\r\n ></dxi-validation-rule>\r\n </dx-validator>\r\n\r\n <dxi-button\r\n *ngIf=\"allowEmptyValue && showClearButton\"\r\n name=\"clearValue\"\r\n location=\"after\"\r\n [options]=\"clearValueButton\"\r\n ></dxi-button>\r\n \r\n <dxi-button\r\n *ngIf=\"options && options.length > 0\"\r\n name=\"optionsDropdown\"\r\n location=\"after\"\r\n [options]=\"optionsDropdownButton\"\r\n ></dxi-button>\r\n</dx-text-box>\r\n\r\n\r\n<dx-popover\r\n target=\"#{{elementUUID}}\"\r\n [(visible)]=\"showOptions\"\r\n [minWidth]=\"width\"\r\n [closeOnOutsideClick]=\"true\"\r\n [wrapperAttr]=\"{ class: 'sds-durationbox-options-popover' }\"\r\n >\r\n\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view>\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"isValueEmpty\"\r\n (click)=\"applyOption(null)\"\r\n > {{ emptyValueText}}\r\n </button>\r\n\r\n <div *ngFor=\"let option of options\">\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"option === value\"\r\n (click)=\"applyOption(option)\"\r\n > {{option | sdsDurationFormat}}\r\n </button>\r\n </div>\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popover>", styles: ["::ng-deep .sds-durationbox .sds-durationbox-clear-button .dx-icon{color:#999}::ng-deep .sds-durationbox-options-popover .dx-popup-content{padding:.25rem;font-size:1rem}::ng-deep .sds-durationbox-options-popover .dropdown-item{padding:.5rem}::ng-deep .sds-durationbox-options-popover .dropdown-item:hover{background-color:#f8f9fa}::ng-deep .sds-durationbox-options-popover .dropdown-item:focus{outline:none}::ng-deep .sds-durationbox-options-popover .dropdown-item.selected{background-color:#dee2e6}\n"] }]
288
304
  }], ctorParameters: function () { return [{ type: DurationService }]; }, propDecorators: { value: [{
289
305
  type: Input
290
306
  }], valueChange: [{
@@ -1 +1 @@
1
- {"version":3,"file":"spicainternational-ngx-sds-components-src-lib-duration-box.mjs","sources":["../../../projects/ngx-sds-components/src/lib/duration-box/duration.service.ts","../../../projects/ngx-sds-components/src/lib/duration-box/duration-box.component.ts","../../../projects/ngx-sds-components/src/lib/duration-box/duration-box.component.html","../../../projects/ngx-sds-components/src/lib/duration-box/duration-box.module.ts","../../../projects/ngx-sds-components/src/lib/duration-box/spicainternational-ngx-sds-components-src-lib-duration-box.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DurationService {\r\n \r\n constructor() {}\r\n\r\n public resolve(input: string): number | null{\r\n if (!input || input.length === 0) {\r\n return 0;\r\n }\r\n\r\n const inputSegments = input.split(':');\r\n if (inputSegments.length > 2) {\r\n //invalid input\r\n return 0;\r\n } else if (inputSegments.length == 2){\r\n // we have hrs and minutes\r\n const hrs = parseInt(inputSegments[0] ? inputSegments[0] : '0');\r\n const mins = parseInt(inputSegments[1] ? inputSegments[1] : '0');\r\n const totalMins = (hrs * 60) + mins;\r\n\r\n return totalMins;\r\n } else if (inputSegments.length == 1) {\r\n // take last two digits as mins\r\n const nonSeparated = inputSegments[0];\r\n\r\n let totalMins = 0;\r\n if (nonSeparated.length <= 2) {\r\n totalMins = parseInt(nonSeparated)\r\n } else {\r\n const lastIndex = nonSeparated.length - 2;\r\n const part1 = nonSeparated.slice(0, lastIndex);\r\n const part2 = nonSeparated.slice(lastIndex);\r\n const hrs = parseInt(part1);\r\n const mins = parseInt(part2);\r\n totalMins = (hrs * 60) + mins; \r\n }\r\n return totalMins;\r\n }\r\n return 0; \r\n }\r\n\r\n public isValidInput(input: string) {\r\n const regexNumbersOnly = /^[+-]?\\d+$/;\r\n const regexColonSeparated = /^[+-]?\\d+:\\d+$/;\r\n return regexNumbersOnly.test(input) || regexColonSeparated.test(input);\r\n }\r\n\r\n public getDefaultValue(min?: number, max?: number): number {\r\n let defaultValue = 0;\r\n // try keeping the 0 as default\r\n // if it is outside the min/max then adjust\r\n if (min) {\r\n defaultValue = Math.max(defaultValue, min);\r\n }\r\n if (max) {\r\n defaultValue = Math.min(defaultValue, max);\r\n }\r\n return defaultValue;\r\n }\r\n\r\n public isValueWithinLimits(value: number, min?: number, max?: number): boolean {\r\n return !((min && value < min) || (max && value > max))\r\n } \r\n\r\n}\r\n","import { AfterViewInit, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { SdsDurationFormatPipe } from '@spicainternational/ngx-sds-components/src/lib/duration-pipe';\r\nimport { DxValidatorComponent } from 'devextreme-angular';\r\nimport { DxiValidationRuleComponent } from 'devextreme-angular/ui/nested';\r\nimport { DurationBoxRangeViolationHandling } from './duration-box.types';\r\nimport { DurationService } from './duration.service';\r\n\r\n/**\r\n * Component allows user to enter duration in h:mm format. User may also select no value is this is applicable to the \r\n * use case. A list of pre-defined durations can be provided for easier selection.\r\n * \r\n * The auto resolve function tries to convert entered text into minutes. The algorithm splits entry into two parts \r\n * hours and minutes based on delimiter or if there is none - it takes last two digits as minutes.\r\n *\r\n * @export\r\n * @class SdsDurationBoxComponent\r\n */\r\n@Component({\r\n selector: 'sds-duration-box',\r\n templateUrl: './duration-box.component.html',\r\n styleUrls: ['./duration-box.component.scss'],\r\n})\r\nexport class SdsDurationBoxComponent implements OnInit, OnChanges, AfterViewInit {\r\n /**\r\n * Duration length expressed in minutes; when we allow empty values this property can be null.\r\n *\r\n * @type {(number | null)}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() value: number | null = null;\r\n @Output() valueChange = new EventEmitter<number | null>();\r\n\r\n /**\r\n * Allow user to select empty value. You should provide emptyValueText in this case. The emitted value is 'null'.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() allowEmptyValue: boolean = true;\r\n\r\n /**\r\n * Text to be displayed when value is cleared\r\n *\r\n * @type {string}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() emptyValueText: string = 'not set';\r\n\r\n /**\r\n * Array of pre-defined durations that will be displayed in dropdown for easier selection.\r\n *\r\n * @type {number[]}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() options?: number[];\r\n \r\n /**\r\n * Width of component. By default 10rem.\r\n *\r\n * @type {string}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() width: string = '10rem';\r\n\r\n /**\r\n * Specifies whether the UI component responds to user interaction.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() disabled: boolean = false;\r\n \r\n /**\r\n * Specifies whether to display the Clear button in the UI component.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() showClearButton: boolean = false;\r\n\r\n /**\r\n * The maximum value accepted by the duration box.\r\n *\r\n * @type {number}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() max?: number;\r\n\r\n /**\r\n * The minimum value accepted by the duration box.\r\n *\r\n * @type {number}\r\n * @memberof SdsDurationBoxComponent\r\n */ \r\n @Input() min?: number;\r\n\r\n /**\r\n * Specifies how range limits are handled.\r\n *\r\n * @type {('fallbackToLastValue' | 'showValidationError')}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() rangeViolationHandling: DurationBoxRangeViolationHandling = 'autoResolve';\r\n\r\n /**\r\n * Range violation message. Applicable when rangeViolationHandling is set to 'autoResolve'\r\n *\r\n * @type {string}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() rangeViolationText: string = 'value is outside the valid range';\r\n\r\n /**\r\n * Indicates whether the editor's value is valid.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n public isValid: boolean = true;\r\n\r\n\r\n\r\n // public elementUUID = 'sds-db-' + crypto.randomUUID();\r\n public elementUUID = `sds-db-${Math.ceil(Math.random() * 1000000)}`;\r\n\r\n\r\n public inputValue: string = '';\r\n public showOptions: boolean = false;\r\n \r\n public optionsDropdownButton;\r\n public clearValueButton;\r\n\r\n public isValueEmpty = false;\r\n\r\n\r\n @ViewChild('validationRule', { static: false }) private _validationRule: DxiValidationRuleComponent | undefined;\r\n @ViewChild('validator', { static: false }) private _validator: DxValidatorComponent | undefined;\r\n\r\n private isValueSetInternally = false;\r\n private _durationPipe: SdsDurationFormatPipe;\r\n\r\n constructor(\r\n private _durationInputResolver: DurationService,\r\n ) {\r\n this._durationPipe = new SdsDurationFormatPipe();\r\n \r\n this.optionsDropdownButton = {\r\n icon: 'spindown',\r\n stylingMode: 'text',\r\n \r\n onClick: () => {\r\n this.showOptions = !this.showOptions;\r\n }\r\n }\r\n\r\n this.clearValueButton = {\r\n icon: 'clear',\r\n stylingMode: 'text',\r\n elementAttr: { class: 'sds-durationbox-clear-button' },\r\n onClick: () => {\r\n this.applyOption(null);\r\n }\r\n } \r\n }\r\n ngAfterViewInit(): void {\r\n if (this._validationRule) {\r\n this._validationRule.validationCallback = () => { return this.checkIfValid() };\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['value']) {\r\n if (this.value === null) {\r\n // handle null input\r\n if (this.allowEmptyValue) {\r\n this.setValue(null);\r\n } else {\r\n this.setValue(this._durationInputResolver.getDefaultValue());\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n }\r\n } else {\r\n // handle value input\r\n if (this._durationInputResolver.isValueWithinLimits(this.value, this.min, this.max)){\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n } else {\r\n // value is out of range\r\n if (this.rangeViolationHandling === 'autoResolve'){\r\n this.setValue(this._durationInputResolver.getDefaultValue(this.min, this.max));\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n } else {\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n this.setValidationStatusAndValidate(false);\r\n }\r\n }\r\n }\r\n } \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n public blockNonNumberOrSemicolon(e: any) {\r\n this.isValueSetInternally = false;\r\n }\r\n\r\n public resolveInput() {\r\n if (!this.isValueSetInternally){\r\n if (!this._durationInputResolver.isValidInput(this.inputValue)) {\r\n // we have invalid input. use old value\r\n this.setInputValueInternally(this.value);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n const resolvedValue = this._durationInputResolver.resolve(this.inputValue);\r\n if (resolvedValue === null && this.allowEmptyValue) {\r\n this.setValue(null);\r\n this.setValidationStatusAndValidate(true);\r\n } else if (resolvedValue === null && !this.allowEmptyValue) {\r\n this.setValue(this._durationInputResolver.getDefaultValue());\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n // make sure that the value is within the min/max period\r\n if (this._durationInputResolver.isValueWithinLimits(resolvedValue as number, this.min, this.max)) {\r\n this.setValue(resolvedValue);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n // use old value\r\n if (this.rangeViolationHandling === 'autoResolve'){\r\n this.setInputValueInternally(this.value);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n this.setInputValueInternally(resolvedValue);\r\n this.setValidationStatusAndValidate(false);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public applyOption(value: number | null){\r\n this.showOptions = false;\r\n this.isValueSetInternally = false;\r\n this.setValue(value);\r\n }\r\n\r\n public checkIfValid() {\r\n return this.isValid;\r\n }\r\n\r\n private setValue(value: number | null){\r\n this.isValueEmpty = (value === null);\r\n this.value = value;\r\n this.valueChange.emit(this.value);\r\n this.setInputValueInternally(value);\r\n }\r\n\r\n private setInputValueInternally(value: number | null){\r\n this.isValueSetInternally = true;\r\n setTimeout(() => {\r\n this.inputValue = this._durationPipe.transform(value, this.emptyValueText);\r\n }, 0);\r\n }\r\n\r\n private setValidationStatusAndValidate(isValid: boolean){\r\n this.isValid = (this.rangeViolationHandling === 'autoResolve') || isValid;\r\n this._validator?.instance.validate();\r\n }\r\n\r\n}\r\n","<dx-text-box\r\n #textbox\r\n [id]=\"elementUUID\"\r\n class=\"sds-durationbox\"\r\n [(value)]=\"inputValue\"\r\n (onKeyDown)=\"blockNonNumberOrSemicolon($event)\"\r\n (onChange)=\"resolveInput()\"\r\n [width]=\"width\"\r\n [disabled]=\"disabled\"\r\n >\r\n\r\n <dx-validator \r\n #validator\r\n *ngIf=\"rangeViolationHandling === 'markAsInvalid'\">\r\n <dxi-validation-rule\r\n #validationRule\r\n type=\"custom\"\r\n [message]=\"rangeViolationText\"\r\n [reevaluate]=\"true\"\r\n ></dxi-validation-rule>\r\n </dx-validator>\r\n\r\n <dxi-button\r\n *ngIf=\"allowEmptyValue && showClearButton\"\r\n name=\"clearValue\"\r\n location=\"after\"\r\n [options]=\"clearValueButton\"\r\n ></dxi-button>\r\n \r\n <dxi-button\r\n *ngIf=\"options && options.length > 0\"\r\n name=\"optionsDropdown\"\r\n location=\"after\"\r\n [options]=\"optionsDropdownButton\"\r\n ></dxi-button>\r\n</dx-text-box>\r\n\r\n\r\n<dx-popover\r\n target=\"#{{elementUUID}}\"\r\n [(visible)]=\"showOptions\"\r\n [minWidth]=\"width\"\r\n [hideOnOutsideClick]=\"true\"\r\n [wrapperAttr]=\"{ class: 'sds-durationbox-options-popover' }\"\r\n >\r\n\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view>\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"isValueEmpty\"\r\n (click)=\"applyOption(null)\"\r\n > {{ emptyValueText}}\r\n </button>\r\n\r\n <div *ngFor=\"let option of options\">\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"option === value\"\r\n (click)=\"applyOption(option)\"\r\n > {{option | sdsDurationFormat}}\r\n </button>\r\n </div>\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popover>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsDurationBoxComponent } from './duration-box.component';\r\nimport { DxPopoverModule, DxScrollViewModule, DxTextBoxModule, DxValidatorModule } from 'devextreme-angular';\r\nimport { SdsDurationPipeModule } from '@spicainternational/ngx-sds-components/src/lib/duration-pipe';\r\n\r\n\r\n\r\nconst components = [\r\n SdsDurationBoxComponent\r\n]\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsDurationBoxComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n\r\n SdsDurationPipeModule,\r\n \r\n DxTextBoxModule,\r\n DxPopoverModule,\r\n DxScrollViewModule,\r\n DxValidatorModule,\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsDurationBoxModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DurationService"],"mappings":";;;;;;;;;;;MAKa,eAAe,CAAA;AAExB,IAAA,WAAA,GAAA,GAAgB;AAET,IAAA,OAAO,CAAC,KAAa,EAAA;QACxB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9B,YAAA,OAAO,CAAC,CAAC;AACZ,SAAA;QAED,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACvC,QAAA,IAAI,aAAa,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AACP,wBAAA,GAAG,UAAU;AACd,qBAAA;iBACF,CAAA;;;AC7BD;;AAEG;;;;"}
1
+ {"version":3,"file":"spicainternational-ngx-sds-components-src-lib-duration-box.mjs","sources":["../../../projects/ngx-sds-components/src/lib/duration-box/duration.service.ts","../../../projects/ngx-sds-components/src/lib/duration-box/duration-box.component.ts","../../../projects/ngx-sds-components/src/lib/duration-box/duration-box.component.html","../../../projects/ngx-sds-components/src/lib/duration-box/duration-box.module.ts","../../../projects/ngx-sds-components/src/lib/duration-box/spicainternational-ngx-sds-components-src-lib-duration-box.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DurationService {\r\n \r\n constructor() {}\r\n\r\n public resolve(input: string): number | null{\r\n if (!input || input.length === 0) {\r\n return null;\r\n }\r\n\r\n const inputSegments = input.split(':');\r\n if (inputSegments.length > 2) {\r\n //invalid input\r\n return 0;\r\n } else if (inputSegments.length == 2){\r\n // we have hrs and minutes\r\n const hrs = parseInt(inputSegments[0] ? inputSegments[0] : '0');\r\n const mins = parseInt(inputSegments[1] ? inputSegments[1] : '0');\r\n const totalMins = (hrs * 60) + mins;\r\n\r\n return totalMins;\r\n } else if (inputSegments.length == 1) {\r\n // take last two digits as mins\r\n const nonSeparated = inputSegments[0];\r\n\r\n let totalMins = 0;\r\n if (nonSeparated.length <= 2) {\r\n totalMins = parseInt(nonSeparated)\r\n } else {\r\n const lastIndex = nonSeparated.length - 2;\r\n const part1 = nonSeparated.slice(0, lastIndex);\r\n const part2 = nonSeparated.slice(lastIndex);\r\n const hrs = parseInt(part1);\r\n const mins = parseInt(part2);\r\n totalMins = (hrs * 60) + mins; \r\n }\r\n return totalMins;\r\n }\r\n return 0; \r\n }\r\n\r\n public isValidInput(input: string) {\r\n if (input === '') {\r\n return true;\r\n }\r\n\r\n const regexNumbersOnly = /^[+-]?\\d+$/;\r\n const regexColonSeparated = /^[+-]?\\d+:\\d+$/;\r\n return regexNumbersOnly.test(input) || regexColonSeparated.test(input);\r\n }\r\n\r\n public getDefaultValue(min?: number, max?: number): number {\r\n let defaultValue = 0;\r\n // try keeping the 0 as default\r\n // if it is outside the min/max then adjust\r\n if (min) {\r\n defaultValue = Math.max(defaultValue, min);\r\n }\r\n if (max) {\r\n defaultValue = Math.min(defaultValue, max);\r\n }\r\n return defaultValue;\r\n }\r\n\r\n public isValueWithinLimits(value: number, min?: number, max?: number): boolean {\r\n return !((min != undefined && value < min) || (max != undefined && value > max))\r\n } \r\n\r\n}\r\n","import { AfterViewInit, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { SdsDurationFormatPipe } from '@spicainternational/ngx-sds-components/src/lib/duration-pipe';\r\nimport { DxValidatorComponent } from 'devextreme-angular';\r\nimport { DxiValidationRuleComponent } from 'devextreme-angular/ui/nested';\r\nimport { DurationBoxRangeViolationHandling } from './duration-box.types';\r\nimport { DurationService } from './duration.service';\r\n\r\n/**\r\n * Component allows user to enter duration in h:mm format. User may also select no value is this is applicable to the \r\n * use case. A list of pre-defined durations can be provided for easier selection.\r\n * \r\n * The auto resolve function tries to convert entered text into minutes. The algorithm splits entry into two parts \r\n * hours and minutes based on delimiter or if there is none - it takes last two digits as minutes.\r\n *\r\n * @export\r\n * @class SdsDurationBoxComponent\r\n */\r\n@Component({\r\n selector: 'sds-duration-box',\r\n templateUrl: './duration-box.component.html',\r\n styleUrls: ['./duration-box.component.scss'],\r\n})\r\nexport class SdsDurationBoxComponent implements OnInit, OnChanges, AfterViewInit {\r\n /**\r\n * Duration length expressed in minutes; when we allow empty values this property can be null.\r\n *\r\n * @type {(number | null)}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() value: number | null = null;\r\n @Output() valueChange = new EventEmitter<number | null>();\r\n\r\n /**\r\n * Allow user to select empty value. You should provide emptyValueText in this case. The emitted value is 'null'.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() allowEmptyValue: boolean = true;\r\n\r\n /**\r\n * Text to be displayed when value is cleared\r\n *\r\n * @type {string}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() emptyValueText: string = 'not set';\r\n\r\n /**\r\n * Array of pre-defined durations that will be displayed in dropdown for easier selection.\r\n *\r\n * @type {number[]}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() options?: number[];\r\n \r\n /**\r\n * Width of component. By default 10rem.\r\n *\r\n * @type {string}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() width: string = '10rem';\r\n\r\n /**\r\n * Specifies whether the UI component responds to user interaction.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() disabled: boolean = false;\r\n \r\n /**\r\n * Specifies whether to display the Clear button in the UI component.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() showClearButton: boolean = false;\r\n\r\n /**\r\n * The maximum value accepted by the duration box.\r\n *\r\n * @type {number}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() max?: number;\r\n\r\n /**\r\n * The minimum value accepted by the duration box.\r\n *\r\n * @type {number}\r\n * @memberof SdsDurationBoxComponent\r\n */ \r\n @Input() min?: number;\r\n\r\n /**\r\n * Specifies how range limits are handled.\r\n *\r\n * @type {('fallbackToLastValue' | 'showValidationError')}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() rangeViolationHandling: DurationBoxRangeViolationHandling = 'autoResolve';\r\n\r\n /**\r\n * Range violation message. Applicable when rangeViolationHandling is set to 'autoResolve'\r\n *\r\n * @type {string}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n @Input() rangeViolationText: string = 'value is outside the valid range';\r\n\r\n /**\r\n * Indicates whether the editor's value is valid.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsDurationBoxComponent\r\n */\r\n public isValid: boolean = true;\r\n\r\n\r\n\r\n // public elementUUID = 'sds-db-' + crypto.randomUUID();\r\n public elementUUID = `sds-db-${Math.ceil(Math.random() * 1000000)}`;\r\n\r\n\r\n public inputValue: string = '';\r\n public showOptions: boolean = false;\r\n \r\n public optionsDropdownButton;\r\n public clearValueButton;\r\n\r\n public isValueEmpty = false;\r\n\r\n\r\n @ViewChild('validationRule', { static: false }) private _validationRule: DxiValidationRuleComponent | undefined;\r\n @ViewChild('validator', { static: false }) private _validator: DxValidatorComponent | undefined;\r\n\r\n private isValueSetInternally = false;\r\n private _durationPipe: SdsDurationFormatPipe;\r\n\r\n constructor(\r\n private _durationInputResolver: DurationService,\r\n ) {\r\n this._durationPipe = new SdsDurationFormatPipe();\r\n \r\n this.optionsDropdownButton = {\r\n icon: 'spindown',\r\n stylingMode: 'text',\r\n \r\n onClick: () => {\r\n this.showOptions = !this.showOptions;\r\n }\r\n }\r\n\r\n this.clearValueButton = {\r\n icon: 'clear',\r\n stylingMode: 'text',\r\n elementAttr: { class: 'sds-durationbox-clear-button' },\r\n onClick: () => {\r\n this.applyOption(null);\r\n }\r\n } \r\n }\r\n ngAfterViewInit(): void {\r\n if (this._validationRule) {\r\n this._validationRule.validationCallback = () => { \r\n return this.checkIfValid() \r\n };\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (\r\n changes['value'] || \r\n changes['min'] || changes['max'] || \r\n changes['rangeViolationHandling'] ||\r\n changes['allowEmptyValue']\r\n ) {\r\n this.validateInputs();\r\n } \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n public blockNonNumberOrSemicolon(e: any) {\r\n this.isValueSetInternally = false;\r\n }\r\n\r\n public resolveInput() {\r\n if (!this.isValueSetInternally){\r\n if (!this._durationInputResolver.isValidInput(this.inputValue)) {\r\n // we have invalid input. use old value\r\n this.setInputValueInternally(this.value);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n const resolvedValue = this._durationInputResolver.resolve(this.inputValue);\r\n if (resolvedValue === null && this.allowEmptyValue) {\r\n this.setValue(null);\r\n this.setValidationStatusAndValidate(true);\r\n } else if (resolvedValue === null && !this.allowEmptyValue) {\r\n this.setValue(this._durationInputResolver.getDefaultValue());\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n // make sure that the value is within the min/max period\r\n if (this._durationInputResolver.isValueWithinLimits(resolvedValue as number, this.min, this.max)) {\r\n this.setValue(resolvedValue);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n // use old value\r\n if (this.rangeViolationHandling === 'autoResolve'){\r\n this.setInputValueInternally(this.value);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n this.setInputValueInternally(resolvedValue);\r\n this.setValidationStatusAndValidate(false);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public applyOption(value: number | null){\r\n this.showOptions = false;\r\n this.isValueSetInternally = false;\r\n this.setValue(value);\r\n }\r\n\r\n public checkIfValid() {\r\n return this.isValid;\r\n }\r\n\r\n private validateInputs(){\r\n if (this.value === null) {\r\n // handle null input\r\n if (this.allowEmptyValue) {\r\n this.setValue(null);\r\n } else {\r\n this.setValue(this._durationInputResolver.getDefaultValue());\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n }\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n // handle value input\r\n if (this._durationInputResolver.isValueWithinLimits(this.value, this.min, this.max)){\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n // value is out of range\r\n if (this.rangeViolationHandling === 'autoResolve'){\r\n this.setValue(this._durationInputResolver.getDefaultValue(this.min, this.max));\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n this.setValidationStatusAndValidate(true);\r\n } else {\r\n this.inputValue = this._durationPipe.transform(this.value, this.emptyValueText);\r\n this.setValidationStatusAndValidate(false);\r\n }\r\n }\r\n this._validator?.instance.validate();\r\n } \r\n }\r\n\r\n private setValue(value: number | null){\r\n this.isValueEmpty = (value === null);\r\n this.value = value;\r\n this.valueChange.emit(this.value);\r\n this.setInputValueInternally(value);\r\n }\r\n\r\n private setInputValueInternally(value: number | null){\r\n this.isValueSetInternally = true;\r\n setTimeout(() => {\r\n this.inputValue = this._durationPipe.transform(value, this.emptyValueText);\r\n }, 0);\r\n }\r\n\r\n private setValidationStatusAndValidate(isWithinRange: boolean){\r\n this.isValid = (this.rangeViolationHandling === 'autoResolve') || isWithinRange;\r\n this._validator?.instance.validate();\r\n }\r\n\r\n}\r\n","<dx-text-box\r\n #textbox\r\n [id]=\"elementUUID\"\r\n class=\"sds-durationbox\"\r\n [(value)]=\"inputValue\"\r\n (onKeyDown)=\"blockNonNumberOrSemicolon($event)\"\r\n (onChange)=\"resolveInput()\"\r\n [width]=\"width\"\r\n [disabled]=\"disabled\"\r\n >\r\n\r\n <dx-validator \r\n #validator>\r\n <dxi-validation-rule\r\n #validationRule\r\n type=\"custom\"\r\n [message]=\"rangeViolationText\"\r\n [reevaluate]=\"true\"\r\n ></dxi-validation-rule>\r\n </dx-validator>\r\n\r\n <dxi-button\r\n *ngIf=\"allowEmptyValue && showClearButton\"\r\n name=\"clearValue\"\r\n location=\"after\"\r\n [options]=\"clearValueButton\"\r\n ></dxi-button>\r\n \r\n <dxi-button\r\n *ngIf=\"options && options.length > 0\"\r\n name=\"optionsDropdown\"\r\n location=\"after\"\r\n [options]=\"optionsDropdownButton\"\r\n ></dxi-button>\r\n</dx-text-box>\r\n\r\n\r\n<dx-popover\r\n target=\"#{{elementUUID}}\"\r\n [(visible)]=\"showOptions\"\r\n [minWidth]=\"width\"\r\n [closeOnOutsideClick]=\"true\"\r\n [wrapperAttr]=\"{ class: 'sds-durationbox-options-popover' }\"\r\n >\r\n\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view>\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"isValueEmpty\"\r\n (click)=\"applyOption(null)\"\r\n > {{ emptyValueText}}\r\n </button>\r\n\r\n <div *ngFor=\"let option of options\">\r\n <button\r\n class=\"dropdown-item border-0\"\r\n [class.selected] = \"option === value\"\r\n (click)=\"applyOption(option)\"\r\n > {{option | sdsDurationFormat}}\r\n </button>\r\n </div>\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popover>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsDurationBoxComponent } from './duration-box.component';\r\nimport { DxPopoverModule, DxScrollViewModule, DxTextBoxModule, DxValidatorModule } from 'devextreme-angular';\r\nimport { SdsDurationPipeModule } from '@spicainternational/ngx-sds-components/src/lib/duration-pipe';\r\n\r\n\r\n\r\nconst components = [\r\n SdsDurationBoxComponent\r\n]\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsDurationBoxComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n\r\n SdsDurationPipeModule,\r\n \r\n DxTextBoxModule,\r\n DxPopoverModule,\r\n DxScrollViewModule,\r\n DxValidatorModule,\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsDurationBoxModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DurationService"],"mappings":";;;;;;;;;;;MAKa,eAAe,CAAA;AAExB,IAAA,WAAA,GAAA,GAAgB;AAET,IAAA,OAAO,CAAC,KAAa,EAAA;QACxB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9B,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;QAED,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACvC,QAAA,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;;AAE1B,YAAA,OAAO,CAAC,CAAC;AACZ,SAAA;AAAM,aAAA,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,EAAC;;YAEjC,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC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AAY;YAEZ,qBAAqB;YAErB,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,iBAAiB;SAClB,CAAA,EAAA,CAAA,CAAA;2FAKU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAlBhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,uBAAuB;AACxB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBAEZ,qBAAqB;wBAErB,eAAe;wBACf,eAAe;wBACf,kBAAkB;wBAClB,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,GAAG,UAAU;AACd,qBAAA;iBACF,CAAA;;;AC7BD;;AAEG;;;;"}
@@ -1,8 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Component, ContentChild, Input, Output, ViewChild, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common';
3
+ import * as i2 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { faXmark } from '@fortawesome/pro-regular-svg-icons';
6
+ import * as i1 from '@angular/cdk/a11y';
7
+ import { A11yModule } from '@angular/cdk/a11y';
6
8
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
7
9
 
8
10
  class SdsModalComponent {
@@ -51,10 +53,10 @@ class SdsModalComponent {
51
53
  }
52
54
  }
53
55
  SdsModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
54
- SdsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsModalComponent, selector: "sds-modal", inputs: { modalTitle: "modalTitle", showHeader: "showHeader", showFooter: "showFooter", size: "size", modalDialogId: "modalDialogId", showCloseButton: "showCloseButton", translations: "translations", isScrollable: "isScrollable", closeOnEscape: "closeOnEscape" }, outputs: { modalOpen: "modalOpen", modalClose: "modalClose", closeClick: "closeClick" }, queries: [{ propertyName: "headerContent", first: true, predicate: ["header"], descendants: true }], viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true }], ngImport: i0, template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" tabindex=\"1\">\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div *ngIf=\"showHeader && !headerContent\" class=\"modal-header\">\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
56
+ SdsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsModalComponent, selector: "sds-modal", inputs: { modalTitle: "modalTitle", showHeader: "showHeader", showFooter: "showFooter", size: "size", modalDialogId: "modalDialogId", showCloseButton: "showCloseButton", translations: "translations", isScrollable: "isScrollable", closeOnEscape: "closeOnEscape" }, outputs: { modalOpen: "modalOpen", modalClose: "modalClose", closeClick: "closeClick" }, queries: [{ propertyName: "headerContent", first: true, predicate: ["header"], descendants: true }], viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true }], ngImport: i0, template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div *ngIf=\"showHeader && !headerContent\" class=\"modal-header\">\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}\n"], directives: [{ type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
55
57
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalComponent, decorators: [{
56
58
  type: Component,
57
- args: [{ selector: 'sds-modal', template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" tabindex=\"1\">\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div *ngIf=\"showHeader && !headerContent\" class=\"modal-header\">\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}\n"] }]
59
+ args: [{ selector: 'sds-modal', template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div *ngIf=\"showHeader && !headerContent\" class=\"modal-header\">\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}\n"] }]
58
60
  }], ctorParameters: function () { return []; }, propDecorators: { headerContent: [{
59
61
  type: ContentChild,
60
62
  args: ['header']
@@ -100,6 +102,8 @@ class SdsDialogComponent {
100
102
  this.showCloseButton = true;
101
103
  this.showPrimaryButton = true;
102
104
  this.showSecondaryButton = true;
105
+ this.dialogOpen = new EventEmitter();
106
+ this.dialogClose = new EventEmitter();
103
107
  }
104
108
  ngOnInit() { }
105
109
  open(callback, data) {
@@ -131,12 +135,18 @@ class SdsDialogComponent {
131
135
  this._callback('close', this._callbackData);
132
136
  }
133
137
  }
138
+ onModalClose() {
139
+ this.dialogClose.emit();
140
+ }
141
+ onModalOpen() {
142
+ this.dialogOpen.emit();
143
+ }
134
144
  }
135
145
  SdsDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
136
- SdsDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsDialogComponent, selector: "sds-dialog", inputs: { title: "title", closeText: "closeText", size: "size", primaryButtonText: "primaryButtonText", secondaryButtonText: "secondaryButtonText", primaryButtonClass: "primaryButtonClass", secondaryButtonClass: "secondaryButtonClass", showHeader: "showHeader", showCloseButton: "showCloseButton", showPrimaryButton: "showPrimaryButton", showSecondaryButton: "showSecondaryButton" }, viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true, static: true }], ngImport: i0, template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n (closeClick)=\"onCloseClick()\"\r\n>\r\n <div>\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n *ngIf=\"showSecondaryButton\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n *ngIf=\"showPrimaryButton\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""], components: [{ type: SdsModalComponent, selector: "sds-modal", inputs: ["modalTitle", "showHeader", "showFooter", "size", "modalDialogId", "showCloseButton", "translations", "isScrollable", "closeOnEscape"], outputs: ["modalOpen", "modalClose", "closeClick"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
146
+ SdsDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsDialogComponent, selector: "sds-dialog", inputs: { title: "title", closeText: "closeText", size: "size", primaryButtonText: "primaryButtonText", secondaryButtonText: "secondaryButtonText", primaryButtonClass: "primaryButtonClass", secondaryButtonClass: "secondaryButtonClass", showHeader: "showHeader", showCloseButton: "showCloseButton", showPrimaryButton: "showPrimaryButton", showSecondaryButton: "showSecondaryButton" }, outputs: { dialogOpen: "dialogOpen", dialogClose: "dialogClose" }, viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true, static: true }], ngImport: i0, template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n (closeClick)=\"onCloseClick()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n>\r\n <div>\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n *ngIf=\"showSecondaryButton\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n *ngIf=\"showPrimaryButton\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""], components: [{ type: SdsModalComponent, selector: "sds-modal", inputs: ["modalTitle", "showHeader", "showFooter", "size", "modalDialogId", "showCloseButton", "translations", "isScrollable", "closeOnEscape"], outputs: ["modalOpen", "modalClose", "closeClick"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
137
147
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsDialogComponent, decorators: [{
138
148
  type: Component,
139
- args: [{ selector: 'sds-dialog', template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n (closeClick)=\"onCloseClick()\"\r\n>\r\n <div>\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n *ngIf=\"showSecondaryButton\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n *ngIf=\"showPrimaryButton\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""] }]
149
+ args: [{ selector: 'sds-dialog', template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n (closeClick)=\"onCloseClick()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n>\r\n <div>\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n *ngIf=\"showSecondaryButton\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n *ngIf=\"showPrimaryButton\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""] }]
140
150
  }], ctorParameters: function () { return []; }, propDecorators: { title: [{
141
151
  type: Input
142
152
  }], closeText: [{
@@ -159,6 +169,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
159
169
  type: Input
160
170
  }], showSecondaryButton: [{
161
171
  type: Input
172
+ }], dialogOpen: [{
173
+ type: Output
174
+ }], dialogClose: [{
175
+ type: Output
162
176
  }], _modal: [{
163
177
  type: ViewChild,
164
178
  args: ['modal', { static: true }]
@@ -173,10 +187,12 @@ class SdsModalModule {
173
187
  SdsModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
174
188
  SdsModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalModule, declarations: [SdsModalComponent,
175
189
  SdsDialogComponent], imports: [CommonModule,
190
+ A11yModule,
176
191
  FontAwesomeModule], exports: [SdsModalComponent,
177
192
  SdsDialogComponent] });
178
193
  SdsModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalModule, imports: [[
179
194
  CommonModule,
195
+ A11yModule,
180
196
  FontAwesomeModule
181
197
  ]] });
182
198
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalModule, decorators: [{
@@ -187,6 +203,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
187
203
  ],
188
204
  imports: [
189
205
  CommonModule,
206
+ A11yModule,
190
207
  FontAwesomeModule
191
208
  ],
192
209
  exports: [
@@ -1 +1 @@
1
- {"version":3,"file":"spicainternational-ngx-sds-components-src-lib-modal.mjs","sources":["../../../projects/ngx-sds-components/src/lib/modal/modal.component.ts","../../../projects/ngx-sds-components/src/lib/modal/modal.component.html","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.ts","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.html","../../../projects/ngx-sds-components/src/lib/modal/modal.module.ts","../../../projects/ngx-sds-components/src/lib/modal/spicainternational-ngx-sds-components-src-lib-modal.ts"],"sourcesContent":["import {\r\n Component,\r\n ElementRef,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n EventEmitter,\r\n ContentChild,\r\n HostListener,\r\n} from '@angular/core';\r\nimport { faXmark } from '@fortawesome/pro-regular-svg-icons';\r\nimport { ModalTranslations } from './modal.model';\r\n\r\n@Component({\r\n selector: 'sds-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n})\r\nexport class SdsModalComponent implements OnInit {\r\n @ContentChild('header') headerContent: ElementRef = { nativeElement: undefined };\r\n\r\n @Input() public modalTitle?: string;\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showFooter: boolean = true;\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\r\n @Input() public modalDialogId?: string;\r\n @Input() public showCloseButton: boolean = true;\r\n\r\n @Input() public translations: ModalTranslations;\r\n @Input() public isScrollable = true;\r\n @Input() public closeOnEscape = false;\r\n\r\n @Output() public modalOpen: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public modalClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n @Output() public closeClick: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n public closeIcon = faXmark;\r\n\r\n @ViewChild('modal', { static: false }) private _modal: ElementRef | undefined;\r\n \r\n\r\n constructor() {\r\n this.translations = {\r\n close: undefined\r\n }\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n public open(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'block';\r\n this._modal.nativeElement.focus();\r\n this.modalOpen.emit();\r\n }\r\n }\r\n\r\n public close(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'none';\r\n this.modalClose.emit();\r\n }\r\n }\r\n\r\n public onCloseButtonClick(){\r\n this.closeClick.emit();\r\n this.close();\r\n }\r\n\r\n onKeydown(event: KeyboardEvent){\r\n if (\r\n event.code === 'Escape' &&\r\n this. closeOnEscape && \r\n this._modal != undefined && \r\n this._modal.nativeElement.style.display === 'block'){\r\n // console.log(`${this.constructor.name} got event: ${event.code}`);\r\n this.close();\r\n }\r\n }\r\n}\r\n","<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" tabindex=\"1\">\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div *ngIf=\"showHeader && !headerContent\" class=\"modal-header\">\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>","import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { SdsModalComponent } from '../modal.component';\r\n\r\ntype modalButton = 'primary' | 'secondary' | 'close';\r\n\r\n@Component({\r\n selector: 'sds-dialog',\r\n templateUrl: './dialog.component.html',\r\n styleUrls: ['./dialog.component.scss'],\r\n})\r\nexport class SdsDialogComponent implements OnInit {\r\n @Input() public title: string = '';\r\n @Input() public closeText?: string = 'close';\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\r\n\r\n @Input() public primaryButtonText: string = 'Ok';\r\n @Input() public secondaryButtonText: string = 'Cancel';\r\n\r\n @Input() public primaryButtonClass: string = 'btn-primary';\r\n @Input() public secondaryButtonClass: string = 'btn-secondary';\r\n\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showCloseButton: boolean = true;\r\n @Input() public showPrimaryButton: boolean = true;\r\n @Input() public showSecondaryButton: boolean = true;\r\n\r\n @ViewChild('modal', { static: true }) private _modal: SdsModalComponent | undefined;\r\n\r\n private _callback?: Function;\r\n private _callbackData: any;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n public open(callback?: (button: modalButton, data: any) => void, data?: any): void{\r\n this._callback = callback;\r\n this._callbackData = data;\r\n\r\n if (this._modal != undefined) {\r\n this._modal.open();\r\n }\r\n }\r\n\r\n private close(): void {\r\n if (this._modal != undefined) {\r\n this._modal.close();\r\n }\r\n }\r\n\r\n public onSecondaryClick(): void {\r\n if (this._callback) {\r\n this._callback('secondary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onPrimaryClick(): void {\r\n if (this._callback) {\r\n this._callback('primary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onCloseClick(): void {\r\n if (this._callback) {\r\n this._callback('close', this._callbackData);\r\n }\r\n }\r\n\r\n}\r\n\r\n\r\n\r\n","<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n (closeClick)=\"onCloseClick()\"\r\n>\r\n <div>\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n *ngIf=\"showSecondaryButton\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n *ngIf=\"showPrimaryButton\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsModalComponent } from './modal.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { SdsDialogComponent } from './dialog/dialog.component';\r\n\r\n\r\nconst components = [\r\n SdsModalComponent,\r\n SdsDialogComponent\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n]\r\n})\r\nexport class SdsModalModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsModalComponent","i2"],"mappings":";;;;;;;MAmBa,iBAAiB,CAAA;AAwB1B,IAAA,WAAA,GAAA;QAvBwB,IAAA,CAAA,aAAa,GAAe,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AAGjE,QAAA,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;AAC3B,QAAA,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;AAC3B,QAAA,IAAI,CAAA,IAAA,GAA8B,IAAI,CAAC;AAEvC,QAAA,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;AAGhC,QAAA,IAAY,CAAA,YAAA,GAAG,IAAI,CAAC;AACpB,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;AAErB,QAAA,IAAA,CAAA,SAAS,GAAuB,IAAI,YAAY,EAAQ,CAAC;AACzD,QAAA,IAAA,CAAA,UAAU,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAE1D,QAAA,IAAA,CAAA,UAAU,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAEpE,QAAA,IAAS,CAAA,SAAA,GAAG,OAAO,CAAC;QAMvB,IAAI,CAAC,YAAY,GAAG;AAChB,YAAA,KAAK,EAAE,SAAS;SACnB,CAAA;KACJ;AAED,IAAA,QAAQ,MAAW;IAEZ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AO,EAAE;wBACP,YAAY;wBACZ,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,GAAG,UAAU;AAChB,qBAAA;iBACA,CAAA;;;ACvBD;;AAEG;;;;"}
1
+ {"version":3,"file":"spicainternational-ngx-sds-components-src-lib-modal.mjs","sources":["../../../projects/ngx-sds-components/src/lib/modal/modal.component.ts","../../../projects/ngx-sds-components/src/lib/modal/modal.component.html","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.ts","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.html","../../../projects/ngx-sds-components/src/lib/modal/modal.module.ts","../../../projects/ngx-sds-components/src/lib/modal/spicainternational-ngx-sds-components-src-lib-modal.ts"],"sourcesContent":["import {\r\n Component,\r\n ElementRef,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n EventEmitter,\r\n ContentChild,\r\n HostListener,\r\n} from '@angular/core';\r\nimport { faXmark } from '@fortawesome/pro-regular-svg-icons';\r\nimport { ModalTranslations } from './modal.model';\r\n\r\n@Component({\r\n selector: 'sds-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n})\r\nexport class SdsModalComponent implements OnInit {\r\n @ContentChild('header') headerContent: ElementRef = { nativeElement: undefined };\r\n\r\n @Input() public modalTitle?: string;\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showFooter: boolean = true;\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\r\n @Input() public modalDialogId?: string;\r\n @Input() public showCloseButton: boolean = true;\r\n\r\n @Input() public translations: ModalTranslations;\r\n @Input() public isScrollable = true;\r\n @Input() public closeOnEscape = false;\r\n\r\n @Output() public modalOpen: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public modalClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n @Output() public closeClick: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n public closeIcon = faXmark;\r\n\r\n @ViewChild('modal', { static: false }) private _modal: ElementRef | undefined;\r\n \r\n\r\n constructor() {\r\n this.translations = {\r\n close: undefined\r\n }\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n public open(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'block';\r\n this._modal.nativeElement.focus();\r\n this.modalOpen.emit();\r\n }\r\n }\r\n\r\n public close(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'none';\r\n this.modalClose.emit();\r\n }\r\n }\r\n\r\n public onCloseButtonClick(){\r\n this.closeClick.emit();\r\n this.close();\r\n }\r\n\r\n onKeydown(event: KeyboardEvent){\r\n if (\r\n event.code === 'Escape' &&\r\n this. closeOnEscape && \r\n this._modal != undefined && \r\n this._modal.nativeElement.style.display === 'block'){\r\n // console.log(`${this.constructor.name} got event: ${event.code}`);\r\n this.close();\r\n }\r\n }\r\n}\r\n","<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div *ngIf=\"showHeader && !headerContent\" class=\"modal-header\">\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>","import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { SdsModalComponent } from '../modal.component';\r\n\r\ntype modalButton = 'primary' | 'secondary' | 'close';\r\n\r\n@Component({\r\n selector: 'sds-dialog',\r\n templateUrl: './dialog.component.html',\r\n styleUrls: ['./dialog.component.scss'],\r\n})\r\nexport class SdsDialogComponent implements OnInit {\r\n @Input() public title: string = '';\r\n @Input() public closeText?: string = 'close';\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\r\n\r\n @Input() public primaryButtonText: string = 'Ok';\r\n @Input() public secondaryButtonText: string = 'Cancel';\r\n\r\n @Input() public primaryButtonClass: string = 'btn-primary';\r\n @Input() public secondaryButtonClass: string = 'btn-secondary';\r\n\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showCloseButton: boolean = true;\r\n @Input() public showPrimaryButton: boolean = true;\r\n @Input() public showSecondaryButton: boolean = true;\r\n\r\n @Output() public dialogOpen: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public dialogClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n\r\n @ViewChild('modal', { static: true }) private _modal: SdsModalComponent | undefined;\r\n\r\n private _callback?: Function;\r\n private _callbackData: any;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n public open(callback?: (button: modalButton, data: any) => void, data?: any): void{\r\n this._callback = callback;\r\n this._callbackData = data;\r\n\r\n if (this._modal != undefined) {\r\n this._modal.open();\r\n }\r\n }\r\n\r\n private close(): void {\r\n if (this._modal != undefined) {\r\n this._modal.close();\r\n }\r\n }\r\n\r\n public onSecondaryClick(): void {\r\n if (this._callback) {\r\n this._callback('secondary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onPrimaryClick(): void {\r\n if (this._callback) {\r\n this._callback('primary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onCloseClick(): void {\r\n if (this._callback) {\r\n this._callback('close', this._callbackData);\r\n }\r\n }\r\n\r\n public onModalClose(): void {\r\n this.dialogClose.emit();\r\n }\r\n\r\n public onModalOpen(): void {\r\n this.dialogOpen.emit();\r\n } \r\n\r\n}\r\n\r\n\r\n\r\n","<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n (closeClick)=\"onCloseClick()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n>\r\n <div>\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n *ngIf=\"showSecondaryButton\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n *ngIf=\"showPrimaryButton\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsModalComponent } from './modal.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { SdsDialogComponent } from './dialog/dialog.component';\r\nimport { A11yModule } from '@angular/cdk/a11y';\r\n\r\n\r\nconst components = [\r\n SdsModalComponent,\r\n SdsDialogComponent\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n A11yModule,\r\n FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n]\r\n})\r\nexport class SdsModalModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsModalComponent"],"mappings":";;;;;;;;;MAmBa,iBAAiB,CAAA;AAwB1B,IAAA,WAAA,GAAA;QAvBwB,IAAA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