carbon-components-angular 3.17.2 → 3.17.3

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 (72) hide show
  1. package/docs/documentation/components/Dropdown.html +10 -5
  2. package/docs/documentation/components/File.html +49 -6
  3. package/docs/documentation/components/FileUploader.html +39 -27
  4. package/docs/documentation/components/Header.html +428 -11
  5. package/docs/documentation/components/HeaderAction.html +6 -8
  6. package/docs/documentation/components/Notification.html +37 -5
  7. package/docs/documentation/components/Toast.html +77 -7
  8. package/docs/documentation/coverage.html +12 -12
  9. package/docs/documentation/interfaces/FileItem.html +66 -0
  10. package/docs/documentation/interfaces/NotificationContent.html +39 -0
  11. package/docs/documentation/interfaces/ToastContent.html +1 -0
  12. package/docs/documentation/js/menu-wc.js +1 -1
  13. package/docs/documentation/js/search/search_index.js +2 -2
  14. package/docs/documentation/modules/FileUploaderModule.html +3 -1
  15. package/docs/storybook/iframe.html +3 -3
  16. package/docs/storybook/{main.8bb53895aa13a93f113f.bundle.js → main.edce6b8dbd74b486e13b.bundle.js} +151 -58
  17. package/docs/storybook/main.edce6b8dbd74b486e13b.bundle.js.map +1 -0
  18. package/docs/storybook/{runtime~main.8bb53895aa13a93f113f.bundle.js → runtime~main.edce6b8dbd74b486e13b.bundle.js} +1 -1
  19. package/docs/storybook/{runtime~main.8bb53895aa13a93f113f.bundle.js.map → runtime~main.edce6b8dbd74b486e13b.bundle.js.map} +1 -1
  20. package/docs/storybook/{vendors~main.8bb53895aa13a93f113f.bundle.js → vendors~main.edce6b8dbd74b486e13b.bundle.js} +1 -1
  21. package/docs/storybook/{vendors~main.8bb53895aa13a93f113f.bundle.js.map → vendors~main.edce6b8dbd74b486e13b.bundle.js.map} +1 -1
  22. package/dropdown/dropdown.component.js +4 -0
  23. package/dropdown/dropdown.component.js.map +1 -1
  24. package/file-uploader/file-item.interface.d.ts +2 -0
  25. package/file-uploader/file-item.interface.js.map +1 -1
  26. package/file-uploader/file-uploader.component.js +3 -1
  27. package/file-uploader/file-uploader.component.js.map +1 -1
  28. package/file-uploader/file-uploader.component.metadata.json +1 -1
  29. package/file-uploader/file-uploader.component.ngfactory.js +9 -8
  30. package/file-uploader/file-uploader.component.ngfactory.js.map +1 -1
  31. package/file-uploader/file-uploader.module.js +3 -1
  32. package/file-uploader/file-uploader.module.js.map +1 -1
  33. package/file-uploader/file-uploader.module.metadata.json +1 -1
  34. package/file-uploader/file-uploader.module.ngfactory.js +2 -1
  35. package/file-uploader/file-uploader.module.ngfactory.js.map +1 -1
  36. package/file-uploader/file-uploader.module.ngsummary.json +1 -1
  37. package/file-uploader/file.component.d.ts +1 -0
  38. package/file-uploader/file.component.js +10 -2
  39. package/file-uploader/file.component.js.map +1 -1
  40. package/file-uploader/file.component.metadata.json +1 -1
  41. package/file-uploader/file.component.ngfactory.js +19 -16
  42. package/file-uploader/file.component.ngfactory.js.map +1 -1
  43. package/file-uploader/file.component.ngsummary.json +1 -1
  44. package/notification/notification-content.interface.d.ts +1 -0
  45. package/notification/notification-content.interface.js.map +1 -1
  46. package/notification/notification.component.d.ts +1 -0
  47. package/notification/notification.component.js +7 -1
  48. package/notification/notification.component.js.map +1 -1
  49. package/notification/notification.component.metadata.json +1 -1
  50. package/notification/notification.component.ngfactory.js +1 -1
  51. package/notification/notification.component.ngsummary.json +1 -1
  52. package/notification/toast.component.d.ts +1 -0
  53. package/notification/toast.component.js +7 -1
  54. package/notification/toast.component.js.map +1 -1
  55. package/notification/toast.component.metadata.json +1 -1
  56. package/notification/toast.component.ngfactory.js +1 -1
  57. package/notification/toast.component.ngsummary.json +1 -1
  58. package/package.json +1 -1
  59. package/ui-shell/header/header-action.component.js +1 -1
  60. package/ui-shell/header/header-action.component.js.map +1 -1
  61. package/ui-shell/header/header-action.component.metadata.json +1 -1
  62. package/ui-shell/header/header-action.component.ngfactory.js +5 -6
  63. package/ui-shell/header/header-action.component.ngfactory.js.map +1 -1
  64. package/ui-shell/header/header.component.d.ts +26 -1
  65. package/ui-shell/header/header.component.js +40 -5
  66. package/ui-shell/header/header.component.js.map +1 -1
  67. package/ui-shell/header/header.component.metadata.json +1 -1
  68. package/ui-shell/header/header.component.ngfactory.js +9 -3
  69. package/ui-shell/header/header.component.ngfactory.js.map +1 -1
  70. package/ui-shell/header/header.component.ngsummary.json +1 -1
  71. package/ui-shell/header/header.module.ngfactory.js.map +1 -1
  72. package/docs/storybook/main.8bb53895aa13a93f113f.bundle.js.map +0 -1
