");
- this._addClass(
- this.uiDialogButtonPane,
- "ui-dialog-buttonpane",
- "ui-widget-content ui-helper-clearfix",
- );
-
- this.uiButtonSet = $("
").appendTo(this.uiDialogButtonPane);
- this._addClass(this.uiButtonSet, "ui-dialog-buttonset");
-
- this._createButtons();
- },
-
- _createButtons() {
- const that = this;
- const { buttons } = this.options;
-
- // If we already have a button pane, remove it
- this.uiDialogButtonPane.remove();
- this.uiButtonSet.empty();
-
- if (
- $.isEmptyObject(buttons) ||
- (Array.isArray(buttons) && !buttons.length)
- ) {
- this._removeClass(this.uiDialog, "ui-dialog-buttons");
- return;
- }
-
- $.each(buttons, function (name, props) {
- let click;
- let buttonOptions;
- props =
- typeof props === "function" ? { click: props, text: name } : props;
-
- // Default to a non-submitting button
- props = $.extend({ type: "button" }, props);
- // Change the context for the click callback to be the main element
- click = props.click;
- buttonOptions = {
- icon: props.icon,
- iconPosition: props.iconPosition,
- showLabel: props.showLabel,
-
- // Deprecated options
- icons: props.icons,
- text: props.text,
- };
-
- delete props.click;
- delete props.icon;
- delete props.iconPosition;
- delete props.showLabel;
-
- // Deprecated options
- delete props.icons;
- if (typeof props.text === "boolean") {
- delete props.text;
- }
-
- $("
", props)
- .button(buttonOptions)
- .addClass(
- ` hds-button hds-button--${
- props.buttonType ? props.buttonType : "primary"
- }`,
- )
- .appendTo(that.uiButtonSet)
- .on("click", function () {
- click.apply(that.element[0], arguments);
- });
- });
- this._addClass(this.uiDialog, "ui-dialog-buttons");
- this.uiDialogButtonPane.appendTo(this.uiDialog);
- },
-
- _makeDraggable() {
- const that = this;
- const { options } = this;
-
- function filteredUi(ui) {
- return {
- position: ui.position,
- offset: ui.offset,
- };
- }
-
- this.uiDialog.draggable({
- cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
- handle: ".ui-dialog-titlebar",
- containment: "document",
- start(event, ui) {
- that._addClass($(this), "ui-dialog-dragging");
- that._blockFrames();
- that._trigger("dragStart", event, filteredUi(ui));
- },
- drag(event, ui) {
- that._trigger("drag", event, filteredUi(ui));
- },
- stop(event, ui) {
- const left = ui.offset.left - that.document.scrollLeft();
- const top = ui.offset.top - that.document.scrollTop();
-
- options.position = {
- my: "left top",
- at:
- `left${left >= 0 ? "+" : ""}${left} ` +
- `top${top >= 0 ? "+" : ""}${top}`,
- of: that.window,
- };
- that._removeClass($(this), "ui-dialog-dragging");
- that._unblockFrames();
- that._trigger("dragStop", event, filteredUi(ui));
- },
- });
- },
-
- _makeResizable() {
- const that = this;
- const { options } = this;
- const handles = options.resizable;
-
- // .ui-resizable has position: relative defined in the stylesheet
- // but dialogs have to use absolute or fixed positioning
- const position = this.uiDialog.css("position");
- const resizeHandles =
- typeof handles === "string" ? handles : "n,e,s,w,se,sw,ne,nw";
-
- function filteredUi(ui) {
- return {
- originalPosition: ui.originalPosition,
- originalSize: ui.originalSize,
- position: ui.position,
- size: ui.size,
- };
- }
-
- this.uiDialog
- .resizable({
- cancel: ".ui-dialog-content",
- containment: "document",
- alsoResize: this.element,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: this._minHeight(),
- handles: resizeHandles,
- start(event, ui) {
- that._addClass($(this), "ui-dialog-resizing");
- that._blockFrames();
- that._trigger("resizeStart", event, filteredUi(ui));
- },
- resize(event, ui) {
- that._trigger("resize", event, filteredUi(ui));
- },
- stop(event, ui) {
- const offset = that.uiDialog.offset();
- const left = offset.left - that.document.scrollLeft();
- const top = offset.top - that.document.scrollTop();
-
- options.height = that.uiDialog.height();
- options.width = that.uiDialog.width();
- options.position = {
- my: "left top",
- at:
- `left${left >= 0 ? "+" : ""}${left} ` +
- `top${top >= 0 ? "+" : ""}${top}`,
- of: that.window,
- };
- that._removeClass($(this), "ui-dialog-resizing");
- that._unblockFrames();
- that._trigger("resizeStop", event, filteredUi(ui));
- },
- })
- .css("position", position);
- },
-
- _trackFocus() {
- this._on(this.widget(), {
- focusin(event) {
- this._makeFocusTarget();
- this._focusedElement = $(event.target);
- },
- });
- },
-
- _makeFocusTarget() {
- this._untrackInstance();
- this._trackingInstances().unshift(this);
- },
-
- _untrackInstance() {
- const instances = this._trackingInstances();
- const exists = $.inArray(this, instances);
- if (exists !== -1) {
- instances.splice(exists, 1);
- }
- },
-
- _trackingInstances() {
- let instances = this.document.data("ui-dialog-instances");
- if (!instances) {
- instances = [];
- this.document.data("ui-dialog-instances", instances);
- }
- return instances;
- },
-
- _minHeight() {
- const { options } = this;
-
- return options.height === "auto"
- ? options.minHeight
- : Math.min(options.minHeight, options.height);
- },
-
- _position() {
- // Need to show the dialog to get the actual offset in the position plugin
- const isVisible = this.uiDialog.is(":visible");
- if (!isVisible) {
- this.uiDialog.show();
- }
- this.uiDialog.position(this.options.position);
- if (!isVisible) {
- this.uiDialog.hide();
- }
- },
-
- _setOptions(options) {
- const that = this;
- let resize = false;
- const resizableOptions = {};
-
- $.each(options, function (key, value) {
- that._setOption(key, value);
-
- if (key in that.sizeRelatedOptions) {
- resize = true;
- }
- if (key in that.resizableRelatedOptions) {
- resizableOptions[key] = value;
- }
- });
-
- if (resize) {
- this._size();
- this._position();
- }
- if (this.uiDialog.is(":data(ui-resizable)")) {
- this.uiDialog.resizable("option", resizableOptions);
- }
- },
-
- _setOption(key, value) {
- let isDraggable;
- let isResizable;
- const { uiDialog } = this;
-
- if (key === "disabled") {
- return;
- }
-
- this._super(key, value);
-
- if (key === "appendTo") {
- this.uiDialog.appendTo(this._appendTo());
- }
-
- if (key === "buttons") {
- this._createButtons();
- }
-
- if (key === "closeText") {
- this.uiDialogTitlebarClose.button({
- // Ensure that we always pass a string
- label: $("
").text(`${this.options.closeText}`).html(),
- });
- }
-
- if (key === "draggable") {
- isDraggable = uiDialog.is(":data(ui-draggable)");
- if (isDraggable && !value) {
- uiDialog.draggable("destroy");
- }
-
- if (!isDraggable && value) {
- this._makeDraggable();
- }
- }
-
- if (key === "position") {
- this._position();
- }
-
- if (key === "resizable") {
- // currently resizable, becoming non-resizable
- isResizable = uiDialog.is(":data(ui-resizable)");
- if (isResizable && !value) {
- uiDialog.resizable("destroy");
- }
-
- // Currently resizable, changing handles
- if (isResizable && typeof value === "string") {
- uiDialog.resizable("option", "handles", value);
- }
-
- // Currently non-resizable, becoming resizable
- if (!isResizable && value !== false) {
- this._makeResizable();
- }
- }
-
- if (key === "title") {
- this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));
- }
- },
-
- _size() {
- // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
- // divs will both have width and height set, so we need to reset them
- let nonContentHeight;
- let minContentHeight;
- let maxContentHeight;
- const { options } = this;
-
- // Reset content sizing
- this.element.show().css({
- width: "auto",
- minHeight: 0,
- maxHeight: "none",
- height: 0,
- });
-
- if (options.minWidth > options.width) {
- options.width = options.minWidth;
- }
-
- // Reset wrapper sizing
- // determine the height of all the non-content elements
- nonContentHeight = this.uiDialog
- .css({
- height: "auto",
- width: options.width,
- })
- .outerHeight();
- minContentHeight = Math.max(0, options.minHeight - nonContentHeight);
- maxContentHeight =
- typeof options.maxHeight === "number"
- ? Math.max(0, options.maxHeight - nonContentHeight)
- : "none";
-
- if (options.height === "auto") {
- this.element.css({
- minHeight: minContentHeight,
- maxHeight: maxContentHeight,
- height: "auto",
- });
- } else {
- this.element.height(Math.max(0, options.height - nonContentHeight));
- }
-
- if (this.uiDialog.is(":data(ui-resizable)")) {
- this.uiDialog.resizable("option", "minHeight", this._minHeight());
- }
- },
-
- _blockFrames() {
- this.iframeBlocks = this.document.find("iframe").map(function () {
- const iframe = $(this);
-
- return $("")
- .css({
- position: "absolute",
- width: iframe.outerWidth(),
- height: iframe.outerHeight(),
- })
- .appendTo(iframe.parent())
- .offset(iframe.offset())[0];
- });
- },
-
- _unblockFrames() {
- if (this.iframeBlocks) {
- this.iframeBlocks.remove();
- delete this.iframeBlocks;
- }
- },
-
- _allowInteraction(event) {
- if ($(event.target).closest(".ui-dialog").length) {
- return true;
- }
-
- // TODO: Remove hack when datepicker implements
- // the .ui-front logic (#8989)
- return !!$(event.target).closest(".ui-datepicker").length;
- },
-
- _createOverlay() {
- if (!this.options.modal) {
- return;
- }
-
- const jqMinor = $.fn.jquery.substring(0, 4);
-
- // We use a delay in case the overlay is created from an
- // event that we're going to be cancelling (#2804)
- let isOpening = true;
- this._delay(function () {
- isOpening = false;
- });
-
- if (!this.document.data("ui-dialog-overlays")) {
- // Prevent use of anchors and inputs
- // This doesn't use `_on()` because it is a shared event handler
- // across all open modal dialogs.
- this.document.on(
- "focusin.ui-dialog",
- function (event) {
- if (isOpening) {
- return;
- }
-
- const instance = this._trackingInstances()[0];
- if (!instance._allowInteraction(event)) {
- event.preventDefault();
- instance._focusTabbable();
-
- // Support: jQuery >=3.4 <3.6 only
- // Focus re-triggering in jQuery 3.4/3.5 makes the original element
- // have its focus event propagated last, breaking the re-targeting.
- // Trigger focus in a delay in addition if needed to avoid the issue
- // See https://github.com/jquery/jquery/issues/4382
- if (jqMinor === "3.4." || jqMinor === "3.5.") {
- instance._delay(instance._restoreTabbableFocus);
- }
- }
- }.bind(this),
- );
- }
-
- this.overlay = $("
").appendTo(this._appendTo());
-
- this._addClass(this.overlay, null, "ui-widget-overlay ui-front");
- this._on(this.overlay, {
- mousedown: "_keepFocus",
- });
- this.document.data(
- "ui-dialog-overlays",
- (this.document.data("ui-dialog-overlays") || 0) + 1,
- );
- },
-
- _destroyOverlay() {
- if (!this.options.modal) {
- return;
- }
-
- if (this.overlay) {
- const overlays = this.document.data("ui-dialog-overlays") - 1;
-
- if (!overlays) {
- this.document.off("focusin.ui-dialog");
- this.document.removeData("ui-dialog-overlays");
- } else {
- this.document.data("ui-dialog-overlays", overlays);
- }
-
- this.overlay.remove();
- this.overlay = null;
- }
- },
- });
-
- // DEPRECATED
- // TODO: switch return back to widget declaration at top of file when this is removed
- if ($.uiBackCompat !== false) {
- // Backcompat for dialogClass option
- $.widget("ui.dialog", $.ui.dialog, {
- options: {
- dialogClass: "",
- },
- _createWrapper() {
- this._super();
- this.uiDialog.addClass(this.options.dialogClass);
- },
- _setOption(key, value) {
- if (key === "dialogClass") {
- this.uiDialog.removeClass(this.options.dialogClass).addClass(value);
- }
- this._superApply(arguments);
- },
- });
- }
-
- return $.ui.dialog;
-});
diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss
index 58bd78771f..fad523ef8b 100644
--- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss
+++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss
@@ -1,5 +1,4 @@
@import 'block/_index';
-@import 'dialog/_index';
@import 'pages/_index';
@import 'layout/_index';
@import 'navigation/_index';
diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/dialog/__index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/dialog/__index.scss
deleted file mode 100644
index a10b4b1b34..0000000000
--- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/dialog/__index.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import 'dialog';
diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/dialog/_dialog.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/dialog/_dialog.scss
deleted file mode 100644
index c8043dc305..0000000000
--- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/dialog/_dialog.scss
+++ /dev/null
@@ -1,90 +0,0 @@
-.ui-widget-overlay {
- z-index: 99;
-}
-
-.ui-dialog {
- .ui-button:hover {
- border-width: 2px;
- }
-
- .ui-dialog-titlebar-close {
- top: var(--spacing-s);
- z-index: 1001;
- }
-
- .ui-dialog-buttonpane .ui-dialog-buttonset {
- float: left;
- }
-
- .ui-dialog-buttonpane {
- padding: var(--spacing-2-xs) var(--spacing-m);
-
- button {
- margin: 0 var(--spacing-xs) 0 0;
- }
- }
-
- .ui-dialog-content {
- padding: 0 1em 1em;
- position: initial;
- }
-
- div.ui-dialog-titlebar {
- padding: 0;
- }
-
- &-titlebar {
- background: transparent;
- border: 0;
-
- &-close {
- background: none;
- border: none;
- }
-
- .ui-dialog-title {
- display: block;
- font-size: var(--fontsize-heading-s);
- overflow: auto;
- padding: var(--spacing-layout-2-xs) var(--spacing-layout-2-xs) var(--spacing-layout-2-xs) var(--spacing-2-xl);
- position: relative;
- white-space: normal;
- }
- }
-
- &-title {
- .hel-icon {
- left: var(--spacing-m);
- margin-right: var(--spacing-2-xs);
- position: absolute;
- top: var(--spacing-s);
- }
- }
-}
-
-.ui-widget-content {
- border: 0 transparent solid;
-
- h3 {
- margin-top: 0;
- }
-}
-
-div.ui-widget.ui-widget-content {
- border-top: var(--spacing-2-xs) solid var(--color-black);
- max-width: 100vw;
- min-width: 300px;
- padding-top: 0;
-}
-
-.ui-widget-content span.ui-icon {
- margin-left: -8px;
- margin-top: -8px;
- mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Crect width='24' height='24'/%3E %3Cpolygon fill='currentColor' points='18 7.5 13.5 12 18 16.5 16.5 18 12 13.5 7.5 18 6 16.5 10.5 12 6 7.5 7.5 6 12 10.5 16.5 6'/%3E %3C/g%3E %3C/svg%3E");
- transform: scale(1.5);
-}
-
-.submission-for-copying {
- margin-bottom: 1em;
- margin-top: 1em;
-}