Files
im/plugin/admin/public/libs/froala/js/plugins/table.min.js
T

7 lines
56 KiB
JavaScript
Raw Normal View History

2025-11-07 09:56:20 +08:00
/*!
* froala_editor v4.3.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2024 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(ye){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,l=Array(t);a<t;a++)l[a]=e[a];return l}function Re(e){return function t(e){if(Array.isArray(e))return r(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function l(e,t){if(e){if("string"==typeof e)return r(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(e,t):void 0}}(e)||function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}ye=ye&&ye.hasOwnProperty("default")?ye["default"]:ye,Object.assign(ye.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(ye.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableFooter","tableRemove","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableDefaultWidth:"100%",tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,keepTextFormatOnTable:!1,tableInsertHelperOffset:15}),ye.PLUGINS.table=function(A){var O,f,n,r,l,o,y,T=A.$;function g(){var e=x();if(e){var t=A.popups.get("table.edit");if(t||(t=p()),t){A.popups.setContainer("table.edit",A.$sc);var a=I(e),l=a.left+(a.right-a.left)/2,n=a.bottom;A.popups.show("table.edit",l,n,a.bottom-a.top,!0),A.edit.isDisabled()&&(A.$el.removeClass("fr-no-selection"),A.edit.on(),A.button.bulkRefresh(),A.selection.setAtEnd(A.$el.find(".fr-selected-cell").last().get(0)),A.selection.restore())}}}function s(){var e=x();if(e){var t=A.popups.get("table.colors");t||(t=function o(){var e="";0<A.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-tabs">'.concat(A.button.buildList(A.opts.tableColorsButtons),"</div>"));var t="";A.opts.colorsHEXInput&&(t='<div class="fr-color-hex-layer fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'.concat(A.id,'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-').concat(A.id,'" type="text" placeholder="').concat(A.language.translate("HEX Color"),'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="tableCellBackgroundCustomColor" tabIndex="2" role="button">').concat(A.language.translate("OK"),"</button></div></div>"));var a={buttons:e,colors:function n(){for(var e='<div class="fr-color-set fr-table-colors">',t=0;t<A.opts.tableColors.length;t++)0!==t&&t%A.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=A.opts.tableColors[t]?e+='<span class="fr-command" style="background: '.concat(A.opts.tableColors[t],';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="').concat(A.opts.tableColors[t],'"><span class="fr-sr-only">').concat(A.language.translate("Color")," ").concat(A.opts.tableColors[t],"&nbsp;&nbsp;&nbsp;</span></span>"):e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-pa