@@ -448,6 +448,10 @@ var Dropdown = /** @class */ (function () {
448
448
  */
449
449
  Dropdown.prototype.openMenu = function () {
450
450
  var _this = this;
451
+ // prevents the dropdown from opening when list of items is empty
452
+ if (this.view.getListItems().length === 0) {
453
+ return;
454
+ }
451
455
  this.menuIsClosed = false;
452
456
  // move the dropdown list to the body if we're not appending inline
453
457
  // and position it relative to the dropdown wrapper
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../src/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,SAAS,EAET,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AAEzE,yEAAyE;AACzE,OAAO,EAEN,SAAS,EACT,EAAE,EAEF,KAAK,EACL,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEtF;;;;;;GAMG;AACH;IAyNC;;OAEG;IACH,kBAAsB,UAAsB,EAAY,IAAU,EAAY,eAAgC;QAAxF,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ter,\n\tElementRef,\n\tContentChild,\n\tOnInit,\n\tViewChild,\n\tAfterContentInit,\n\tHostListener,\n\tOnDestroy,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\n// Observable import is required here so typescript can compile correctly\nimport {\n\tObservable,\n\tfromEvent,\n\tof,\n\tSubscription,\n\tmerge\n} from \"rxjs\";\n\nimport { AbstractDropdownView } from \"./abstract-dropdown-view.class\";\nimport { position } from \"@carbon/utils-position\";\nimport { I18n } from \"./../i18n/i18n.module\";\nimport { ListItem } from \"./list-item.interface\";\nimport { DropdownService } from \"./dropdown.service\";\nimport { scrollableParentsObservable, isVisibleInContainer } from \"./../utils/scroll\";\n\n/**\n * Drop-down lists enable users to select one or more items from a list.\n *\n * [See demo](../../?path=/story/dropdown--basic)\n *\n * <example-url>../../iframe.html?id=dropdown--basic</example-url>\n */\n@Component({\n\tselector: \"ibm-dropdown\",\n\ttemplate: `\n\t<label *ngIf=\"label\" [for]=\"id\" class=\"bx--label\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div *ngIf=\"helperText\" class=\"bx--form__helper-text\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div\n\t\t[id]=\"id\"\n\t\tclass=\"bx--dropdown bx--list-box\"\n\t\t[ngClass]=\"{\n\t\t\t'bx--dropdown--light': theme === 'light',\n\t\t\t'bx--list-box--inline': inline,\n\t\t\t'bx--skeleton': skeleton,\n\t\t\t'bx--dropdown--disabled bx--list-box--disabled': disabled\n\t\t}\">\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\t#dropdownButton\n\t\t\tclass=\"bx--list-box__field\"\n\t\t\t[ngClass]=\"{'a': !menuIsClosed}\"\n\t\t\t[attr.aria-expanded]=\"!menuIsClosed\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\t(click)=\"toggleMenu()\"\n\t\t\t(blur)=\"onBlur()\"\n\t\t\t[disabled]=\"disabled\">\n\t\t\t<div\n\t\t\t\t(click)=\"clearSelected()\"\n\t\t\t\t*ngIf=\"type === 'multi' && getSelectedCount() > 0\"\n\t\t\t\tclass=\"bx--list-box__selection--multi\"\n\t\t\t\ttitle=\"Clear all selected items\">\n\t\t\t\t{{getSelectedCount()}}\n\t\t\t\t<svg\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\trole=\"img\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\twidth=\"16\"\n\t\t\t\t\theight=\"16\"\n\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t<path d=\"M12 4.7l-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z\"></path>\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t\t<span *ngIf=\"isRenderString()\" class=\"bx--list-box__label\">{{getDisplayStringValue() | async}}</span>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"!isRenderString()\"\n\t\t\t\t[ngTemplateOutletContext]=\"getRenderTemplateContext()\"\n\t\t\t\t[ngTemplateOutlet]=\"displayValue\">\n\t\t\t</ng-template>\n\t\t\t<ibm-icon-chevron-down16\n\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\tclass=\"bx--list-box__menu-icon\"\n\t\t\t\t[attr.aria-label]=\"menuButtonLabel\"\n\t\t\t\t[ngClass]=\"{'bx--list-box__menu-icon--open': !menuIsClosed }\">\n\t\t\t</ibm-icon-chevron-down16>\n\t\t</button>\n\t\t<div\n\t\t\t#dropdownMenu\n\t\t\t[ngClass]=\"{\n\t\t\t\t'drop-up': dropUp\n\t\t\t}\">\n\t\t\t<ng-content *ngIf=\"!menuIsClosed\"></ng-content>\n\t\t</div>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Dropdown,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Dropdown implements OnInit, AfterContentInit, OnDestroy, ControlValueAccessor {\n\tstatic dropdownCount = 0;\n\t@Input() id = `dropdown-${Dropdown.dropdownCount++}`;\n\t/**\n\t * Label for the dropdown.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Value displayed if no item is selected.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * The selected value from the `Dropdown`. Can be a string or template.\n\t */\n\t@Input() displayValue: string | TemplateRef<any> = \"\";\n\t/**\n\t * Size to render the dropdown field.\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Defines whether or not the `Dropdown` supports selecting multiple items as opposed to single\n\t * item selection.\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\t/**\n\t * `light` or `dark` dropdown theme\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` to disable the dropdown.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading dropdown.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an inline dropdown.\n\t */\n\t@Input() inline = false;\n\t/**\n\t * Set to `true` for a dropdown without arrow key activation.\n\t */\n\t@Input() disableArrowKeys = false;\n\t/**\n\t * Deprecated. Dropdown now defaults to appending inline\n\t * Set to `true` if the `Dropdown` is to be appended to the DOM body.\n\t */\n\t@Input() set appendToBody (v) {\n\t\tconsole.warn(\"`appendToBody` has been deprecated. Dropdowns now append to the body by default.\");\n\t\tconsole.warn(\"Ensure you have an `ibm-placeholder` in your app.\");\n\t\tconsole.warn(\"Use `appendInline` if you need to position your dropdowns within the normal page flow.\");\n\t\tthis.appendInline = !v;\n\t}\n\n\tget appendToBody() {\n\t\treturn !this.appendInline;\n\t}\n\t/**\n\t * set to `true` to place the dropdown view inline with the component\n\t */\n\t@Input() appendInline = false;\n\t/**\n\t * Query string for the element that contains the `Dropdown`.\n\t * Used to trigger closing the dropdown if it scrolls outside of the viewport of the `scrollableContainer`.\n\t */\n\t@Input() scrollableContainer: string;\n\t/**\n\t * Specifies the property to be used as the return value to `ngModel`\n\t */\n\t@Input() value: string;\n\t/**\n\t * Accessible label for the button that opens the dropdown list.\n\t * Defaults to the `DROPDOWN.OPEN` value from the i18n service.\n\t */\n\t@Input() menuButtonLabel = this.i18n.get().DROPDOWN.OPEN;\n\t/**\n\t * Provides the label for the \"# selected\" text.\n\t * Defaults to the `DROPDOWN.SELECTED` value from the i18n service.\n\t */\n\t@Input() selectedLabel = this.i18n.get().DROPDOWN.SELECTED;\n\t/**\n\t * Emits selection events.\n\t */\n\t@Output() selected: EventEmitter<Object> = new EventEmitter<Object>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter<any>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() close: EventEmitter<any> = new EventEmitter<any>();\n\n\t/**\n\t * Maintains a reference to the `AbstractDropdownView` object within the content DOM.\n\t */\n\t@ContentChild(AbstractDropdownView) view: AbstractDropdownView;\n\t/**\n\t * Maintains a reference to the view DOM element of the `Dropdown` button.\n\t */\n\t@ViewChild(\"dropdownButton\") dropdownButton;\n\t/**\n\t * ViewChid of the dropdown view.\n\t */\n\t@ViewChild(\"dropdownMenu\") dropdownMenu;\n\n\t@HostBinding(\"class.bx--dropdown__wrapper\") hostClass = true;\n\t/**\n\t * Set to `true` if the dropdown is closed (not expanded).\n\t */\n\tmenuIsClosed = true;\n\n\t/**\n\t * controls wether the `drop-up` class is applied\n\t */\n\tdropUp = false;\n\n\t// .bind creates a new function, so we declare the methods below\n\t// but .bind them up here\n\tnoop = this._noop.bind(this);\n\toutsideClick = this._outsideClick.bind(this);\n\toutsideKey = this._outsideKey.bind(this);\n\tkeyboardNav = this._keyboardNav.bind(this);\n\t/**\n\t * Maintians an Event Observable Subscription for tracking scrolling within the open `Dropdown` list.\n\t */\n\tscroll: Subscription;\n\n\tprotected onTouchedCallback: () => void = this._noop;\n\n\t// primarily used to capture and propagate input to `writeValue` before the content is available\n\tprotected writtenValue = [];\n\n\t/**\n\t * Creates an instance of Dropdown.\n\t */\n\tconstructor(protected elementRef: ElementRef, protected i18n: I18n, protected dropdownService: DropdownService) {}\n\n\t/**\n\t * Updates the `type` property in the `@ContentChild`.\n\t * The `type` property specifies whether the `Dropdown` allows single selection or multi selection.\n\t */\n\tngOnInit() {\n\t\tif (this.view) {\n\t\t\tthis.view.type = this.type;\n\t\t}\n\t}\n\n\t/**\n\t * Initializes classes and subscribes to events for single or multi selection.\n\t */\n\tngAfterContentInit() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tthis.writeValue(this.writtenValue);\n\t\tthis.view.type = this.type;\n\t\tthis.view.size = this.size;\n\t\tthis.view.select.subscribe(event => {\n\t\t\tif (this.type === \"multi\") {\n\t\t\t\t// if we have a `value` selector and selected items map them approperiatly\n\t\t\t\tif (this.value && this.view.getSelected()) {\n\t\t\t\t\tconst values = this.view.getSelected().map(item => item[this.value]);\n\t\t\t\t\tthis.propagateChange(values);\n\t\t\t\t// otherwise just pass up the values from `getSelected`\n\t\t\t\t} else {\n\t\t\t\t\tthis.propagateChange(this.view.getSelected());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.closeMenu();\n\t\t\t\tif (event.item && event.item.selected) {\n\t\t\t\t\tif (this.value) {\n\t\t\t\t\t\tthis.propagateChange(event.item[this.value]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.propagateChange(event.item);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.propagateChange(null);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// only emit selected for \"organic\" selections\n\t\t\tif (event && !event.isUpdate) {\n\t\t\t\tthis.selected.emit(event);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Removing the `Dropdown` from the body if it is appended to the body.\n\t */\n\tngOnDestroy() {\n\t\tif (this.appendToBody) {\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Propagates the injected `value`.\n\t */\n\twriteValue(value: any) {\n\t\t// cache the written value so we can use it in `AfterContentInit`\n\t\tthis.writtenValue = value;\n\t\t// propagate null/falsey as an array (deselect everything)\n\t\tif (!value) {\n\t\t\tthis.view.propagateSelected([value]);\n\t\t} else if (this.type === \"single\") {\n\t\t\tif (this.value) {\n\t\t\t\t// clone the specified item and update its state\n\t\t\t\tconst newValue = Object.assign({}, this.view.getListItems().find(item => item[this.value] === value));\n\t\t\t\tnewValue.selected = true;\n\t\t\t\tthis.view.propagateSelected([newValue]);\n\t\t\t} else {\n\t\t\t\t// pass the singular value as an array of ListItem\n\t\t\t\tthis.view.propagateSelected([value]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.value) {\n\t\t\t\t// clone the items and update their state based on the received value array\n\t\t\t\t// this way we don't lose any additional metadata that may be passed in via the `items` Input\n\t\t\t\tlet newValues = [];\n\t\t\t\tfor (const v of value) {\n\t\t\t\t\tfor (const item of this.view.getListItems()) {\n\t\t\t\t\t\tif (item[this.value] === v) {\n\t\t\t\t\t\t\tnewValues.push(Object.assign({}, item, { selected: true }));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.view.propagateSelected(newValues);\n\t\t\t} else {\n\t\t\t\t// we can safely assume we're passing an array of `ListItem`s\n\t\t\t\tthis.view.propagateSelected(value);\n\t\t\t}\n\t\t}\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registering the function injected to control the touch use of the `Dropdown`.\n\t */\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\n\t/**\n\t * function passed in by `registerOnChange`\n\t */\n\tpropagateChange = (_: any) => {};\n\n\t/**\n\t * `ControlValueAccessor` method to programatically disable the dropdown.\n\t *\n\t * ex: `this.formGroup.get(\"myDropdown\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Adds keyboard functionality for navigation, selection and closing of the `Dropdown`.\n\t */\n\t@HostListener(\"keydown\", [\"$event\"])\n\t// \"Esc\", \"Spacebar\", \"Down\", and \"Up\" are IE specific values\n\tonKeyDown(event: KeyboardEvent) {\n\t\tif ((event.key === \"Escape\" || event.key === \"Esc\") && !this.menuIsClosed) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close other widgets that listen for Escape\n\t\t}\n\t\tif (event.key === \"Escape\" || event.key === \"Esc\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (this.menuIsClosed && (event.key === \" \" || event.key === \"ArrowDown\" || event.key === \"ArrowUp\" ||\n\t\t\tevent.key === \"Spacebar\" || event.key === \"Down\" || event.key === \"Up\")) {\n\t\t\tif (this.disableArrowKeys && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\" || event.key === \"Down\" || event.key === \"Up\")) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tthis.openMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && event.shiftKey) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (this.type === \"multi\") { return; }\n\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.closedDropdownNavigation(event);\n\t\t}\n\t}\n\n\tclosedDropdownNavigation(event) {\n\t\t// \"Down\", and \"Up\" are IE specific values\n\t\tif (event.key === \"ArrowDown\" || event.key === \"Down\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getNextItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t} else if (event.key === \"ArrowUp\" || event.key === \"Up\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getPrevItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t}\n\t}\n\n\t/**\n\t * Returns the display value if there is a selection and displayValue is set,\n\t * if there is just a selection the ListItem content property will be returned,\n\t * otherwise the placeholder will be returned.\n\t */\n\tgetDisplayStringValue(): Observable<string> {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (selected && (!this.displayValue || !this.isRenderString())) {\n\t\t\tif (this.type === \"multi\") {\n\t\t\t\treturn of(this.placeholder);\n\t\t\t} else {\n\t\t\t\treturn of(selected[0].content);\n\t\t\t}\n\t\t} else if (selected && this.isRenderString()) {\n\t\t\treturn of(this.displayValue as string);\n\t\t}\n\t\treturn of(this.placeholder);\n\t}\n\n\tisRenderString(): boolean {\n\t\treturn typeof this.displayValue === \"string\";\n\t}\n\n\tgetRenderTemplateContext() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (this.type === \"multi\") {\n\t\t\treturn {items: selected};\n\t\t} else if (selected && selected.length > 0) {\n\t\t\treturn {item: selected[0]}; // this is to be compatible with the dropdown-list template\n\t\t} else {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tgetSelectedCount(): number {\n\t\tif (this.view.getSelected()) {\n\t\t\treturn this.view.getSelected().length;\n\t\t}\n\t}\n\n\tclearSelected() {\n\t\tif (this.disabled) { return; }\n\t\tfor (const item of this.view.getListItems()) {\n\t\t\titem.selected = false;\n\t\t}\n\t\tthis.selected.emit([]);\n\t\tthis.propagateChange([]);\n\t}\n\n\t/**\n\t * Returns `true` if there is a value selected.\n\t */\n\tvalueSelected(): boolean {\n\t\tif (this.view.getSelected()) { return true; }\n\t\treturn false;\n\t}\n\n\t_noop() {}\n\t/**\n\t * Handles clicks outside of the `Dropdown`.\n\t */\n\t_outsideClick(event) {\n\t\tif (!this.elementRef.nativeElement.contains(event.target) &&\n\t\t\t// if we're appendToBody the list isn't within the _elementRef,\n\t\t\t// so we've got to check if our target is possibly in there too.\n\t\t\t!this.dropdownMenu.nativeElement.contains(event.target)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\t_outsideKey(event) {\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\t/**\n\t * Handles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n\t */\n\t_keyboardNav(event: KeyboardEvent) {\n\t\t// \"Esc\" is an IE specific value\n\t\tif ((event.key === \"Escape\" || event.key === \"Esc\") && !this.menuIsClosed) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close modal if inside of it\n\t\t}\n\t\tif (event.key === \"Escape\" || event.key === \"Esc\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (!this.menuIsClosed && event.key === \"Tab\") {\n\t\t\t// this way focus will start on the next focusable item from the dropdown\n\t\t\t// not the top of the body!\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t\tthis.dropdownButton.nativeElement.dispatchEvent(new KeyboardEvent(\"keydown\", {bubbles: true, cancelable: true, key: \"Tab\"}));\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n\t */\n\t_appendToDropdown() {\n\t\tthis.dropdownService.appendToDropdown(this.elementRef.nativeElement);\n\t\tthis.dropdownMenu.nativeElement.removeEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list as an element that is appended to the DOM body.\n\t */\n\t_appendToBody() {\n\t\tthis.dropdownService.appendToBody(\n\t\t\tthis.dropdownButton.nativeElement,\n\t\t\tthis.dropdownMenu.nativeElement,\n\t\t\tthis.elementRef.nativeElement.className);\n\t\tthis.dropdownMenu.nativeElement.addEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Expands the dropdown menu in the view.\n\t */\n\topenMenu() {\n\t\tthis.menuIsClosed = false;\n\n\t\t// move the dropdown list to the body if we're not appending inline\n\t\t// and position it relative to the dropdown wrapper\n\t\tif (!this.appendInline) {\n\t\t\tthis.addScrollEventListener();\n\t\t\tthis._appendToBody();\n\t\t}\n\n\t\t// set the dropdown menu to drop up if it's near the bottom of the screen\n\t\t// setTimeout lets us measure after it's visible in the DOM\n\t\tsetTimeout(() => {\n\t\t\tconst menu = this.dropdownMenu.nativeElement;\n\t\t\tconst boundingClientRect = menu.getBoundingClientRect();\n\n\t\t\tif (boundingClientRect.bottom > window.innerHeight) {\n\t\t\t\t// min height of 100px\n\t\t\t\tif (window.innerHeight - boundingClientRect.top > 100) {\n\t\t\t\t\t// remove the conditional once this api is settled and part of abstract-dropdown-view.class\n\t\t\t\t\tif (this.view[\"enableScroll\"]) {\n\t\t\t\t\t\tthis.view[\"enableScroll\"]();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.dropUp = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.dropUp = false;\n\t\t\t}\n\t\t}, 0);\n\n\t\t// we bind noop to document.body.firstElementChild to allow safari to fire events\n\t\t// from document. Then we unbind everything later to keep things light.\n\t\tdocument.body.firstElementChild.addEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.addEventListener(\"keydown\", this.noop, true);\n\t\tdocument.addEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.addEventListener(\"keydown\", this.outsideKey, true);\n\t\tsetTimeout(() => this.view.initFocus(), 0);\n\t}\n\n\t/**\n\t * Collapsing the dropdown menu and removing unnecessary `EventListeners`.\n\t */\n\tcloseMenu() {\n\t\t// return early if the menu is already closed\n\t\tif (this.menuIsClosed) { return; }\n\t\tthis.menuIsClosed = true;\n\t\tthis.onClose.emit();\n\t\tthis.close.emit();\n\n\t\t// focus the trigger button when we close ...\n\t\tthis.dropdownButton.nativeElement.focus();\n\n\t\t// remove the conditional once this api is settled and part of abstract-dropdown-view.class\n\t\tif (this.view[\"disableScroll\"]) {\n\t\t\tthis.view[\"disableScroll\"]();\n\t\t}\n\n\t\t// move the list back in the component on close\n\t\tif (!this.appendInline) {\n\t\t\tthis.removeScrollEventListener();\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t\tdocument.body.firstElementChild.removeEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.removeEventListener(\"keydown\", this.noop, true);\n\t\tdocument.removeEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.removeEventListener(\"keydown\", this.outsideKey, true);\n\t}\n\n\t/**\n\t * Add scroll event listener if scrollableContainer is provided\n\t */\n\taddScrollEventListener() {\n\t\tlet scrollObservable = scrollableParentsObservable(this.elementRef.nativeElement);\n\t\tif (this.scrollableContainer) {\n\t\t\tconst container: HTMLElement = document.querySelector(this.scrollableContainer);\n\n\t\t\tif (container) {\n\t\t\t\tscrollObservable = merge(scrollObservable, fromEvent(container, \"scroll\"));\n\t\t\t}\n\t\t}\n\t\tthis.scroll = scrollObservable.subscribe(event => {\n\t\t\tif (isVisibleInContainer(this.elementRef.nativeElement, event.target as HTMLElement)) {\n\t\t\t\tthis.dropdownService.updatePosition(this.dropdownButton.nativeElement);\n\t\t\t} else {\n\t\t\t\tthis.closeMenu();\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Removes any `EventListeners` responsible for scroll functionality.\n\t */\n\tremoveScrollEventListener() {\n\t\tif (this.scroll) {\n\t\t\tthis.scroll.unsubscribe();\n\t\t}\n\t}\n\n\t/**\n\t * Controls toggling menu states between open/expanded and closed/collapsed.\n\t */\n\ttoggleMenu() {\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.openMenu();\n\t\t} else {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n"]}
1
+ {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../src/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,SAAS,EAET,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AAEzE,yEAAyE;AACzE,OAAO,EAEN,SAAS,EACT,EAAE,EAEF,KAAK,EACL,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEtF;;;;;;GAMG;AACH;IAyNC;;OAEG;IACH,kBAAsB,UAAsB,EAAY,IAAU,EAAY,eAAgC;QAAxF,eAAU,GAAV,UAAU,CAAY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AA,AAnoBD,IAmoBC;SApjBY,QAAQ","sourcesContent":["import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tContentChild,\n\tOnInit,\n\tViewChild,\n\tAfterContentInit,\n\tHostListener,\n\tOnDestroy,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\n// Observable import is required here so typescript can compile correctly\nimport {\n\tObservable,\n\tfromEvent,\n\tof,\n\tSubscription,\n\tmerge\n} from \"rxjs\";\n\nimport { AbstractDropdownView } from \"./abstract-dropdown-view.class\";\nimport { position } from \"@carbon/utils-position\";\nimport { I18n } from \"./../i18n/i18n.module\";\nimport { ListItem } from \"./list-item.interface\";\nimport { DropdownService } from \"./dropdown.service\";\nimport { scrollableParentsObservable, isVisibleInContainer } from \"./../utils/scroll\";\n\n/**\n * Drop-down lists enable users to select one or more items from a list.\n *\n * [See demo](../../?path=/story/dropdown--basic)\n *\n * <example-url>../../iframe.html?id=dropdown--basic</example-url>\n */\n@Component({\n\tselector: \"ibm-dropdown\",\n\ttemplate: `\n\t<label *ngIf=\"label\" [for]=\"id\" class=\"bx--label\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div *ngIf=\"helperText\" class=\"bx--form__helper-text\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div\n\t\t[id]=\"id\"\n\t\tclass=\"bx--dropdown bx--list-box\"\n\t\t[ngClass]=\"{\n\t\t\t'bx--dropdown--light': theme === 'light',\n\t\t\t'bx--list-box--inline': inline,\n\t\t\t'bx--skeleton': skeleton,\n\t\t\t'bx--dropdown--disabled bx--list-box--disabled': disabled\n\t\t}\">\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\t#dropdownButton\n\t\t\tclass=\"bx--list-box__field\"\n\t\t\t[ngClass]=\"{'a': !menuIsClosed}\"\n\t\t\t[attr.aria-expanded]=\"!menuIsClosed\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\t(click)=\"toggleMenu()\"\n\t\t\t(blur)=\"onBlur()\"\n\t\t\t[disabled]=\"disabled\">\n\t\t\t<div\n\t\t\t\t(click)=\"clearSelected()\"\n\t\t\t\t*ngIf=\"type === 'multi' && getSelectedCount() > 0\"\n\t\t\t\tclass=\"bx--list-box__selection--multi\"\n\t\t\t\ttitle=\"Clear all selected items\">\n\t\t\t\t{{getSelectedCount()}}\n\t\t\t\t<svg\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\trole=\"img\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\twidth=\"16\"\n\t\t\t\t\theight=\"16\"\n\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t<path d=\"M12 4.7l-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z\"></path>\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t\t<span *ngIf=\"isRenderString()\" class=\"bx--list-box__label\">{{getDisplayStringValue() | async}}</span>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"!isRenderString()\"\n\t\t\t\t[ngTemplateOutletContext]=\"getRenderTemplateContext()\"\n\t\t\t\t[ngTemplateOutlet]=\"displayValue\">\n\t\t\t</ng-template>\n\t\t\t<ibm-icon-chevron-down16\n\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\tclass=\"bx--list-box__menu-icon\"\n\t\t\t\t[attr.aria-label]=\"menuButtonLabel\"\n\t\t\t\t[ngClass]=\"{'bx--list-box__menu-icon--open': !menuIsClosed }\">\n\t\t\t</ibm-icon-chevron-down16>\n\t\t</button>\n\t\t<div\n\t\t\t#dropdownMenu\n\t\t\t[ngClass]=\"{\n\t\t\t\t'drop-up': dropUp\n\t\t\t}\">\n\t\t\t<ng-content *ngIf=\"!menuIsClosed\"></ng-content>\n\t\t</div>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Dropdown,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Dropdown implements OnInit, AfterContentInit, OnDestroy, ControlValueAccessor {\n\tstatic dropdownCount = 0;\n\t@Input() id = `dropdown-${Dropdown.dropdownCount++}`;\n\t/**\n\t * Label for the dropdown.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Value displayed if no item is selected.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * The selected value from the `Dropdown`. Can be a string or template.\n\t */\n\t@Input() displayValue: string | TemplateRef<any> = \"\";\n\t/**\n\t * Size to render the dropdown field.\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Defines whether or not the `Dropdown` supports selecting multiple items as opposed to single\n\t * item selection.\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\t/**\n\t * `light` or `dark` dropdown theme\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` to disable the dropdown.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading dropdown.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an inline dropdown.\n\t */\n\t@Input() inline = false;\n\t/**\n\t * Set to `true` for a dropdown without arrow key activation.\n\t */\n\t@Input() disableArrowKeys = false;\n\t/**\n\t * Deprecated. Dropdown now defaults to appending inline\n\t * Set to `true` if the `Dropdown` is to be appended to the DOM body.\n\t */\n\t@Input() set appendToBody (v) {\n\t\tconsole.warn(\"`appendToBody` has been deprecated. Dropdowns now append to the body by default.\");\n\t\tconsole.warn(\"Ensure you have an `ibm-placeholder` in your app.\");\n\t\tconsole.warn(\"Use `appendInline` if you need to position your dropdowns within the normal page flow.\");\n\t\tthis.appendInline = !v;\n\t}\n\n\tget appendToBody() {\n\t\treturn !this.appendInline;\n\t}\n\t/**\n\t * set to `true` to place the dropdown view inline with the component\n\t */\n\t@Input() appendInline = false;\n\t/**\n\t * Query string for the element that contains the `Dropdown`.\n\t * Used to trigger closing the dropdown if it scrolls outside of the viewport of the `scrollableContainer`.\n\t */\n\t@Input() scrollableContainer: string;\n\t/**\n\t * Specifies the property to be used as the return value to `ngModel`\n\t */\n\t@Input() value: string;\n\t/**\n\t * Accessible label for the button that opens the dropdown list.\n\t * Defaults to the `DROPDOWN.OPEN` value from the i18n service.\n\t */\n\t@Input() menuButtonLabel = this.i18n.get().DROPDOWN.OPEN;\n\t/**\n\t * Provides the label for the \"# selected\" text.\n\t * Defaults to the `DROPDOWN.SELECTED` value from the i18n service.\n\t */\n\t@Input() selectedLabel = this.i18n.get().DROPDOWN.SELECTED;\n\t/**\n\t * Emits selection events.\n\t */\n\t@Output() selected: EventEmitter<Object> = new EventEmitter<Object>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter<any>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() close: EventEmitter<any> = new EventEmitter<any>();\n\n\t/**\n\t * Maintains a reference to the `AbstractDropdownView` object within the content DOM.\n\t */\n\t@ContentChild(AbstractDropdownView) view: AbstractDropdownView;\n\t/**\n\t * Maintains a reference to the view DOM element of the `Dropdown` button.\n\t */\n\t@ViewChild(\"dropdownButton\") dropdownButton;\n\t/**\n\t * ViewChid of the dropdown view.\n\t */\n\t@ViewChild(\"dropdownMenu\") dropdownMenu;\n\n\t@HostBinding(\"class.bx--dropdown__wrapper\") hostClass = true;\n\t/**\n\t * Set to `true` if the dropdown is closed (not expanded).\n\t */\n\tmenuIsClosed = true;\n\n\t/**\n\t * controls wether the `drop-up` class is applied\n\t */\n\tdropUp = false;\n\n\t// .bind creates a new function, so we declare the methods below\n\t// but .bind them up here\n\tnoop = this._noop.bind(this);\n\toutsideClick = this._outsideClick.bind(this);\n\toutsideKey = this._outsideKey.bind(this);\n\tkeyboardNav = this._keyboardNav.bind(this);\n\t/**\n\t * Maintians an Event Observable Subscription for tracking scrolling within the open `Dropdown` list.\n\t */\n\tscroll: Subscription;\n\n\tprotected onTouchedCallback: () => void = this._noop;\n\n\t// primarily used to capture and propagate input to `writeValue` before the content is available\n\tprotected writtenValue = [];\n\n\t/**\n\t * Creates an instance of Dropdown.\n\t */\n\tconstructor(protected elementRef: ElementRef, protected i18n: I18n, protected dropdownService: DropdownService) {}\n\n\t/**\n\t * Updates the `type` property in the `@ContentChild`.\n\t * The `type` property specifies whether the `Dropdown` allows single selection or multi selection.\n\t */\n\tngOnInit() {\n\t\tif (this.view) {\n\t\t\tthis.view.type = this.type;\n\t\t}\n\t}\n\n\t/**\n\t * Initializes classes and subscribes to events for single or multi selection.\n\t */\n\tngAfterContentInit() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tthis.writeValue(this.writtenValue);\n\t\tthis.view.type = this.type;\n\t\tthis.view.size = this.size;\n\t\tthis.view.select.subscribe(event => {\n\t\t\tif (this.type === \"multi\") {\n\t\t\t\t// if we have a `value` selector and selected items map them approperiatly\n\t\t\t\tif (this.value && this.view.getSelected()) {\n\t\t\t\t\tconst values = this.view.getSelected().map(item => item[this.value]);\n\t\t\t\t\tthis.propagateChange(values);\n\t\t\t\t// otherwise just pass up the values from `getSelected`\n\t\t\t\t} else {\n\t\t\t\t\tthis.propagateChange(this.view.getSelected());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.closeMenu();\n\t\t\t\tif (event.item && event.item.selected) {\n\t\t\t\t\tif (this.value) {\n\t\t\t\t\t\tthis.propagateChange(event.item[this.value]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.propagateChange(event.item);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.propagateChange(null);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// only emit selected for \"organic\" selections\n\t\t\tif (event && !event.isUpdate) {\n\t\t\t\tthis.selected.emit(event);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Removing the `Dropdown` from the body if it is appended to the body.\n\t */\n\tngOnDestroy() {\n\t\tif (this.appendToBody) {\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Propagates the injected `value`.\n\t */\n\twriteValue(value: any) {\n\t\t// cache the written value so we can use it in `AfterContentInit`\n\t\tthis.writtenValue = value;\n\t\t// propagate null/falsey as an array (deselect everything)\n\t\tif (!value) {\n\t\t\tthis.view.propagateSelected([value]);\n\t\t} else if (this.type === \"single\") {\n\t\t\tif (this.value) {\n\t\t\t\t// clone the specified item and update its state\n\t\t\t\tconst newValue = Object.assign({}, this.view.getListItems().find(item => item[this.value] === value));\n\t\t\t\tnewValue.selected = true;\n\t\t\t\tthis.view.propagateSelected([newValue]);\n\t\t\t} else {\n\t\t\t\t// pass the singular value as an array of ListItem\n\t\t\t\tthis.view.propagateSelected([value]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.value) {\n\t\t\t\t// clone the items and update their state based on the received value array\n\t\t\t\t// this way we don't lose any additional metadata that may be passed in via the `items` Input\n\t\t\t\tlet newValues = [];\n\t\t\t\tfor (const v of value) {\n\t\t\t\t\tfor (const item of this.view.getListItems()) {\n\t\t\t\t\t\tif (item[this.value] === v) {\n\t\t\t\t\t\t\tnewValues.push(Object.assign({}, item, { selected: true }));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.view.propagateSelected(newValues);\n\t\t\t} else {\n\t\t\t\t// we can safely assume we're passing an array of `ListItem`s\n\t\t\t\tthis.view.propagateSelected(value);\n\t\t\t}\n\t\t}\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registering the function injected to control the touch use of the `Dropdown`.\n\t */\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\n\t/**\n\t * function passed in by `registerOnChange`\n\t */\n\tpropagateChange = (_: any) => {};\n\n\t/**\n\t * `ControlValueAccessor` method to programatically disable the dropdown.\n\t *\n\t * ex: `this.formGroup.get(\"myDropdown\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Adds keyboard functionality for navigation, selection and closing of the `Dropdown`.\n\t */\n\t@HostListener(\"keydown\", [\"$event\"])\n\t// \"Esc\", \"Spacebar\", \"Down\", and \"Up\" are IE specific values\n\tonKeyDown(event: KeyboardEvent) {\n\t\tif ((event.key === \"Escape\" || event.key === \"Esc\") && !this.menuIsClosed) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close other widgets that listen for Escape\n\t\t}\n\t\tif (event.key === \"Escape\" || event.key === \"Esc\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (this.menuIsClosed && (event.key === \" \" || event.key === \"ArrowDown\" || event.key === \"ArrowUp\" ||\n\t\t\tevent.key === \"Spacebar\" || event.key === \"Down\" || event.key === \"Up\")) {\n\t\t\tif (this.disableArrowKeys && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\" || event.key === \"Down\" || event.key === \"Up\")) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tthis.openMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && event.shiftKey) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (this.type === \"multi\") { return; }\n\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.closedDropdownNavigation(event);\n\t\t}\n\t}\n\n\tclosedDropdownNavigation(event) {\n\t\t// \"Down\", and \"Up\" are IE specific values\n\t\tif (event.key === \"ArrowDown\" || event.key === \"Down\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getNextItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t} else if (event.key === \"ArrowUp\" || event.key === \"Up\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getPrevItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t}\n\t}\n\n\t/**\n\t * Returns the display value if there is a selection and displayValue is set,\n\t * if there is just a selection the ListItem content property will be returned,\n\t * otherwise the placeholder will be returned.\n\t */\n\tgetDisplayStringValue(): Observable<string> {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (selected && (!this.displayValue || !this.isRenderString())) {\n\t\t\tif (this.type === \"multi\") {\n\t\t\t\treturn of(this.placeholder);\n\t\t\t} else {\n\t\t\t\treturn of(selected[0].content);\n\t\t\t}\n\t\t} else if (selected && this.isRenderString()) {\n\t\t\treturn of(this.displayValue as string);\n\t\t}\n\t\treturn of(this.placeholder);\n\t}\n\n\tisRenderString(): boolean {\n\t\treturn typeof this.displayValue === \"string\";\n\t}\n\n\tgetRenderTemplateContext() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (this.type === \"multi\") {\n\t\t\treturn {items: selected};\n\t\t} else if (selected && selected.length > 0) {\n\t\t\treturn {item: selected[0]}; // this is to be compatible with the dropdown-list template\n\t\t} else {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tgetSelectedCount(): number {\n\t\tif (this.view.getSelected()) {\n\t\t\treturn this.view.getSelected().length;\n\t\t}\n\t}\n\n\tclearSelected() {\n\t\tif (this.disabled) { return; }\n\t\tfor (const item of this.view.getListItems()) {\n\t\t\titem.selected = false;\n\t\t}\n\t\tthis.selected.emit([]);\n\t\tthis.propagateChange([]);\n\t}\n\n\t/**\n\t * Returns `true` if there is a value selected.\n\t */\n\tvalueSelected(): boolean {\n\t\tif (this.view.getSelected()) { return true; }\n\t\treturn false;\n\t}\n\n\t_noop() {}\n\t/**\n\t * Handles clicks outside of the `Dropdown`.\n\t */\n\t_outsideClick(event) {\n\t\tif (!this.elementRef.nativeElement.contains(event.target) &&\n\t\t\t// if we're appendToBody the list isn't within the _elementRef,\n\t\t\t// so we've got to check if our target is possibly in there too.\n\t\t\t!this.dropdownMenu.nativeElement.contains(event.target)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\t_outsideKey(event) {\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\t/**\n\t * Handles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n\t */\n\t_keyboardNav(event: KeyboardEvent) {\n\t\t// \"Esc\" is an IE specific value\n\t\tif ((event.key === \"Escape\" || event.key === \"Esc\") && !this.menuIsClosed) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close modal if inside of it\n\t\t}\n\t\tif (event.key === \"Escape\" || event.key === \"Esc\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (!this.menuIsClosed && event.key === \"Tab\") {\n\t\t\t// this way focus will start on the next focusable item from the dropdown\n\t\t\t// not the top of the body!\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t\tthis.dropdownButton.nativeElement.dispatchEvent(new KeyboardEvent(\"keydown\", {bubbles: true, cancelable: true, key: \"Tab\"}));\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n\t */\n\t_appendToDropdown() {\n\t\tthis.dropdownService.appendToDropdown(this.elementRef.nativeElement);\n\t\tthis.dropdownMenu.nativeElement.removeEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list as an element that is appended to the DOM body.\n\t */\n\t_appendToBody() {\n\t\tthis.dropdownService.appendToBody(\n\t\t\tthis.dropdownButton.nativeElement,\n\t\t\tthis.dropdownMenu.nativeElement,\n\t\t\tthis.elementRef.nativeElement.className);\n\t\tthis.dropdownMenu.nativeElement.addEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Expands the dropdown menu in the view.\n\t */\n\topenMenu() {\n\t\t// prevents the dropdown from opening when list of items is empty\n\t\tif (this.view.getListItems().length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.menuIsClosed = false;\n\n\t\t// move the dropdown list to the body if we're not appending inline\n\t\t// and position it relative to the dropdown wrapper\n\t\tif (!this.appendInline) {\n\t\t\tthis.addScrollEventListener();\n\t\t\tthis._appendToBody();\n\t\t}\n\n\t\t// set the dropdown menu to drop up if it's near the bottom of the screen\n\t\t// setTimeout lets us measure after it's visible in the DOM\n\t\tsetTimeout(() => {\n\t\t\tconst menu = this.dropdownMenu.nativeElement;\n\t\t\tconst boundingClientRect = menu.getBoundingClientRect();\n\n\t\t\tif (boundingClientRect.bottom > window.innerHeight) {\n\t\t\t\t// min height of 100px\n\t\t\t\tif (window.innerHeight - boundingClientRect.top > 100) {\n\t\t\t\t\t// remove the conditional once this api is settled and part of abstract-dropdown-view.class\n\t\t\t\t\tif (this.view[\"enableScroll\"]) {\n\t\t\t\t\t\tthis.view[\"enableScroll\"]();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.dropUp = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.dropUp = false;\n\t\t\t}\n\t\t}, 0);\n\n\t\t// we bind noop to document.body.firstElementChild to allow safari to fire events\n\t\t// from document. Then we unbind everything later to keep things light.\n\t\tdocument.body.firstElementChild.addEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.addEventListener(\"keydown\", this.noop, true);\n\t\tdocument.addEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.addEventListener(\"keydown\", this.outsideKey, true);\n\t\tsetTimeout(() => this.view.initFocus(), 0);\n\t}\n\n\t/**\n\t * Collapsing the dropdown menu and removing unnecessary `EventListeners`.\n\t */\n\tcloseMenu() {\n\t\t// return early if the menu is already closed\n\t\tif (this.menuIsClosed) { return; }\n\t\tthis.menuIsClosed = true;\n\t\tthis.onClose.emit();\n\t\tthis.close.emit();\n\n\t\t// focus the trigger button when we close ...\n\t\tthis.dropdownButton.nativeElement.focus();\n\n\t\t// remove the conditional once this api is settled and part of abstract-dropdown-view.class\n\t\tif (this.view[\"disableScroll\"]) {\n\t\t\tthis.view[\"disableScroll\"]();\n\t\t}\n\n\t\t// move the list back in the component on close\n\t\tif (!this.appendInline) {\n\t\t\tthis.removeScrollEventListener();\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t\tdocument.body.firstElementChild.removeEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.removeEventListener(\"keydown\", this.noop, true);\n\t\tdocument.removeEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.removeEventListener(\"keydown\", this.outsideKey, true);\n\t}\n\n\t/**\n\t * Add scroll event listener if scrollableContainer is provided\n\t */\n\taddScrollEventListener() {\n\t\tlet scrollObservable = scrollableParentsObservable(this.elementRef.nativeElement);\n\t\tif (this.scrollableContainer) {\n\t\t\tconst container: HTMLElement = document.querySelector(this.scrollableContainer);\n\n\t\t\tif (container) {\n\t\t\t\tscrollObservable = merge(scrollObservable, fromEvent(container, \"scroll\"));\n\t\t\t}\n\t\t}\n\t\tthis.scroll = scrollObservable.subscribe(event => {\n\t\t\tif (isVisibleInContainer(this.elementRef.nativeElement, event.target as HTMLElement)) {\n\t\t\t\tthis.dropdownService.updatePosition(this.dropdownButton.nativeElement);\n\t\t\t} else {\n\t\t\t\tthis.closeMenu();\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Removes any `EventListeners` responsible for scroll functionality.\n\t */\n\tremoveScrollEventListener() {\n\t\tif (this.scroll) {\n\t\t\tthis.scroll.unsubscribe();\n\t\t}\n\t}\n\n\t/**\n\t * Controls toggling menu states between open/expanded and closed/collapsed.\n\t */\n\ttoggleMenu() {\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.openMenu();\n\t\t} else {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n"]}
@@ -22,4 +22,6 @@ export interface FileItem {
22
22
  file: File;
23
23
  state: "edit" | "upload" | "complete";
24
24
  uploaded: boolean;
25
+ invalid: boolean;
26
+ invalidText: string;
25
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file-item.interface.js","sourceRoot":"","sources":["../src/file-uploader/file-item.interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface FileItem {\n\tfile: File;\n\tstate: \"edit\" | \"upload\" | \"complete\";\n\tuploaded: boolean;\n}\n"]}
1
+ {"version":3,"file":"file-item.interface.js","sourceRoot":"","sources":["../src/file-uploader/file-item.interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface FileItem {\n\tfile: File;\n\tstate: \"edit\" | \"upload\" | \"complete\";\n\tuploaded: boolean;\n\tinvalid: boolean;\n\tinvalidText: string;\n}\n"]}
@@ -104,6 +104,8 @@ var FileUploader = /** @class */ (function () {
104
104
  var fileItem = {
105
105
  uploaded: false,
106
106
  state: "edit",
107
+ invalid: false,
108
+ invalidText: "",
107
109
  file: file
108
110
  };
109
111
  this.files.add(fileItem);
@@ -135,7 +137,7 @@ var FileUploader = /** @class */ (function () {
135
137
  FileUploader.decorators = [
136
138
  { type: Component, args: [{
137
139
  selector: "ibm-file-uploader",
138
- template: "\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<ibm-file *ngFor=\"let fileItem of files\" [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t",
140
+ template: "\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<div *ngFor=\"let fileItem of files\">\n\t\t\t\t\t\t<ibm-file [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t\t\t<div *ngIf=\"fileItem.invalid\" class=\"bx--form-requirement\">\n\t\t\t\t\t\t\t{{fileItem.invalidText}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t",
139
141
  providers: [
140
142
  {
141
143
  provide: NG_VALUE_ACCESSOR,
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.component.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,YAAY,EAEZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,E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AAS,SAAC;oBACV,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,ipCAgCT;oBACD,SAAS,EAAE;wBACV;4BACC,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,YAAY;4BACzB,KAAK,EAAE,IAAI;yBACX;qBACD;iBACD;;;;gBApDQ,IAAI;;;6BA+DX,KAAK;wBAIL,KAAK;8BAIL,KAAK;yBAIL,KAAK;2BAML,KAAK;2BAIL,KAAK;uBAML,KAAK;iCAIL,KAAK;4BAIL,SAAS,SAAC,WAAW;wBAIrB,KAAK;8BACL,MAAM;;IA+ER,mBAAC;CAAA,AA7KD,IA6KC;SAlIY,YAAY","sourcesContent":["import {\n\tComponent,\n\tInput,\n\tOutput,\n\tViewChild,\n\tEventEmitter,\n\tOnInit\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"../i18n/i18n.module\";\nimport { FileItem } from \"./file-item.interface\";\n\nconst noop = () => {};\n\n/**\n * [See demo](../../?path=/story/file-uploader--basic)\n *\n * <example-url>../../iframe.html?id=file-uploader--basic</example-url>\n */\n@Component({\n\tselector: \"ibm-file-uploader\",\n\ttemplate: `\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<ibm-file *ngFor=\"let fileItem of files\" [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: FileUploader,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class FileUploader implements OnInit {\n\t/**\n\t * Counter used to create unique ids for file-uploader components\n\t */\n\tstatic fileUploaderCount = 0;\n\t/**\n\t * Accessible text for the button that opens the upload window.\n\t *\n\t * Defaults to the `FILE_UPLOADER.OPEN` value from the i18n service\n\t */\n\t@Input() buttonText = this.i18n.get().FILE_UPLOADER.OPEN;\n\t/**\n\t * Text set to the title\n\t */\n\t@Input() title: string;\n\t/**\n\t * Text set to the description\n\t */\n\t@Input() description: string;\n\t/**\n\t * Specify the types of files that the input should be able to receive\n\t */\n\t@Input() accept = [];\n\t/**\n\t * Set to `false` to tell the component to only accept a single file on upload.\n\t *\n\t * Defaults to `true`. Accepts multiple files.\n\t */\n\t@Input() multiple = true;\n\t/**\n\t * Set to `true` for a loading file uploader.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Sets the size of the button.\n\t *\n\t * @type {(\"sm\" | \"normal\")}\n\t */\n\t@Input() size: \"sm\" | \"normal\";\n\t/**\n\t * Provides a unique id for the underlying <input> node\n\t */\n\t@Input() fileUploaderId = `file-uploader-${FileUploader.fileUploaderCount}`;\n\t/**\n\t * Maintains a reference to the view DOM element of the underlying <input> node\n\t */\n\t@ViewChild(\"fileInput\") fileInput;\n\t/**\n\t * The list of files that have been submitted to be uploaded\n\t */\n\t@Input() files: Set<FileItem>;\n\t@Output() filesChange = new EventEmitter<any>();\n\n\tprotected onTouchedCallback: () => void = noop;\n\tprotected onChangeCallback: (_: Set<FileItem>) => void = noop;\n\n\tconstructor(protected i18n: I18n) {\n\t\tFileUploader.fileUploaderCount++;\n\t}\n\n\t/**\n\t * Specifies the property to be used as the return value to `ngModel`\n\t */\n\tget value(): Set<FileItem> {\n\t\treturn this.files;\n\t}\n\tset value(v: Set<FileItem>) {\n\t\tif (v !== this.files) {\n\t\t\tthis.files = v;\n\t\t\tthis.onChangeCallback(v);\n\t\t}\n\t}\n\n\tngOnInit() {\n\t\t// overrides the undefined files value set by the user\n\t\tif (!this.files) {\n\t\t\tthis.files = new Set();\n\t\t\tthis.filesChange.emit(this.files);\n\t\t}\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\t/**\n\t * Propagates the injected `value`.\n\t */\n\twriteValue(value: Set<FileItem>) {\n\t\tif (value !== this.value) {\n\t\t\tthis.files = value;\n\t\t}\n\t}\n\n\tonFilesAdded() {\n\t\tconst files = this.fileInput.nativeElement.files;\n\t\tif (!this.multiple) {\n\t\t\tthis.files.clear();\n\t\t}\n\t\tfor (let file of files) {\n\t\t\tconst fileItem: FileItem = {\n\t\t\t\tuploaded: false,\n\t\t\t\tstate: \"edit\",\n\t\t\t\tfile: file\n\t\t\t};\n\t\t\tthis.files.add(fileItem);\n\t\t\tthis.filesChange.emit(this.files);\n\t\t}\n\n\t\tthis.value = this.files;\n\t}\n\n\tremoveFile(fileItem) {\n\t\tthis.files.delete(fileItem);\n\t\tthis.fileInput.nativeElement.value = \"\";\n\t\tthis.filesChange.emit(this.files);\n\t}\n\n\t/**\n\t * Registers the injected function to control the touch use of the `FileUploader`.\n\t */\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tregisterOnChange(fn: any) {\n\t\tthis.onChangeCallback = fn;\n\t}\n}\n"]}
1
+ {"version":3,"file":"file-uploader.component.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,YAAY,EAEZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C,IAAM,IAAI,GAAG,cAAO,CAAC,CAAC;;AAEtB;;;;GAIG;AACH;IAwGC,sBAAsB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAnDhC;;;;WAIG;QACM,eAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;QASzD;;WAEG;QACM,WAAM,GAAG,EAAE,CAAC;QACrB;;;;WAIG;QACM,aAAQ,GAAG,IAAI,CAAC;QACzB;;WAEG;QACM,aAAQ,GAAG,KAAK,CAAC;QAO1B;;WAEG;QACM,mBAAc,GAAG,mBAAiB,YAAY,CAAC,iBAAmB,CAAC;QASlE,gBAAW,GAAG,IAAI,YAAY,EAAO,CAAC;QAEtC,sBAAiB,GAAe,IAAI,CAAC;QACrC,qBAAgB,GAA+B,IAAI,CAAC;QAG7D,YAAY,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAKD,sBAAI,+BAAK;QAHT;;WAEG;aACH;YACC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;aACD,UAAU,CAAgB;YACzB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE;gBACrB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBACf,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;aACzB;QACF,CAAC;;;OANA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CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,wCAAiB,GAAjB,UAAkB,EAAO;QACxB,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;IAC7B,CAAC;IACD;;OAEG;IACH,uCAAgB,GAAhB,UAAiB,EAAO;QACvB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC5B,CAAC;IAlID;;OAEG;IACI,8BAAiB,GAAG,CAAC,CAAC;;gBApD7B,SAAS,SAAC;oBACV,QAAQ,EAAE,mBAAmB;oBAC7B,QAAQ,EAAE,+zCAqCT;oBACD,SAAS,EAAE;wBACV;4BACC,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,YAAY;4BACzB,KAAK,EAAE,IAAI;yBACX;qBACD;iBACD;;;;gBAzDQ,IAAI;;;6BAoEX,KAAK;wBAIL,KAAK;8BAIL,KAAK;yBAIL,KAAK;2BAML,KAAK;2BAIL,KAAK;uBAML,KAAK;iCAIL,KAAK;4BAIL,SAAS,SAAC,WAAW;wBAIrB,KAAK;8BACL,MAAM;;IAiFR,mBAAC;CAAA,AApLD,IAoLC;SApIY,YAAY","sourcesContent":["import {\n\tComponent,\n\tInput,\n\tOutput,\n\tViewChild,\n\tEventEmitter,\n\tOnInit\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"../i18n/i18n.module\";\nimport { FileItem } from \"./file-item.interface\";\n\nconst noop = () => {};\n\n/**\n * [See demo](../../?path=/story/file-uploader--basic)\n *\n * <example-url>../../iframe.html?id=file-uploader--basic</example-url>\n */\n@Component({\n\tselector: \"ibm-file-uploader\",\n\ttemplate: `\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<div *ngFor=\"let fileItem of files\">\n\t\t\t\t\t\t<ibm-file [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t\t\t<div *ngIf=\"fileItem.invalid\" class=\"bx--form-requirement\">\n\t\t\t\t\t\t\t{{fileItem.invalidText}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: FileUploader,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class FileUploader implements OnInit {\n\t/**\n\t * Counter used to create unique ids for file-uploader components\n\t */\n\tstatic fileUploaderCount = 0;\n\t/**\n\t * Accessible text for the button that opens the upload window.\n\t *\n\t * Defaults to the `FILE_UPLOADER.OPEN` value from the i18n service\n\t */\n\t@Input() buttonText = this.i18n.get().FILE_UPLOADER.OPEN;\n\t/**\n\t * Text set to the title\n\t */\n\t@Input() title: string;\n\t/**\n\t * Text set to the description\n\t */\n\t@Input() description: string;\n\t/**\n\t * Specify the types of files that the input should be able to receive\n\t */\n\t@Input() accept = [];\n\t/**\n\t * Set to `false` to tell the component to only accept a single file on upload.\n\t *\n\t * Defaults to `true`. Accepts multiple files.\n\t */\n\t@Input() multiple = true;\n\t/**\n\t * Set to `true` for a loading file uploader.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Sets the size of the button.\n\t *\n\t * @type {(\"sm\" | \"normal\")}\n\t */\n\t@Input() size: \"sm\" | \"normal\";\n\t/**\n\t * Provides a unique id for the underlying <input> node\n\t */\n\t@Input() fileUploaderId = `file-uploader-${FileUploader.fileUploaderCount}`;\n\t/**\n\t * Maintains a reference to the view DOM element of the underlying <input> node\n\t */\n\t@ViewChild(\"fileInput\") fileInput;\n\t/**\n\t * The list of files that have been submitted to be uploaded\n\t */\n\t@Input() files: Set<FileItem>;\n\t@Output() filesChange = new EventEmitter<any>();\n\n\tprotected onTouchedCallback: () => void = noop;\n\tprotected onChangeCallback: (_: Set<FileItem>) => void = noop;\n\n\tconstructor(protected i18n: I18n) {\n\t\tFileUploader.fileUploaderCount++;\n\t}\n\n\t/**\n\t * Specifies the property to be used as the return value to `ngModel`\n\t */\n\tget value(): Set<FileItem> {\n\t\treturn this.files;\n\t}\n\tset value(v: Set<FileItem>) {\n\t\tif (v !== this.files) {\n\t\t\tthis.files = v;\n\t\t\tthis.onChangeCallback(v);\n\t\t}\n\t}\n\n\tngOnInit() {\n\t\t// overrides the undefined files value set by the user\n\t\tif (!this.files) {\n\t\t\tthis.files = new Set();\n\t\t\tthis.filesChange.emit(this.files);\n\t\t}\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\t/**\n\t * Propagates the injected `value`.\n\t */\n\twriteValue(value: Set<FileItem>) {\n\t\tif (value !== this.value) {\n\t\t\tthis.files = value;\n\t\t}\n\t}\n\n\tonFilesAdded() {\n\t\tconst files = this.fileInput.nativeElement.files;\n\t\tif (!this.multiple) {\n\t\t\tthis.files.clear();\n\t\t}\n\t\tfor (let file of files) {\n\t\t\tconst fileItem: FileItem = {\n\t\t\t\tuploaded: false,\n\t\t\t\tstate: \"edit\",\n\t\t\t\tinvalid: false,\n\t\t\t\tinvalidText: \"\",\n\t\t\t\tfile: file\n\t\t\t};\n\t\t\tthis.files.add(fileItem);\n\t\t\tthis.filesChange.emit(this.files);\n\t\t}\n\n\t\tthis.value = this.files;\n\t}\n\n\tremoveFile(fileItem) {\n\t\tthis.files.delete(fileItem);\n\t\tthis.fileInput.nativeElement.value = \"\";\n\t\tthis.filesChange.emit(this.files);\n\t}\n\n\t/**\n\t * Registers the injected function to control the touch use of the `FileUploader`.\n\t */\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tregisterOnChange(fn: any) {\n\t\tthis.onChangeCallback = fn;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ɵ0":{"__symbolic":"error","message":"Lambda not supported","line":13,"character":13},"FileUploader":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":20,"character":1},"arguments":[{"selector":"ibm-file-uploader","template":"\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<ibm-file *ngFor=\"let fileItem of files\" [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":57,"character":12},"useExisting":{"__symbolic":"reference","name":"FileUploader"},"multi":true}]}]}],"members":{"buttonText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":2}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":77,"character":2}}]}],"description":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":81,"character":2}}]}],"accept":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":2}}]}],"multiple":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":2}}]}],"skeleton":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":2}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":101,"character":2}}]}],"fileUploaderId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":105,"character":2}}]}],"fileInput":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":109,"character":2},"arguments":["fileInput"]}]}],"files":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":113,"character":2}}]}],"filesChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":114,"character":2}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../i18n/i18n.module","name":"I18n","line":119,"character":29}]}],"ngOnInit":[{"__symbolic":"method"}],"onBlur":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onFilesAdded":[{"__symbolic":"method"}],"removeFile":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}]},"statics":{"fileUploaderCount":0}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ɵ0":{"__symbolic":"error","message":"Lambda not supported","line":13,"character":13},"FileUploader":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":20,"character":1},"arguments":[{"selector":"ibm-file-uploader","template":"\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<div *ngFor=\"let fileItem of files\">\n\t\t\t\t\t\t<ibm-file [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t\t\t<div *ngIf=\"fileItem.invalid\" class=\"bx--form-requirement\">\n\t\t\t\t\t\t\t{{fileItem.invalidText}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":62,"character":12},"useExisting":{"__symbolic":"reference","name":"FileUploader"},"multi":true}]}]}],"members":{"buttonText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":78,"character":2}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":2}}]}],"description":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":86,"character":2}}]}],"accept":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":2}}]}],"multiple":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":96,"character":2}}]}],"skeleton":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":100,"character":2}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":106,"character":2}}]}],"fileUploaderId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":110,"character":2}}]}],"fileInput":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":114,"character":2},"arguments":["fileInput"]}]}],"files":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":2}}]}],"filesChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":119,"character":2}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../i18n/i18n.module","name":"I18n","line":124,"character":29}]}],"ngOnInit":[{"__symbolic":"method"}],"onBlur":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onFilesAdded":[{"__symbolic":"method"}],"removeFile":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}]},"statics":{"fileUploaderCount":0}}}}]
@@ -28,26 +28,27 @@ import * as i0 from "@angular/core";
28
28
  import * as i1 from "./file.component.ngfactory";
29
29
  import * as i2 from "./file.component";
30
30
  import * as i3 from "../i18n/i18n.service";
31
- import * as i4 from "../button/button.directive";
32
- import * as i5 from "@angular/common";
31
+ import * as i4 from "@angular/common";
32
+ import * as i5 from "../button/button.directive";
33
33
  import * as i6 from "@angular/forms";
34
34
  import * as i7 from "./file-uploader.component";
35
35
  var styles_FileUploader = [];
36
36
  var RenderType_FileUploader = i0.ɵcrt({ encapsulation: 2, styles: styles_FileUploader, data: {} });
37
37
  export { RenderType_FileUploader as RenderType_FileUploader };
38
- function View_FileUploader_2(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "ibm-file", [], [[2, "bx--file__selected-file", null]], [[null, "remove"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if (("remove" === en)) {
38
+ function View_FileUploader_3(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "div", [["class", "bx--form-requirement"]], null, null, null, null, null)), (_l()(), i0.ɵted(1, null, [" ", " "]))], null, function (_ck, _v) { var currVal_0 = _v.parent.context.$implicit.invalidText; _ck(_v, 1, 0, currVal_0); }); }
39
+ function View_FileUploader_2(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 4, "div", [], null, null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 1, "ibm-file", [], [[2, "bx--file__selected-file", null], [2, "bx--file__selected-file--invalid", null]], [[null, "remove"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if (("remove" === en)) {
39
40
  var pd_0 = (_co.removeFile(_v.context.$implicit) !== false);
40
41
  ad = (pd_0 && ad);
41
- } return ad; }, i1.View_File_0, i1.RenderType_File)), i0.ɵdid(1, 49152, null, 0, i2.File, [i3.I18n], { fileItem: [0, "fileItem"] }, { remove: "remove" })], function (_ck, _v) { var currVal_1 = _v.context.$implicit; _ck(_v, 1, 0, currVal_1); }, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 1).selectedFile; _ck(_v, 0, 0, currVal_0); }); }
42
+ } return ad; }, i1.View_File_0, i1.RenderType_File)), i0.ɵdid(2, 49152, null, 0, i2.File, [i3.I18n], { fileItem: [0, "fileItem"] }, { remove: "remove" }), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_FileUploader_3)), i0.ɵdid(4, 16384, null, 0, i4.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"] }, null)], function (_ck, _v) { var currVal_2 = _v.context.$implicit; _ck(_v, 2, 0, currVal_2); var currVal_3 = _v.context.$implicit.invalid; _ck(_v, 4, 0, currVal_3); }, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 2).selectedFile; var currVal_1 = i0.ɵnov(_v, 2).isInvalidText; _ck(_v, 1, 0, currVal_0, currVal_1); }); }
42
43
  function View_FileUploader_1(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 12, null, null, null, null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 1, "strong", [["class", "bx--file--label"]], null, null, null, null, null)), (_l()(), i0.ɵted(2, null, ["", ""])), (_l()(), i0.ɵeld(3, 0, null, null, 1, "p", [["class", "bx--label-description"]], null, null, null, null, null)), (_l()(), i0.ɵted(4, null, ["", ""])), (_l()(), i0.ɵeld(5, 0, null, null, 7, "div", [["class", "bx--file"]], null, null, null, null, null)), (_l()(), i0.ɵeld(6, 0, null, null, 2, "button", [["ibmButton", "primary"]], [[1, "for", 0], [2, "bx--btn", null], [2, "bx--btn--primary", null], [2, "bx--btn--secondary", null], [2, "bx--btn--tertiary", null], [2, "bx--btn--ghost", null], [2, "bx--btn--danger", null], [2, "bx--btn--danger--primary", null], [2, "bx--skeleton", null], [2, "bx--btn--sm", null], [2, "bx--toolbar-action", null], [2, "bx--overflow-menu", null]], [[null, "click"]], function (_v, en, $event) { var ad = true; if (("click" === en)) {
43
44
  var pd_0 = (i0.ɵnov(_v, 9).click() !== false);
44
45
  ad = (pd_0 && ad);
45
- } return ad; }, null, null)), i0.ɵdid(7, 16384, null, 0, i4.Button, [], { ibmButton: [0, "ibmButton"], size: [1, "size"] }, null), (_l()(), i0.ɵted(8, null, [" ", " "])), (_l()(), i0.ɵeld(9, 0, [[1, 0], ["fileInput", 1]], null, 0, "input", [["class", "bx--file-input"], ["tabindex", "-1"], ["type", "file"]], [[8, "accept", 0], [8, "id", 0], [8, "multiple", 0]], [[null, "change"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if (("change" === en)) {
46
+ } return ad; }, null, null)), i0.ɵdid(7, 16384, null, 0, i5.Button, [], { ibmButton: [0, "ibmButton"], size: [1, "size"] }, null), (_l()(), i0.ɵted(8, null, [" ", " "])), (_l()(), i0.ɵeld(9, 0, [[1, 0], ["fileInput", 1]], null, 0, "input", [["class", "bx--file-input"], ["tabindex", "-1"], ["type", "file"]], [[8, "accept", 0], [8, "id", 0], [8, "multiple", 0]], [[null, "change"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if (("change" === en)) {
46
47
  var pd_0 = (_co.onFilesAdded() !== false);
47
48
  ad = (pd_0 && ad);
48
- } return ad; }, null, null)), (_l()(), i0.ɵeld(10, 0, null, null, 2, "div", [["class", "bx--file-container"]], null, null, null, null, null)), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_FileUploader_2)), i0.ɵdid(12, 278528, null, 0, i5.NgForOf, [i0.ViewContainerRef, i0.TemplateRef, i0.IterableDiffers], { ngForOf: [0, "ngForOf"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_14 = "primary"; var currVal_15 = _co.size; _ck(_v, 7, 0, currVal_14, currVal_15); var currVal_20 = _co.files; _ck(_v, 12, 0, currVal_20); }, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.title; _ck(_v, 2, 0, currVal_0); var currVal_1 = _co.description; _ck(_v, 4, 0, currVal_1); var currVal_2 = _co.fileUploaderId; var currVal_3 = i0.ɵnov(_v, 7).baseClass; var currVal_4 = i0.ɵnov(_v, 7).primaryButton; var currVal_5 = i0.ɵnov(_v, 7).secondaryButton; var currVal_6 = i0.ɵnov(_v, 7).tertiaryButton; var currVal_7 = i0.ɵnov(_v, 7).ghostButton; var currVal_8 = i0.ɵnov(_v, 7).dangerButton; var currVal_9 = i0.ɵnov(_v, 7).dangerPrimaryButton; var currVal_10 = i0.ɵnov(_v, 7).skeleton; var currVal_11 = i0.ɵnov(_v, 7).smallSize; var currVal_12 = i0.ɵnov(_v, 7).toolbarAction; var currVal_13 = i0.ɵnov(_v, 7).overflowMenu; _ck(_v, 6, 1, [currVal_2, currVal_3, currVal_4, currVal_5, currVal_6, currVal_7, currVal_8, currVal_9, currVal_10, currVal_11, currVal_12, currVal_13]); var currVal_16 = _co.buttonText; _ck(_v, 8, 0, currVal_16); var currVal_17 = _co.accept; var currVal_18 = _co.fileUploaderId; var currVal_19 = _co.multiple; _ck(_v, 9, 0, currVal_17, currVal_18, currVal_19); }); }
49
- function View_FileUploader_3(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 0, "div", [["class", "bx--skeleton__text"], ["style", "width: 100px"]], null, null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 0, "div", [["class", "bx--skeleton__text"], ["style", "width: 225px"]], null, null, null, null, null)), (_l()(), i0.ɵeld(2, 0, null, null, 1, "button", [["ibmButton", ""], ["skeleton", "true"]], [[2, "bx--btn", null], [2, "bx--btn--primary", null], [2, "bx--btn--secondary", null], [2, "bx--btn--tertiary", null], [2, "bx--btn--ghost", null], [2, "bx--btn--danger", null], [2, "bx--btn--danger--primary", null], [2, "bx--skeleton", null], [2, "bx--btn--sm", null], [2, "bx--toolbar-action", null], [2, "bx--overflow-menu", null]], null, null, null, null)), i0.ɵdid(3, 16384, null, 0, i4.Button, [], { ibmButton: [0, "ibmButton"], skeleton: [1, "skeleton"] }, null)], function (_ck, _v) { var currVal_11 = ""; var currVal_12 = "true"; _ck(_v, 3, 0, currVal_11, currVal_12); }, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 3).baseClass; var currVal_1 = i0.ɵnov(_v, 3).primaryButton; var currVal_2 = i0.ɵnov(_v, 3).secondaryButton; var currVal_3 = i0.ɵnov(_v, 3).tertiaryButton; var currVal_4 = i0.ɵnov(_v, 3).ghostButton; var currVal_5 = i0.ɵnov(_v, 3).dangerButton; var currVal_6 = i0.ɵnov(_v, 3).dangerPrimaryButton; var currVal_7 = i0.ɵnov(_v, 3).skeleton; var currVal_8 = i0.ɵnov(_v, 3).smallSize; var currVal_9 = i0.ɵnov(_v, 3).toolbarAction; var currVal_10 = i0.ɵnov(_v, 3).overflowMenu; _ck(_v, 2, 1, [currVal_0, currVal_1, currVal_2, currVal_3, currVal_4, currVal_5, currVal_6, currVal_7, currVal_8, currVal_9, currVal_10]); }); }
50
- export function View_FileUploader_0(_l) { return i0.ɵvid(0, [i0.ɵqud(671088640, 1, { fileInput: 0 }), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_FileUploader_1)), i0.ɵdid(2, 16384, null, 0, i5.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"], ngIfElse: [1, "ngIfElse"] }, null), (_l()(), i0.ɵand(0, [["skeletonTemplate", 2]], null, 0, null, View_FileUploader_3))], function (_ck, _v) { var _co = _v.component; var currVal_0 = !_co.skeleton; var currVal_1 = i0.ɵnov(_v, 3); _ck(_v, 2, 0, currVal_0, currVal_1); }, null); }
49
+ } return ad; }, null, null)), (_l()(), i0.ɵeld(10, 0, null, null, 2, "div", [["class", "bx--file-container"]], null, null, null, null, null)), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_FileUploader_2)), i0.ɵdid(12, 278528, null, 0, i4.NgForOf, [i0.ViewContainerRef, i0.TemplateRef, i0.IterableDiffers], { ngForOf: [0, "ngForOf"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_14 = "primary"; var currVal_15 = _co.size; _ck(_v, 7, 0, currVal_14, currVal_15); var currVal_20 = _co.files; _ck(_v, 12, 0, currVal_20); }, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.title; _ck(_v, 2, 0, currVal_0); var currVal_1 = _co.description; _ck(_v, 4, 0, currVal_1); var currVal_2 = _co.fileUploaderId; var currVal_3 = i0.ɵnov(_v, 7).baseClass; var currVal_4 = i0.ɵnov(_v, 7).primaryButton; var currVal_5 = i0.ɵnov(_v, 7).secondaryButton; var currVal_6 = i0.ɵnov(_v, 7).tertiaryButton; var currVal_7 = i0.ɵnov(_v, 7).ghostButton; var currVal_8 = i0.ɵnov(_v, 7).dangerButton; var currVal_9 = i0.ɵnov(_v, 7).dangerPrimaryButton; var currVal_10 = i0.ɵnov(_v, 7).skeleton; var currVal_11 = i0.ɵnov(_v, 7).smallSize; var currVal_12 = i0.ɵnov(_v, 7).toolbarAction; var currVal_13 = i0.ɵnov(_v, 7).overflowMenu; _ck(_v, 6, 1, [currVal_2, currVal_3, currVal_4, currVal_5, currVal_6, currVal_7, currVal_8, currVal_9, currVal_10, currVal_11, currVal_12, currVal_13]); var currVal_16 = _co.buttonText; _ck(_v, 8, 0, currVal_16); var currVal_17 = _co.accept; var currVal_18 = _co.fileUploaderId; var currVal_19 = _co.multiple; _ck(_v, 9, 0, currVal_17, currVal_18, currVal_19); }); }
50
+ function View_FileUploader_4(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 0, "div", [["class", "bx--skeleton__text"], ["style", "width: 100px"]], null, null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 0, "div", [["class", "bx--skeleton__text"], ["style", "width: 225px"]], null, null, null, null, null)), (_l()(), i0.ɵeld(2, 0, null, null, 1, "button", [["ibmButton", ""], ["skeleton", "true"]], [[2, "bx--btn", null], [2, "bx--btn--primary", null], [2, "bx--btn--secondary", null], [2, "bx--btn--tertiary", null], [2, "bx--btn--ghost", null], [2, "bx--btn--danger", null], [2, "bx--btn--danger--primary", null], [2, "bx--skeleton", null], [2, "bx--btn--sm", null], [2, "bx--toolbar-action", null], [2, "bx--overflow-menu", null]], null, null, null, null)), i0.ɵdid(3, 16384, null, 0, i5.Button, [], { ibmButton: [0, "ibmButton"], skeleton: [1, "skeleton"] }, null)], function (_ck, _v) { var currVal_11 = ""; var currVal_12 = "true"; _ck(_v, 3, 0, currVal_11, currVal_12); }, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 3).baseClass; var currVal_1 = i0.ɵnov(_v, 3).primaryButton; var currVal_2 = i0.ɵnov(_v, 3).secondaryButton; var currVal_3 = i0.ɵnov(_v, 3).tertiaryButton; var currVal_4 = i0.ɵnov(_v, 3).ghostButton; var currVal_5 = i0.ɵnov(_v, 3).dangerButton; var currVal_6 = i0.ɵnov(_v, 3).dangerPrimaryButton; var currVal_7 = i0.ɵnov(_v, 3).skeleton; var currVal_8 = i0.ɵnov(_v, 3).smallSize; var currVal_9 = i0.ɵnov(_v, 3).toolbarAction; var currVal_10 = i0.ɵnov(_v, 3).overflowMenu; _ck(_v, 2, 1, [currVal_0, currVal_1, currVal_2, currVal_3, currVal_4, currVal_5, currVal_6, currVal_7, currVal_8, currVal_9, currVal_10]); }); }
51
+ export function View_FileUploader_0(_l) { return i0.ɵvid(0, [i0.ɵqud(671088640, 1, { fileInput: 0 }), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_FileUploader_1)), i0.ɵdid(2, 16384, null, 0, i4.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"], ngIfElse: [1, "ngIfElse"] }, null), (_l()(), i0.ɵand(0, [["skeletonTemplate", 2]], null, 0, null, View_FileUploader_4))], function (_ck, _v) { var _co = _v.component; var currVal_0 = !_co.skeleton; var currVal_1 = i0.ɵnov(_v, 3); _ck(_v, 2, 0, currVal_0, currVal_1); }, null); }
51
52
  export function View_FileUploader_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 2, "ibm-file-uploader", [], null, null, null, View_FileUploader_0, RenderType_FileUploader)), i0.ɵprd(5120, null, i6.NG_VALUE_ACCESSOR, function (p0_0) { return [p0_0]; }, [i7.FileUploader]), i0.ɵdid(2, 114688, null, 0, i7.FileUploader, [i3.I18n], null, null)], function (_ck, _v) { _ck(_v, 2, 0); }, null); }
52
53
  var FileUploaderNgFactory = i0.ɵccf("ibm-file-uploader", i7.FileUploader, View_FileUploader_Host_0, { buttonText: "buttonText", title: "title", description: "description", accept: "accept", multiple: "multiple", skeleton: "skeleton", size: "size", fileUploaderId: "fileUploaderId", files: "files" }, { filesChange: "filesChange" }, []);
53
54
  export { FileUploaderNgFactory as FileUploaderNgFactory };
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.component.ngfactory.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.component.ngfactory.ts","../src/file-uploader/file-uploader.component.ts.FileUploader.html"],"names":[],"mappings":";;;;;;;;;;;;;;;;;uDCsBK,wKAA+F,YAAhC;;wBAA+B;MAA9F,oJAA+F,2BAAtD,kBAAqB,oBAA9D,YAA+F,EAAtD,SAAqB,2BAA9D,oEAA+F;uDArBlG,8EAAuD,KACtD,2GAAgC,KAAA,gCAAS,MACzC,4GAAiC,KAAA,gCAAe,MAChD,iGAAsB,KACrB,seAIe,EAFd;;wBAA2B;MAF5B,8HAIe,IAAA,kCAEf,MACA,0QAQ4B,YAA3B;;wBAAyB;MAR1B,wBAQ4B,KAC5B,4GAAgC,KAC/B,2MAA+F,iDAhB/F,0BAAmB,EAGnB,oBAAa,OAJd,YAIe,EAHd,UAAmB,EAGnB,UAAa,GAaH,oBAA8B,QAAxC,aAA+F,EAArF,UAA8B,mDApBV,kDAAS,GACR,wDAAe,GAK9C,mBAA2B,iBAH5B,qgBAGC,SAA2B,EAH5B,2HAIe,CAAA,GAAA,yDAEf,GAKC,oBAAiB,SACjB,oBAAqB,iBACrB,oBAAqB,WANtB,YAQ4B,EAJ3B,UAAiB,EACjB,UAAqB,EACrB,UAAqB;uDAUvB,sIAAqD,KACrD,sIAAqD,KACrD,8iBAAkC,yBAA1B,mBAAS,EAAC,uBAAe,EAAjC,YAAkC,EAA1B,UAAS,EAAC,UAAe,2BAAjC,0nBAAkC;uGA7BnC,uMAAuD,IA0BvD,gFAA+B,kDA1BjB,4DAAwC,GAAtD,YAAuD,EAAzC,oBAAwC","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n","\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<ibm-file *ngFor=\"let fileItem of files\" [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t"]}
1
+ {"version":3,"file":"file-uploader.component.ngfactory.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.component.ngfactory.ts","../src/file-uploader/file-uploader.component.ts.FileUploader.html"],"names":[],"mappings":";;;;;;;;;;;;;;;;;uDCwBM,6GAA2D,KAAA,mJAE3D;uDAJD,4EAAoC,KACnC,uNAAgE,YAAhC;;wBAA+B;MAA/D,oJAAgE,MAChE,4KAA2D,yBADjD,kBAAqB,oBAA/B,YAAgE,EAAtD,SAAqB,GAC1B,kBAAwB,4BAA7B,YAA2D,EAAtD,SAAwB,2BAD7B,6HAAgE;uDAtBpE,8EAAuD,KACtD,2GAAgC,KAAA,gCAAS,MACzC,4GAAiC,KAAA,gCAAe,MAChD,iGAAsB,KACrB,seAIe,EAFd;;wBAA2B;MAF5B,8HAIe,IAAA,kCAEf,MACA,0QAQ4B,YAA3B;;wBAAyB;MAR1B,wBAQ4B,KAC5B,4GAAgC,KAC/B,2MAAoC,iDAhBpC,0BAAmB,EAGnB,oBAAa,OAJd,YAIe,EAHd,UAAmB,EAGnB,UAAa,GAaR,oBAA8B,QAAnC,aAAoC,EAA/B,UAA8B,mDApBL,kDAAS,GACR,wDAAe,GAK9C,mBAA2B,iBAH5B,qgBAGC,SAA2B,EAH5B,2HAIe,CAAA,GAAA,yDAEf,GAKC,oBAAiB,SACjB,oBAAqB,iBACrB,oBAAqB,WANtB,YAQ4B,EAJ3B,UAAiB,EACjB,UAAqB,EACrB,UAAqB;uDAevB,sIAAqD,KACrD,sIAAqD,KACrD,8iBAAkC,yBAA1B,mBAAS,EAAC,uBAAe,EAAjC,YAAkC,EAA1B,UAAS,EAAC,UAAe,2BAAjC,0nBAAkC;uGAlCnC,uMAAuD,IA+BvD,gFAA+B,kDA/BjB,4DAAwC,GAAtD,YAAuD,EAAzC,oBAAwC","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n","\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate\">\n\t\t\t<strong class=\"bx--file--label\">{{title}}</strong>\n\t\t\t<p class=\"bx--label-description\">{{description}}</p>\n\t\t\t<div class=\"bx--file\">\n\t\t\t\t<button\n\t\t\t\t\tibmButton=\"primary\"\n\t\t\t\t\t(click)=\"fileInput.click()\"\n\t\t\t\t\t[attr.for]=\"fileUploaderId\"\n\t\t\t\t\t[size]=\"size\">\n\t\t\t\t\t{{buttonText}}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\t#fileInput\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclass=\"bx--file-input\"\n\t\t\t\t\t[accept]=\"accept\"\n\t\t\t\t\t[id]=\"fileUploaderId\"\n\t\t\t\t\t[multiple]=\"multiple\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t(change)=\"onFilesAdded()\"/>\n\t\t\t\t<div class=\"bx--file-container\">\n\t\t\t\t\t<div *ngFor=\"let fileItem of files\">\n\t\t\t\t\t\t<ibm-file [fileItem]=\"fileItem\" (remove)=\"removeFile(fileItem)\"></ibm-file>\n\t\t\t\t\t\t<div *ngIf=\"fileItem.invalid\" class=\"bx--form-requirement\">\n\t\t\t\t\t\t\t{{fileItem.invalidText}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 100px\"></div>\n\t\t\t<div class=\"bx--skeleton__text\" style=\"width: 225px\"></div>\n\t\t\t<button ibmButton skeleton=\"true\"></button>\n\t\t</ng-template>\n\t"]}
@@ -22,6 +22,7 @@ import { NgModule } from "@angular/core";
22
22
  import { CommonModule } from "@angular/common";
23
23
  import { Close16Module } from "@carbon/icons-angular/lib/close/16";
24
24
  import { CheckmarkFilled16Module } from "@carbon/icons-angular/lib/checkmark--filled/16";
25
+ import { WarningFilled16Module } from "@carbon/icons-angular/lib/warning--filled/16";
25
26
  import { FileUploader } from "./file-uploader.component";
26
27
  import { File } from "./file.component";
27
28
  import { ButtonModule } from "../button/button.module";
@@ -39,7 +40,8 @@ var FileUploaderModule = /** @class */ (function () {
39
40
  ButtonModule,
40
41
  LoadingModule,
41
42
  Close16Module,
42
- CheckmarkFilled16Module
43
+ CheckmarkFilled16Module,
44
+ WarningFilled16Module
43
45
  ]
44
46
  },] },
45
47
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.module.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;IAAA;IAWkC,CAAC;;gBAXlC,QAAQ,SAAC;oBACT,YAAY,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;oBAClC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE;wBACR,YAAY;wBACZ,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,uBAAuB;qBACvB;iBACD;;IACiC,yBAAC;CAAA,AAXnC,IAWmC;SAAtB,kBAAkB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { Close16Module } from \"@carbon/icons-angular/lib/close/16\";\nimport { CheckmarkFilled16Module } from \"@carbon/icons-angular/lib/checkmark--filled/16\";\n\nimport { FileUploader } from \"./file-uploader.component\";\nimport { File } from \"./file.component\";\nimport { ButtonModule } from \"../button/button.module\";\nimport { LoadingModule } from \"../loading/loading.module\";\n\nexport { FileUploader } from \"./file-uploader.component\";\n\n@NgModule({\n\tdeclarations: [FileUploader, File],\n\texports: [FileUploader],\n\timports: [\n\t\tCommonModule,\n\t\tButtonModule,\n\t\tLoadingModule,\n\t\tClose16Module,\n\t\tCheckmarkFilled16Module\n\t]\n})\nexport class FileUploaderModule { }\n"]}
1
+ {"version":3,"file":"file-uploader.module.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;IAAA;IAYkC,CAAC;;gBAZlC,QAAQ,SAAC;oBACT,YAAY,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;oBAClC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE;wBACR,YAAY;wBACZ,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,uBAAuB;wBACvB,qBAAqB;qBACrB;iBACD;;IACiC,yBAAC;CAAA,AAZnC,IAYmC;SAAtB,kBAAkB","sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { Close16Module } from \"@carbon/icons-angular/lib/close/16\";\nimport { CheckmarkFilled16Module } from \"@carbon/icons-angular/lib/checkmark--filled/16\";\nimport { WarningFilled16Module } from \"@carbon/icons-angular/lib/warning--filled/16\";\n\nimport { FileUploader } from \"./file-uploader.component\";\nimport { File } from \"./file.component\";\nimport { ButtonModule } from \"../button/button.module\";\nimport { LoadingModule } from \"../loading/loading.module\";\n\nexport { FileUploader } from \"./file-uploader.component\";\n\n@NgModule({\n\tdeclarations: [FileUploader, File],\n\texports: [FileUploader],\n\timports: [\n\t\tCommonModule,\n\t\tButtonModule,\n\t\tLoadingModule,\n\t\tClose16Module,\n\t\tCheckmarkFilled16Module,\n\t\tWarningFilled16Module\n\t]\n})\nexport class FileUploaderModule { }\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"FileUploaderModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./file-uploader.component","name":"FileUploader","line":13,"character":16},{"__symbolic":"reference","module":"./file.component","name":"File","line":13,"character":30}],"exports":[{"__symbolic":"reference","module":"./file-uploader.component","name":"FileUploader","line":14,"character":11}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":16,"character":2},{"__symbolic":"reference","module":"../button/button.module","name":"ButtonModule","line":17,"character":2},{"__symbolic":"reference","module":"../loading/loading.module","name":"LoadingModule","line":18,"character":2},{"__symbolic":"reference","module":"@carbon/icons-angular/lib/close/16","name":"Close16Module","line":19,"character":2},{"__symbolic":"reference","module":"@carbon/icons-angular/lib/checkmark--filled/16","name":"CheckmarkFilled16Module","line":20,"character":2}]}]}]}},"exports":[{"from":"./file-uploader.component","export":["FileUploader"]}]}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"FileUploaderModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./file-uploader.component","name":"FileUploader","line":14,"character":16},{"__symbolic":"reference","module":"./file.component","name":"File","line":14,"character":30}],"exports":[{"__symbolic":"reference","module":"./file-uploader.component","name":"FileUploader","line":15,"character":11}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":17,"character":2},{"__symbolic":"reference","module":"../button/button.module","name":"ButtonModule","line":18,"character":2},{"__symbolic":"reference","module":"../loading/loading.module","name":"LoadingModule","line":19,"character":2},{"__symbolic":"reference","module":"@carbon/icons-angular/lib/close/16","name":"Close16Module","line":20,"character":2},{"__symbolic":"reference","module":"@carbon/icons-angular/lib/checkmark--filled/16","name":"CheckmarkFilled16Module","line":21,"character":2},{"__symbolic":"reference","module":"@carbon/icons-angular/lib/warning--filled/16","name":"WarningFilled16Module","line":22,"character":2}]}]}]}},"exports":[{"from":"./file-uploader.component","export":["FileUploader"]}]}]
@@ -33,6 +33,7 @@ import * as i5 from "../button/button.module";
33
33
  import * as i6 from "../loading/loading.module";
34
34
  import * as i7 from "@carbon/icons-angular/lib/close/16";
35
35
  import * as i8 from "@carbon/icons-angular/lib/checkmark--filled/16";
36
- var FileUploaderModuleNgFactory = i0.ɵcmf(i1.FileUploaderModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, []], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i2.NgLocalization, i2.NgLocaleLocalization, [i0.LOCALE_ID, [2, i2.ɵangular_packages_common_common_a]]), i0.ɵmpd(5120, i3.I18n, i4.I18N_SERVICE_PROVIDER_FACTORY, [[3, i3.I18n]]), i0.ɵmpd(1073742336, i2.CommonModule, i2.CommonModule, []), i0.ɵmpd(1073742336, i5.ButtonModule, i5.ButtonModule, []), i0.ɵmpd(1073742336, i4.I18nModule, i4.I18nModule, []), i0.ɵmpd(1073742336, i6.LoadingModule, i6.LoadingModule, []), i0.ɵmpd(1073742336, i7.Close16Module, i7.Close16Module, []), i0.ɵmpd(1073742336, i8.CheckmarkFilled16Module, i8.CheckmarkFilled16Module, []), i0.ɵmpd(1073742336, i1.FileUploaderModule, i1.FileUploaderModule, [])]); });
36
+ import * as i9 from "@carbon/icons-angular/lib/warning--filled/16";
37
+ var FileUploaderModuleNgFactory = i0.ɵcmf(i1.FileUploaderModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, []], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i2.NgLocalization, i2.NgLocaleLocalization, [i0.LOCALE_ID, [2, i2.ɵangular_packages_common_common_a]]), i0.ɵmpd(5120, i3.I18n, i4.I18N_SERVICE_PROVIDER_FACTORY, [[3, i3.I18n]]), i0.ɵmpd(1073742336, i2.CommonModule, i2.CommonModule, []), i0.ɵmpd(1073742336, i5.ButtonModule, i5.ButtonModule, []), i0.ɵmpd(1073742336, i4.I18nModule, i4.I18nModule, []), i0.ɵmpd(1073742336, i6.LoadingModule, i6.LoadingModule, []), i0.ɵmpd(1073742336, i7.Close16Module, i7.Close16Module, []), i0.ɵmpd(1073742336, i8.CheckmarkFilled16Module, i8.CheckmarkFilled16Module, []), i0.ɵmpd(1073742336, i9.WarningFilled16Module, i9.WarningFilled16Module, []), i0.ɵmpd(1073742336, i1.FileUploaderModule, i1.FileUploaderModule, [])]); });
37
38
  export { FileUploaderModuleNgFactory as FileUploaderModuleNgFactory };
38
39
  //# sourceMappingURL=file-uploader.module.ngfactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.module.ngfactory.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './file-uploader.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '../button/button.directive';\nimport * as i4 from '../loading/loading.component';\nimport * as i5 from '@carbon/icons-angular/lib/close/16';\nimport * as i6 from '@carbon/icons-angular/lib/checkmark--filled/16';\nimport * as i7 from './file-uploader.component';\nimport * as i8 from './file.component';\nimport * as i9 from '../button/button.module';\nimport * as i10 from '../loading/loading.module';\nexport const FileUploaderModuleNgFactory:i0.NgModuleFactory<i1.FileUploaderModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.Button = (<any>(null as any));\nvar _decl0_12:i4.Loading = (<any>(null as any));\nvar _decl0_13:i5.Close16 = (<any>(null as any));\nvar _decl0_14:i5.Close16Directive = (<any>(null as any));\nvar _decl0_15:i6.CheckmarkFilled16 = (<any>(null as any));\nvar _decl0_16:i6.CheckmarkFilled16Directive = (<any>(null as any));\nvar _decl0_17:i7.FileUploader = (<any>(null as any));\nvar _decl0_18:i8.File = (<any>(null as any));\nvar _decl0_19:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_20:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_21:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_22:i2.JsonPipe = (<any>(null as any));\nvar _decl0_23:i2.SlicePipe = (<any>(null as any));\nvar _decl0_24:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_25:i2.PercentPipe = (<any>(null as any));\nvar _decl0_26:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_27:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_28:i2.DatePipe = (<any>(null as any));\nvar _decl0_29:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_30:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_31:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_32:i2.CommonModule = (<any>(null as any));\nvar _decl0_33:i9.ButtonModule = (<any>(null as any));\nvar _decl0_34:i10.LoadingModule = (<any>(null as any));\nvar _decl0_35:i5.Close16Module = (<any>(null as any));\nvar _decl0_36:i6.CheckmarkFilled16Module = (<any>(null as any));\nvar _decl0_37:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_38:i0.ElementRef<any> = (<any>(null as any));\nfunction _View_FileUploader_Host_1_0():void {\n var _any:any = (null as any);\n}\nfunction _View_FileUploader_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = !_decl0_17.skeleton;\n currVal_0;\n const currVal_1:any = _any;\n currVal_1;\n}\nfunction _View_File_Host_2_0():void {\n var _any:any = (null as any);\n}\nfunction _View_File_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_18.fileItem.file.name;\n currVal_0;\n const currVal_1:any = (_decl0_18.fileItem.state === 'edit');\n currVal_1;\n const currVal_2:any = (_decl0_18.fileItem.state === 'upload');\n currVal_2;\n const currVal_3:any = (_decl0_18.fileItem.state === 'complete');\n currVal_3;\n}\n"]}
1
+ {"version":3,"file":"file-uploader.module.ngfactory.js","sourceRoot":"","sources":["../src/file-uploader/file-uploader.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './file-uploader.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '../button/button.directive';\nimport * as i4 from '../loading/loading.component';\nimport * as i5 from '@carbon/icons-angular/lib/close/16';\nimport * as i6 from '@carbon/icons-angular/lib/checkmark--filled/16';\nimport * as i7 from '@carbon/icons-angular/lib/warning--filled/16';\nimport * as i8 from './file-uploader.component';\nimport * as i9 from './file.component';\nimport * as i10 from '../button/button.module';\nimport * as i11 from '../loading/loading.module';\nexport const FileUploaderModuleNgFactory:i0.NgModuleFactory<i1.FileUploaderModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.Button = (<any>(null as any));\nvar _decl0_12:i4.Loading = (<any>(null as any));\nvar _decl0_13:i5.Close16 = (<any>(null as any));\nvar _decl0_14:i5.Close16Directive = (<any>(null as any));\nvar _decl0_15:i6.CheckmarkFilled16 = (<any>(null as any));\nvar _decl0_16:i6.CheckmarkFilled16Directive = (<any>(null as any));\nvar _decl0_17:i7.WarningFilled16 = (<any>(null as any));\nvar _decl0_18:i7.WarningFilled16Directive = (<any>(null as any));\nvar _decl0_19:i8.FileUploader = (<any>(null as any));\nvar _decl0_20:i9.File = (<any>(null as any));\nvar _decl0_21:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_22:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_23:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_24:i2.JsonPipe = (<any>(null as any));\nvar _decl0_25:i2.SlicePipe = (<any>(null as any));\nvar _decl0_26:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_27:i2.PercentPipe = (<any>(null as any));\nvar _decl0_28:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_29:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_30:i2.DatePipe = (<any>(null as any));\nvar _decl0_31:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_32:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_33:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_34:i2.CommonModule = (<any>(null as any));\nvar _decl0_35:i10.ButtonModule = (<any>(null as any));\nvar _decl0_36:i11.LoadingModule = (<any>(null as any));\nvar _decl0_37:i5.Close16Module = (<any>(null as any));\nvar _decl0_38:i6.CheckmarkFilled16Module = (<any>(null as any));\nvar _decl0_39:i7.WarningFilled16Module = (<any>(null as any));\nvar _decl0_40:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_41:i0.ElementRef<any> = (<any>(null as any));\nfunction _View_FileUploader_Host_1_0():void {\n var _any:any = (null as any);\n}\nfunction _View_FileUploader_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = !_decl0_19.skeleton;\n currVal_0;\n const currVal_1:any = _any;\n currVal_1;\n}\nfunction _View_File_Host_2_0():void {\n var _any:any = (null as any);\n}\nfunction _View_File_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_20.fileItem.file.name;\n currVal_0;\n const currVal_1:any = (_decl0_20.fileItem.state === 'edit');\n currVal_1;\n const currVal_2:any = (_decl0_20.fileItem.state === 'upload');\n currVal_2;\n const currVal_3:any = (_decl0_20.fileItem.state === 'complete');\n currVal_3;\n}\n"]}
@@ -1 +1 @@
1
- {"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbol":1,"members":[]}},{"symbol":{"__symbol":2,"members":[]},"metadata":{"__symbolic":"class"},"type":{"summaryKind":2,"type":{"reference":{"__symbol":2,"members":[]},"diDeps":[],"lifecycleHooks":[]},"entryComponents":[],"providers":[{"provider":{"token":{"identifier":{"reference":{"__symbol":3,"members":[]}}},"useClass":{"reference":{"__symbol":4,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":5,"members":[]}}}},{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":6,"members":[]}}}}],"lifecycleHooks":[]},"useFactory":null,"deps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":5,"members":[]}}}},{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":6,"members":[]}}}}],"multi":false},"module":{"reference":{"__symbol":7,"members":[]},"diDeps":[],"lifecycleHooks":[]}},{"provider":{"token":{"identifier":{"reference":{"__symbol":8,"members":[]},"diDeps":[],"lifecycleHooks":[]}},"useClass":{"reference":{"__symbol":8,"members":[]},"diDeps":[],"lifecycleHooks":[]},"useFactory":null,"deps":[],"multi":false},"module":{"reference":{"__symbol":9,"members":[]},"diDeps":[],"lifecycleHooks":[]}},{"provider":{"token":{"identifier":{"reference":{"__symbol":8,"members":[]}}},"useClass":null,"useFactory":{"reference":{"__symbol":10,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":true,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":8,"members":[]}}}}]},"deps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":true,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":8,"members":[]}}}}],"multi":false},"module":{"reference":{"__symbol":9,"members":[]},"diDeps":[],"lifecycleHooks":[]}}],"modules":[{"reference":{"__symbol":7,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":11,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":9,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":12,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":13,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":14,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":2,"members":[]},"diDeps":[],"lifecycleHooks":[]}],"exportedDirectives":[{"reference":{"__symbol":1,"members":[]}}],"exportedPipes":[]}}],"symbols":[{"__symbol":0,"name":"FileUploader","filePath":"./file-uploader.module"},{"__symbol":1,"name":"FileUploader","filePath":"./file-uploader.component"},{"__symbol":2,"name":"FileUploaderModule","filePath":"./file-uploader.module"},{"__symbol":3,"name":"NgLocalization","filePath":"@angular/common"},{"__symbol":4,"name":"NgLocaleLocalization","filePath":"@angular/common"},{"__symbol":5,"name":"LOCALE_ID","filePath":"@angular/core"},{"__symbol":6,"name":"ɵangular_packages_common_common_a","filePath":"@angular/common"},{"__symbol":7,"name":"CommonModule","filePath":"@angular/common"},{"__symbol":8,"name":"I18n","filePath":"../i18n/i18n.service"},{"__symbol":9,"name":"I18nModule","filePath":"../i18n/i18n.module"},{"__symbol":10,"name":"I18N_SERVICE_PROVIDER_FACTORY","filePath":"../i18n/i18n.module"},{"__symbol":11,"name":"ButtonModule","filePath":"../button/button.module"},{"__symbol":12,"name":"LoadingModule","filePath":"../loading/loading.module"},{"__symbol":13,"name":"Close16Module","filePath":"@carbon/icons-angular/lib/close/16"},{"__symbol":14,"name":"CheckmarkFilled16Module","filePath":"@carbon/icons-angular/lib/checkmark--filled/16"}]}
1
+ {"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbol":1,"members":[]}},{"symbol":{"__symbol":2,"members":[]},"metadata":{"__symbolic":"class"},"type":{"summaryKind":2,"type":{"reference":{"__symbol":2,"members":[]},"diDeps":[],"lifecycleHooks":[]},"entryComponents":[],"providers":[{"provider":{"token":{"identifier":{"reference":{"__symbol":3,"members":[]}}},"useClass":{"reference":{"__symbol":4,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":5,"members":[]}}}},{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":6,"members":[]}}}}],"lifecycleHooks":[]},"useFactory":null,"deps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":5,"members":[]}}}},{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":6,"members":[]}}}}],"multi":false},"module":{"reference":{"__symbol":7,"members":[]},"diDeps":[],"lifecycleHooks":[]}},{"provider":{"token":{"identifier":{"reference":{"__symbol":8,"members":[]},"diDeps":[],"lifecycleHooks":[]}},"useClass":{"reference":{"__symbol":8,"members":[]},"diDeps":[],"lifecycleHooks":[]},"useFactory":null,"deps":[],"multi":false},"module":{"reference":{"__symbol":9,"members":[]},"diDeps":[],"lifecycleHooks":[]}},{"provider":{"token":{"identifier":{"reference":{"__symbol":8,"members":[]}}},"useClass":null,"useFactory":{"reference":{"__symbol":10,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":true,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":8,"members":[]}}}}]},"deps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":true,"isOptional":true,"token":{"identifier":{"reference":{"__symbol":8,"members":[]}}}}],"multi":false},"module":{"reference":{"__symbol":9,"members":[]},"diDeps":[],"lifecycleHooks":[]}}],"modules":[{"reference":{"__symbol":7,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":11,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":9,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":12,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":13,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":14,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":15,"members":[]},"diDeps":[],"lifecycleHooks":[]},{"reference":{"__symbol":2,"members":[]},"diDeps":[],"lifecycleHooks":[]}],"exportedDirectives":[{"reference":{"__symbol":1,"members":[]}}],"exportedPipes":[]}}],"symbols":[{"__symbol":0,"name":"FileUploader","filePath":"./file-uploader.module"},{"__symbol":1,"name":"FileUploader","filePath":"./file-uploader.component"},{"__symbol":2,"name":"FileUploaderModule","filePath":"./file-uploader.module"},{"__symbol":3,"name":"NgLocalization","filePath":"@angular/common"},{"__symbol":4,"name":"NgLocaleLocalization","filePath":"@angular/common"},{"__symbol":5,"name":"LOCALE_ID","filePath":"@angular/core"},{"__symbol":6,"name":"ɵangular_packages_common_common_a","filePath":"@angular/common"},{"__symbol":7,"name":"CommonModule","filePath":"@angular/common"},{"__symbol":8,"name":"I18n","filePath":"../i18n/i18n.service"},{"__symbol":9,"name":"I18nModule","filePath":"../i18n/i18n.module"},{"__symbol":10,"name":"I18N_SERVICE_PROVIDER_FACTORY","filePath":"../i18n/i18n.module"},{"__symbol":11,"name":"ButtonModule","filePath":"../button/button.module"},{"__symbol":12,"name":"LoadingModule","filePath":"../loading/loading.module"},{"__symbol":13,"name":"Close16Module","filePath":"@carbon/icons-angular/lib/close/16"},{"__symbol":14,"name":"CheckmarkFilled16Module","filePath":"@carbon/icons-angular/lib/checkmark--filled/16"},{"__symbol":15,"name":"WarningFilled16Module","filePath":"@carbon/icons-angular/lib/warning--filled/16"}]}
@@ -33,5 +33,6 @@ export declare class File {
33
33
  fileItem: FileItem;
34
34
  remove: EventEmitter<{}>;
35
35
  selectedFile: boolean;
36
+ readonly isInvalidText: string;
36
37
  constructor(i18n: I18n);
37
38
  }
@@ -30,10 +30,17 @@ var File = /** @class */ (function () {
30
30
  this.remove = new EventEmitter();
31
31
  this.selectedFile = true;
32
32
  }
33
+ Object.defineProperty(File.prototype, "isInvalidText", {
34
+ get: function () {
35
+ return this.fileItem.invalidText;
36
+ },
37
+ enumerable: true,
38
+ configurable: true
39
+ });
33
40
  File.decorators = [
34
41
  { type: Component, args: [{
35
42
  selector: "ibm-file",
36
- template: "\n\t\t<p class=\"bx--file-filename\">{{fileItem.file.name}}</p>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'edit'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\t(click)=\"remove.emit()\"\n\t\t\t(keyup.enter)=\"remove.emit()\"\n\t\t\t(keyup.space)=\"remove.emit()\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-close16\n\t\t\t\tclass=\"bx--file-close\"\n\t\t\t\t[ariaLabel]=\"translations.REMOVE_BUTTON\">\n\t\t\t</ibm-icon-close16>\n\t\t</span>\n\t\t<span *ngIf=\"fileItem.state === 'upload'\">\n\t\t\t<ibm-loading size=\"sm\"></ibm-loading>\n\t\t</span>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'complete'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-checkmark-filled16\n\t\t\t\tclass=\"bx--file-complete\"\n\t\t\t\t[ariaLabel]=\"translations.CHECKMARK\">\n\t\t\t</ibm-icon-checkmark-filled16>\n\t\t</span>\n\t"
43
+ template: "\n\t\t<p class=\"bx--file-filename\">{{fileItem.file.name}}</p>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'edit'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\t(click)=\"remove.emit()\"\n\t\t\t(keyup.enter)=\"remove.emit()\"\n\t\t\t(keyup.space)=\"remove.emit()\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-warning-filled16\n\t\t\t\t*ngIf=\"isInvalidText\"\n\t\t\t\tclass=\"bx--file--invalid\">\n\t\t\t</ibm-icon-warning-filled16>\n\t\t\t<ibm-icon-close16\n\t\t\t\tclass=\"bx--file-close\"\n\t\t\t\t[ariaLabel]=\"translations.REMOVE_BUTTON\">\n\t\t\t</ibm-icon-close16>\n\t\t</span>\n\t\t<span *ngIf=\"fileItem.state === 'upload'\">\n\t\t\t<ibm-loading size=\"sm\"></ibm-loading>\n\t\t</span>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'complete'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-checkmark-filled16\n\t\t\t\tclass=\"bx--file-complete\"\n\t\t\t\t[ariaLabel]=\"translations.CHECKMARK\">\n\t\t\t</ibm-icon-checkmark-filled16>\n\t\t</span>\n\t"
37
44
  },] },
38
45
  ];
39
46
  /** @nocollapse */
@@ -44,7 +51,8 @@ var File = /** @class */ (function () {
44
51
  translations: [{ type: Input }],
45
52
  fileItem: [{ type: Input }],
46
53
  remove: [{ type: Output }],
47
- selectedFile: [{ type: HostBinding, args: ["class.bx--file__selected-file",] }]
54
+ selectedFile: [{ type: HostBinding, args: ["class.bx--file__selected-file",] }],
55
+ isInvalidText: [{ type: HostBinding, args: ["class.bx--file__selected-file--invalid",] }]
48
56
  };
49
57
  return File;
50
58
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"file.component.js","sourceRoot":"","sources":["../src/file-uploader/file.component.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,KAAK,EACL,MAAM,EAEN,YAAY,EAEZ,WAAW,EACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C;IA4CC,cAAsB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAbhC;;WAEG;QACM,iBAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC;QAM5C,WAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAEQ,iBAAY,GAAG,IAAI,CAAC;IAE/B,CAAC;;gBA5CpC,SAAS,SAAC;oBACV,QAAQ,EAAE,UAAU;oBACpB,QAAQ,EAAE,21BA0BT;iBACD;;;;gBAhCQ,IAAI;;;+BAqCX,KAAK;2BAIL,KAAK;yBAEL,MAAM;+BAEN,WAAW,SAAC,+BAA+B;;IAG7C,WAAC;CAAA,AA7CD,IA6CC;SAfY,IAAI","sourcesContent":["\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tViewChild,\n\tEventEmitter,\n\tOnInit,\n\tHostBinding\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"../i18n/i18n.module\";\nimport { FileItem } from \"./file-item.interface\";\n\n@Component({\n\tselector: \"ibm-file\",\n\ttemplate: `\n\t\t<p class=\"bx--file-filename\">{{fileItem.file.name}}</p>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'edit'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\t(click)=\"remove.emit()\"\n\t\t\t(keyup.enter)=\"remove.emit()\"\n\t\t\t(keyup.space)=\"remove.emit()\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-close16\n\t\t\t\tclass=\"bx--file-close\"\n\t\t\t\t[ariaLabel]=\"translations.REMOVE_BUTTON\">\n\t\t\t</ibm-icon-close16>\n\t\t</span>\n\t\t<span *ngIf=\"fileItem.state === 'upload'\">\n\t\t\t<ibm-loading size=\"sm\"></ibm-loading>\n\t\t</span>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'complete'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-checkmark-filled16\n\t\t\t\tclass=\"bx--file-complete\"\n\t\t\t\t[ariaLabel]=\"translations.CHECKMARK\">\n\t\t\t</ibm-icon-checkmark-filled16>\n\t\t</span>\n\t`\n})\nexport class File {\n\t/**\n\t * Accessible translations for the close and complete icons\n\t */\n\t@Input() translations = this.i18n.get().FILE_UPLOADER;\n\t/**\n\t * A single `FileItem` from the set of `FileItem`s\n\t */\n\t@Input() fileItem: FileItem;\n\n\t@Output() remove = new EventEmitter();\n\n\t@HostBinding(\"class.bx--file__selected-file\") selectedFile = true;\n\n\tconstructor(protected i18n: I18n) {}\n}\n"]}
1
+ {"version":3,"file":"file.component.js","sourceRoot":"","sources":["../src/file-uploader/file.component.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,KAAK,EACL,MAAM,EAEN,YAAY,EAEZ,WAAW,EACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C;IAoDC,cAAsB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAjBhC;;WAEG;QACM,iBAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC;QAM5C,WAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAEQ,iBAAY,GAAG,IAAI,CAAC;IAM/B,CAAC;IAJpC,sBAA2D,+BAAa;aAAxE;YACC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;QAClC,CAAC;;;OAAA;;gBAlDD,SAAS,SAAC;oBACV,QAAQ,EAAE,UAAU;oBACpB,QAAQ,EAAE,w+BA8BT;iBACD;;;;gBApCQ,IAAI;;;+BAyCX,KAAK;2BAIL,KAAK;yBAEL,MAAM;+BAEN,WAAW,SAAC,+BAA+B;gCAE3C,WAAW,SAAC,wCAAwC;;IAKtD,WAAC;CAAA,AArDD,IAqDC;SAnBY,IAAI","sourcesContent":["\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tViewChild,\n\tEventEmitter,\n\tOnInit,\n\tHostBinding\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"../i18n/i18n.module\";\nimport { FileItem } from \"./file-item.interface\";\n\n@Component({\n\tselector: \"ibm-file\",\n\ttemplate: `\n\t\t<p class=\"bx--file-filename\">{{fileItem.file.name}}</p>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'edit'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\t(click)=\"remove.emit()\"\n\t\t\t(keyup.enter)=\"remove.emit()\"\n\t\t\t(keyup.space)=\"remove.emit()\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-warning-filled16\n\t\t\t\t*ngIf=\"isInvalidText\"\n\t\t\t\tclass=\"bx--file--invalid\">\n\t\t\t</ibm-icon-warning-filled16>\n\t\t\t<ibm-icon-close16\n\t\t\t\tclass=\"bx--file-close\"\n\t\t\t\t[ariaLabel]=\"translations.REMOVE_BUTTON\">\n\t\t\t</ibm-icon-close16>\n\t\t</span>\n\t\t<span *ngIf=\"fileItem.state === 'upload'\">\n\t\t\t<ibm-loading size=\"sm\"></ibm-loading>\n\t\t</span>\n\t\t<span\n\t\t\t*ngIf=\"fileItem.state === 'complete'\"\n\t\t\tclass=\"bx--file__state-container\"\n\t\t\ttabindex=\"0\">\n\t\t\t<ibm-icon-checkmark-filled16\n\t\t\t\tclass=\"bx--file-complete\"\n\t\t\t\t[ariaLabel]=\"translations.CHECKMARK\">\n\t\t\t</ibm-icon-checkmark-filled16>\n\t\t</span>\n\t`\n})\nexport class File {\n\t/**\n\t * Accessible translations for the close and complete icons\n\t */\n\t@Input() translations = this.i18n.get().FILE_UPLOADER;\n\t/**\n\t * A single `FileItem` from the set of `FileItem`s\n\t */\n\t@Input() fileItem: FileItem;\n\n\t@Output() remove = new EventEmitter();\n\n\t@HostBinding(\"class.bx--file__selected-file\") selectedFile = true;\n\n\t@HostBinding(\"class.bx--file__selected-file--invalid\") get isInvalidText() {\n\t\treturn this.fileItem.invalidText;\n\t}\n\n\tconstructor(protected i18n: I18n) {}\n}\n"]}