@tabler/core 1.0.0-alpha.24 → 1.0.0-beta11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +44 -11
- package/dist/.DS_Store +0 -0
- package/dist/css/demo.css +399 -240
- package/dist/css/demo.min.css +5 -5
- package/dist/css/demo.rtl.css +399 -240
- package/dist/css/demo.rtl.min.css +5 -5
- package/dist/css/tabler-flags.css +535 -268
- package/dist/css/tabler-flags.min.css +5 -5
- package/dist/css/tabler-flags.rtl.css +535 -268
- package/dist/css/tabler-flags.rtl.min.css +5 -5
- package/dist/css/tabler-payments.css +258 -129
- package/dist/css/tabler-payments.min.css +5 -5
- package/dist/css/tabler-payments.rtl.css +258 -129
- package/dist/css/tabler-payments.rtl.min.css +5 -5
- package/dist/css/tabler-vendors.css +1010 -475
- package/dist/css/tabler-vendors.min.css +5 -5
- package/dist/css/tabler-vendors.rtl.css +1010 -475
- package/dist/css/tabler-vendors.rtl.min.css +5 -5
- package/dist/css/tabler.css +17800 -8221
- package/dist/css/tabler.min.css +10 -5
- package/dist/css/tabler.rtl.css +17487 -7925
- package/dist/css/tabler.rtl.min.css +10 -5
- package/dist/js/demo.js +151 -0
- package/dist/js/demo.min.js +9 -0
- package/dist/js/tabler.esm.js +8236 -0
- package/dist/js/tabler.esm.min.js +9 -0
- package/dist/js/tabler.js +4040 -3891
- package/dist/js/tabler.min.js +5 -5
- package/dist/libs/apexcharts/dist/apexcharts.amd.js +2 -0
- package/dist/libs/apexcharts/dist/apexcharts.common.js +14 -0
- package/dist/libs/apexcharts/dist/apexcharts.css +691 -0
- package/dist/libs/apexcharts/dist/apexcharts.esm.js +14 -0
- package/dist/libs/apexcharts/dist/apexcharts.js +31960 -0
- package/dist/libs/apexcharts/dist/apexcharts.min.js +5 -5
- package/dist/libs/apexcharts/dist/locales/ar.json +63 -0
- package/dist/libs/apexcharts/dist/locales/ca.json +55 -0
- package/dist/libs/apexcharts/dist/locales/cs.json +55 -0
- package/dist/libs/apexcharts/dist/locales/de.json +55 -0
- package/dist/libs/apexcharts/dist/locales/el.json +55 -0
- package/dist/libs/apexcharts/dist/locales/en.json +55 -0
- package/dist/libs/apexcharts/dist/locales/es.json +55 -0
- package/dist/libs/apexcharts/dist/locales/et.json +63 -0
- package/dist/libs/apexcharts/dist/locales/fa.json +55 -0
- package/dist/libs/apexcharts/dist/locales/fi.json +55 -0
- package/dist/libs/apexcharts/dist/locales/fr.json +55 -0
- package/dist/libs/apexcharts/dist/locales/he.json +55 -0
- package/dist/libs/apexcharts/dist/locales/hi.json +55 -0
- package/dist/libs/apexcharts/dist/locales/hr.json +55 -0
- package/dist/libs/apexcharts/dist/locales/hu.json +64 -0
- package/dist/libs/apexcharts/dist/locales/hy.json +55 -0
- package/dist/libs/apexcharts/dist/locales/id.json +47 -0
- package/dist/libs/apexcharts/dist/locales/it.json +55 -0
- package/dist/libs/apexcharts/dist/locales/ja.json +55 -0
- package/dist/libs/apexcharts/dist/locales/ka.json +55 -0
- package/dist/libs/apexcharts/dist/locales/ko.json +55 -0
- package/dist/libs/apexcharts/dist/locales/lt.json +55 -0
- package/dist/libs/apexcharts/dist/locales/lv.json +64 -0
- package/dist/libs/apexcharts/dist/locales/nb.json +55 -0
- package/dist/libs/apexcharts/dist/locales/nl.json +55 -0
- package/dist/libs/apexcharts/dist/locales/pl.json +55 -0
- package/dist/libs/apexcharts/dist/locales/pt-br.json +55 -0
- package/dist/libs/apexcharts/dist/locales/pt.json +55 -0
- package/dist/libs/apexcharts/dist/locales/rs.json +55 -0
- package/dist/libs/apexcharts/dist/locales/ru.json +55 -0
- package/dist/libs/apexcharts/dist/locales/se.json +55 -0
- package/dist/libs/apexcharts/dist/locales/sk.json +55 -0
- package/dist/libs/apexcharts/dist/locales/sl.json +55 -0
- package/dist/libs/apexcharts/dist/locales/sq.json +55 -0
- package/dist/libs/apexcharts/dist/locales/th.json +55 -0
- package/dist/libs/apexcharts/dist/locales/tr.json +55 -0
- package/dist/libs/apexcharts/dist/locales/ua.json +55 -0
- package/dist/libs/apexcharts/dist/locales/zh-cn.json +55 -0
- package/dist/libs/apexcharts/dist/locales/zh-tw.json +55 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +7066 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +5204 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +7 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.js +5251 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js +7 -0
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -0
- package/dist/libs/countup.js/dist/countUp.d.ts +61 -0
- package/dist/libs/countup.js/dist/countUp.js +56 -22
- package/dist/libs/countup.js/dist/countUp.min.js +1 -0
- package/dist/libs/countup.js/dist/countUp.umd.js +293 -0
- package/dist/libs/countup.js/dist/countUp.withPolyfill.min.js +1 -0
- package/dist/libs/dropzone/dist/basic.css +1 -0
- package/dist/libs/dropzone/dist/basic.css.map +1 -0
- package/dist/libs/dropzone/dist/dropzone-min.js +2 -0
- package/dist/libs/dropzone/dist/dropzone-min.js.map +1 -0
- package/dist/libs/dropzone/dist/dropzone.css +1 -0
- package/dist/libs/dropzone/dist/dropzone.css.map +1 -0
- package/dist/libs/dropzone/dist/dropzone.js +3068 -0
- package/dist/libs/dropzone/dist/dropzone.js.map +1 -0
- package/dist/libs/dropzone/dist/dropzone.mjs +2111 -0
- package/dist/libs/dropzone/dist/dropzone.mjs.map +1 -0
- package/dist/libs/fslightbox/LICENSE +21 -0
- package/dist/libs/fslightbox/README.md +62 -0
- package/dist/libs/fslightbox/index.js +1 -0
- package/dist/libs/fslightbox/jest-setup.js +1 -0
- package/dist/libs/fslightbox/package.json +72 -0
- package/dist/libs/jsvectormap/dist/js/jsvectormap.js +2663 -0
- package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +1 -0
- package/dist/libs/jsvectormap/dist/maps/world-merc.js +1 -0
- package/dist/libs/jsvectormap/dist/maps/world.js +1 -0
- package/dist/libs/list.js/dist/list.js +2020 -0
- package/dist/libs/list.js/dist/list.js.map +1 -0
- package/dist/libs/list.js/dist/list.min.js +2 -0
- package/dist/libs/list.js/dist/list.min.js.map +1 -0
- package/dist/libs/litepicker/dist/bundle.js +52 -0
- package/dist/libs/litepicker/dist/css/litepicker.css +13 -0
- package/dist/libs/litepicker/dist/css/plugins/keyboardnav.js.css +12 -0
- package/dist/libs/litepicker/dist/css/plugins/mobilefriendly.js.css +133 -0
- package/dist/libs/litepicker/dist/css/plugins/multiselect.js.css +54 -0
- package/dist/libs/litepicker/dist/css/plugins/ranges.js.css +81 -0
- package/dist/libs/litepicker/dist/js/main.js +13 -0
- package/dist/libs/litepicker/dist/litepicker.amd.js +12 -0
- package/dist/libs/litepicker/dist/litepicker.commonjs2.js +12 -0
- package/dist/libs/litepicker/dist/litepicker.js +3 -3
- package/dist/libs/litepicker/dist/litepicker.umd.js +12 -0
- package/dist/libs/litepicker/dist/nocss/litepicker.amd.js +12 -0
- package/dist/libs/litepicker/dist/nocss/litepicker.commonjs2.js +12 -0
- package/dist/libs/litepicker/dist/nocss/litepicker.js +12 -0
- package/dist/libs/litepicker/dist/nocss/litepicker.umd.js +12 -0
- package/dist/libs/litepicker/dist/nocss/plugins/keyboardnav.js +11 -0
- package/dist/libs/litepicker/dist/nocss/plugins/mobilefriendly.js +11 -0
- package/dist/libs/litepicker/dist/nocss/plugins/multiselect.js +11 -0
- package/dist/libs/litepicker/dist/nocss/plugins/ranges.js +11 -0
- package/dist/libs/litepicker/dist/plugins/keyboardnav.js +11 -0
- package/dist/libs/litepicker/dist/plugins/mobilefriendly.js +11 -0
- package/dist/libs/litepicker/dist/plugins/multiselect.js +11 -0
- package/dist/libs/litepicker/dist/plugins/ranges.js +11 -0
- package/dist/libs/litepicker/dist/types/calendar.d.ts +14 -0
- package/dist/libs/litepicker/dist/types/core.d.ts +23 -0
- package/dist/libs/litepicker/dist/types/datetime.d.ts +41 -0
- package/dist/libs/litepicker/dist/types/index.d.ts +4 -0
- package/dist/libs/litepicker/dist/types/interfaces.d.ts +80 -0
- package/dist/libs/litepicker/dist/types/litepicker.d.ts +25 -0
- package/dist/libs/litepicker/dist/types/methods.d.ts +20 -0
- package/dist/libs/litepicker/dist/types/utils.d.ts +4 -0
- package/dist/libs/litepicker/dist/types/window.d.ts +6 -0
- package/dist/libs/nouislider/dist/nouislider.css +304 -0
- package/dist/libs/nouislider/dist/nouislider.d.ts +198 -0
- package/dist/libs/nouislider/dist/nouislider.js +2254 -0
- package/dist/libs/nouislider/dist/nouislider.min.css +1 -0
- package/dist/libs/nouislider/dist/nouislider.min.js +1 -0
- package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -0
- package/dist/libs/nouislider/dist/nouislider.mjs +2243 -0
- package/dist/libs/plyr/dist/plyr.css +1 -0
- package/dist/libs/plyr/dist/plyr.js +8764 -0
- package/dist/libs/plyr/dist/plyr.min.js +2 -0
- package/dist/libs/plyr/dist/plyr.min.js.map +1 -0
- package/dist/libs/plyr/dist/plyr.min.mjs +1 -0
- package/dist/libs/plyr/dist/plyr.min.mjs.map +1 -0
- package/dist/libs/plyr/dist/plyr.mjs +8756 -0
- package/dist/libs/plyr/dist/plyr.polyfilled.js +9301 -0
- package/dist/libs/plyr/dist/plyr.polyfilled.min.js +2 -0
- package/dist/libs/plyr/dist/plyr.polyfilled.min.js.map +1 -0
- package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs +1 -0
- package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs.map +1 -0
- package/dist/libs/plyr/dist/plyr.polyfilled.mjs +9293 -0
- package/dist/libs/plyr/dist/plyr.svg +1 -0
- package/dist/libs/tinymce/CHANGELOG.md +2957 -0
- package/dist/libs/tinymce/README.md +71 -0
- package/dist/libs/tinymce/bower.json +27 -0
- package/dist/libs/tinymce/composer.json +52 -0
- package/dist/libs/tinymce/icons/default/icons.js +182 -0
- package/dist/libs/tinymce/icons/default/icons.min.js +1 -0
- package/dist/libs/tinymce/icons/default/index.js +7 -0
- package/dist/libs/tinymce/license.txt +21 -0
- package/dist/libs/tinymce/models/dom/index.js +7 -0
- package/dist/libs/tinymce/models/dom/model.js +7975 -0
- package/dist/libs/tinymce/models/dom/model.min.js +4 -0
- package/dist/libs/tinymce/package.json +32 -0
- package/dist/libs/tinymce/plugins/advlist/index.js +7 -0
- package/dist/libs/tinymce/plugins/advlist/plugin.js +246 -0
- package/dist/libs/tinymce/plugins/advlist/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/anchor/index.js +7 -0
- package/dist/libs/tinymce/plugins/anchor/plugin.js +195 -0
- package/dist/libs/tinymce/plugins/anchor/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/autolink/index.js +7 -0
- package/dist/libs/tinymce/plugins/autolink/plugin.js +232 -0
- package/dist/libs/tinymce/plugins/autolink/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/autoresize/index.js +7 -0
- package/dist/libs/tinymce/plugins/autoresize/plugin.js +156 -0
- package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/autosave/index.js +7 -0
- package/dist/libs/tinymce/plugins/autosave/plugin.js +232 -0
- package/dist/libs/tinymce/plugins/autosave/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/charmap/index.js +7 -0
- package/dist/libs/tinymce/plugins/charmap/plugin.js +1636 -0
- package/dist/libs/tinymce/plugins/charmap/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/code/index.js +7 -0
- package/dist/libs/tinymce/plugins/code/plugin.js +85 -0
- package/dist/libs/tinymce/plugins/code/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/codesample/index.js +7 -0
- package/dist/libs/tinymce/plugins/codesample/plugin.js +2451 -0
- package/dist/libs/tinymce/plugins/codesample/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/directionality/index.js +7 -0
- package/dist/libs/tinymce/plugins/directionality/plugin.js +384 -0
- package/dist/libs/tinymce/plugins/directionality/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/emoticons/index.js +7 -0
- package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
- package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
- package/dist/libs/tinymce/plugins/emoticons/js/emojis.js +1 -0
- package/dist/libs/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
- package/dist/libs/tinymce/plugins/emoticons/plugin.js +577 -0
- package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/fullscreen/index.js +7 -0
- package/dist/libs/tinymce/plugins/fullscreen/plugin.js +1190 -0
- package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/help/index.js +7 -0
- package/dist/libs/tinymce/plugins/help/plugin.js +848 -0
- package/dist/libs/tinymce/plugins/help/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/image/index.js +7 -0
- package/dist/libs/tinymce/plugins/image/plugin.js +1475 -0
- package/dist/libs/tinymce/plugins/image/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/importcss/index.js +7 -0
- package/dist/libs/tinymce/plugins/importcss/plugin.js +342 -0
- package/dist/libs/tinymce/plugins/importcss/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/insertdatetime/index.js +7 -0
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +176 -0
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/link/index.js +7 -0
- package/dist/libs/tinymce/plugins/link/plugin.js +1190 -0
- package/dist/libs/tinymce/plugins/link/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/lists/index.js +7 -0
- package/dist/libs/tinymce/plugins/lists/plugin.js +1820 -0
- package/dist/libs/tinymce/plugins/lists/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/media/index.js +7 -0
- package/dist/libs/tinymce/plugins/media/plugin.js +1157 -0
- package/dist/libs/tinymce/plugins/media/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/nonbreaking/index.js +7 -0
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +111 -0
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/pagebreak/index.js +7 -0
- package/dist/libs/tinymce/plugins/pagebreak/plugin.js +105 -0
- package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/preview/index.js +7 -0
- package/dist/libs/tinymce/plugins/preview/plugin.js +97 -0
- package/dist/libs/tinymce/plugins/preview/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/quickbars/index.js +7 -0
- package/dist/libs/tinymce/plugins/quickbars/plugin.js +421 -0
- package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/save/index.js +7 -0
- package/dist/libs/tinymce/plugins/save/plugin.js +118 -0
- package/dist/libs/tinymce/plugins/save/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/searchreplace/index.js +7 -0
- package/dist/libs/tinymce/plugins/searchreplace/plugin.js +1079 -0
- package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/table/index.js +7 -0
- package/dist/libs/tinymce/plugins/table/plugin.js +3393 -0
- package/dist/libs/tinymce/plugins/table/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/template/index.js +7 -0
- package/dist/libs/tinymce/plugins/template/plugin.js +548 -0
- package/dist/libs/tinymce/plugins/template/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/visualblocks/index.js +7 -0
- package/dist/libs/tinymce/plugins/visualblocks/plugin.js +98 -0
- package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/visualchars/index.js +7 -0
- package/dist/libs/tinymce/plugins/visualchars/plugin.js +506 -0
- package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +4 -0
- package/dist/libs/tinymce/plugins/wordcount/index.js +7 -0
- package/dist/libs/tinymce/plugins/wordcount/plugin.js +404 -0
- package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +4 -0
- package/dist/libs/tinymce/skins/content/dark/content.css +66 -0
- package/dist/libs/tinymce/skins/content/dark/content.min.css +1 -0
- package/dist/libs/tinymce/skins/content/default/content.css +61 -0
- package/dist/libs/tinymce/skins/content/default/content.min.css +1 -0
- package/dist/libs/tinymce/skins/content/document/content.css +66 -0
- package/dist/libs/tinymce/skins/content/document/content.min.css +1 -0
- package/dist/libs/tinymce/skins/content/tinymce-5/content.css +61 -0
- package/dist/libs/tinymce/skins/content/tinymce-5/content.min.css +1 -0
- package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.css +66 -0
- package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.min.css +1 -0
- package/dist/libs/tinymce/skins/content/writer/content.css +62 -0
- package/dist/libs/tinymce/skins/content/writer/content.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide/content.css +747 -0
- package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +741 -0
- package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide/skin.css +3074 -0
- package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.css +30 -0
- package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +728 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +741 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +3077 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +30 -0
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +747 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +741 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +3158 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +728 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +741 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +3158 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
- package/dist/libs/tinymce/themes/silver/index.js +7 -0
- package/dist/libs/tinymce/themes/silver/theme.js +26184 -0
- package/dist/libs/tinymce/themes/silver/theme.min.js +4 -0
- package/dist/libs/tinymce/tinymce.d.ts +2895 -0
- package/dist/libs/tinymce/tinymce.js +29400 -0
- package/dist/libs/tinymce/tinymce.min.js +4 -0
- package/dist/libs/tom-select/dist/js/plugins/caret_position.js +170 -0
- package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/change_listener.js +58 -0
- package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +182 -0
- package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/clear_button.js +99 -0
- package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +70 -0
- package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +126 -0
- package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +240 -0
- package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +84 -0
- package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +33 -0
- package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +40 -0
- package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +117 -0
- package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/remove_button.js +154 -0
- package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +51 -0
- package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -0
- package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +279 -0
- package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -0
- package/dist/libs/tom-select/dist/js/tom-select.base.js +4165 -0
- package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -0
- package/dist/libs/tom-select/dist/js/tom-select.base.min.js +303 -0
- package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -0
- package/dist/libs/tom-select/dist/js/tom-select.complete.js +4978 -0
- package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -0
- package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +363 -0
- package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -0
- package/dist/libs/tom-select/dist/js/tom-select.popular.js +4419 -0
- package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -0
- package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +323 -0
- package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -0
- package/package.json +115 -32
- package/src/js/demo.js +97 -0
- package/src/js/{autosize.js → src/autosize.js} +0 -0
- package/src/js/src/dropdown.js +9 -0
- package/src/js/{input-mask.js → src/input-mask.js} +0 -0
- package/src/js/{popover.js → src/popover.js} +0 -0
- package/src/js/{switch-icon.js → src/switch-icon.js} +0 -0
- package/src/js/src/tab.js +16 -0
- package/src/js/{toast.js → src/toast.js} +0 -0
- package/src/js/{tooltip.js → src/tooltip.js} +0 -0
- package/src/js/tabler.esm.js +10 -0
- package/src/js/tabler.js +10 -7
- package/src/scss/_bootstrap-components.scss +3 -0
- package/src/scss/_bootstrap-config.scss +2 -0
- package/src/scss/{_tabler-core.scss → _core.scss} +6 -2
- package/src/scss/_mixins-override.scss +29 -29
- package/src/scss/_utilities.scss +18 -23
- package/src/scss/_variables.scss +183 -95
- package/src/scss/demo/_examples.scss +11 -2
- package/src/scss/demo/_highlight.scss +0 -1
- package/src/scss/demo.scss +33 -4
- package/src/scss/fonts/_webfonts.scss +56 -6
- package/src/scss/layout/_core.scss +63 -5
- package/src/scss/layout/_dark.scss +199 -0
- package/src/scss/layout/_footer.scss +2 -5
- package/src/scss/layout/_navbar.scss +32 -20
- package/src/scss/layout/_page.scss +80 -15
- package/src/scss/mixins/_functions.scss +2 -6
- package/src/scss/mixins/_mixins.scss +47 -32
- package/src/scss/tabler-vendors.scss +7 -2
- package/src/scss/tabler.scss +1 -1
- package/src/scss/ui/_accordion.scss +5 -0
- package/src/scss/ui/_alerts.scss +14 -9
- package/src/scss/ui/_avatars.scss +21 -16
- package/src/scss/ui/_badges.scss +19 -6
- package/src/scss/ui/_breadcrumbs.scss +9 -17
- package/src/scss/ui/_buttons.scss +123 -112
- package/src/scss/ui/_calendars.scss +3 -3
- package/src/scss/ui/_cards.scss +189 -77
- package/src/scss/ui/_carousel.scss +68 -0
- package/src/scss/ui/_datagrid.scss +17 -0
- package/src/scss/ui/_dropdowns.scss +1 -0
- package/src/scss/ui/_flags.scss +1 -1
- package/src/scss/ui/_forms.scss +19 -10
- package/src/scss/ui/_grid.scss +23 -9
- package/src/scss/ui/_icons.scss +10 -3
- package/src/scss/ui/_images.scss +1 -1
- package/src/scss/ui/_legend.scss +1 -1
- package/src/scss/ui/_lists.scss +28 -2
- package/src/scss/ui/_markdown.scss +14 -28
- package/src/scss/ui/_modals.scss +2 -2
- package/src/scss/ui/_nav.scss +26 -36
- package/src/scss/ui/_offcanvas.scss +21 -0
- package/src/scss/ui/_placeholder.scss +9 -0
- package/src/scss/ui/_progress.scss +2 -1
- package/src/scss/ui/_ribbons.scss +7 -2
- package/src/scss/ui/_status.scss +173 -0
- package/src/scss/ui/_steps.scss +2 -2
- package/src/scss/ui/_switch-icon.scss +6 -5
- package/src/scss/ui/_tables.scss +53 -6
- package/src/scss/ui/_toasts.scss +17 -4
- package/src/scss/ui/_type.scss +9 -9
- package/src/scss/ui/forms/_form-check.scss +11 -3
- package/src/scss/ui/forms/_form-colorinput.scss +1 -1
- package/src/scss/ui/forms/_form-custom.scss +12 -0
- package/src/scss/ui/forms/_form-imagecheck.scss +5 -5
- package/src/scss/ui/forms/_form-selectgroup.scss +9 -3
- package/src/scss/ui/forms/_validation.scss +1 -1
- package/src/scss/utils/_background.scss +2 -2
- package/src/scss/utils/_colors.scss +10 -23
- package/src/scss/utils/_opacity.scss +1 -1
- package/src/scss/vendor/_apexcharts.scss +1 -47
- package/src/scss/vendor/_dropzone.scss +27 -0
- package/src/scss/vendor/_fslightbox.scss +13 -0
- package/src/scss/vendor/_jsvectormap.scss +48 -0
- package/src/scss/vendor/_litepicker.scss +8 -3
- package/src/scss/vendor/_nouislider.scss +3 -3
- package/src/scss/vendor/_plyr.scss +3 -0
- package/src/scss/vendor/_tinymce.scss +25 -0
- package/src/scss/vendor/_tom-select.scss +14 -0
- package/dist/libs/choices.js/public/assets/scripts/choices.js +0 -5603
- package/dist/libs/nouislider/distribute/nouislider.min.js +0 -2
- package/src/js/dropdown.js +0 -40
- package/src/scss/_dark.scss +0 -105
- package/src/scss/ui/_skeleton.scss +0 -98
- package/src/scss/vendor/_choices.scss +0 -61
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tom Select v2.1.0
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.input_autogrow = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Converts a scalar to its best string representation
|
|
14
|
+
* for hash keys and HTML attribute values.
|
|
15
|
+
*
|
|
16
|
+
* Transformations:
|
|
17
|
+
* 'str' -> 'str'
|
|
18
|
+
* null -> ''
|
|
19
|
+
* undefined -> ''
|
|
20
|
+
* true -> '1'
|
|
21
|
+
* false -> '0'
|
|
22
|
+
* 0 -> '0'
|
|
23
|
+
* 1 -> '1'
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Prevent default
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const addEvent = (target, type, callback, options) => {
|
|
32
|
+
target.addEventListener(type, callback, options);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Plugin: "input_autogrow" (Tom Select)
|
|
37
|
+
*
|
|
38
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
|
39
|
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
|
40
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
41
|
+
*
|
|
42
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
43
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
44
|
+
* ANY KIND, either express or implied. See the License for the specific language
|
|
45
|
+
* governing permissions and limitations under the License.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
function plugin () {
|
|
49
|
+
var self = this;
|
|
50
|
+
self.on('initialize', () => {
|
|
51
|
+
var test_input = document.createElement('span');
|
|
52
|
+
var control = self.control_input;
|
|
53
|
+
test_input.style.cssText = 'position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ';
|
|
54
|
+
self.wrapper.appendChild(test_input);
|
|
55
|
+
var transfer_styles = ['letterSpacing', 'fontSize', 'fontFamily', 'fontWeight', 'textTransform'];
|
|
56
|
+
|
|
57
|
+
for (const style_name of transfer_styles) {
|
|
58
|
+
// @ts-ignore TS7015 https://stackoverflow.com/a/50506154/697576
|
|
59
|
+
test_input.style[style_name] = control.style[style_name];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Set the control width
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
var resize = () => {
|
|
68
|
+
test_input.textContent = control.value;
|
|
69
|
+
control.style.width = test_input.clientWidth + 'px';
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
resize();
|
|
73
|
+
self.on('update item_add item_remove', resize);
|
|
74
|
+
addEvent(control, 'input', resize);
|
|
75
|
+
addEvent(control, 'keyup', resize);
|
|
76
|
+
addEvent(control, 'blur', resize);
|
|
77
|
+
addEvent(control, 'update', resize);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return plugin;
|
|
82
|
+
|
|
83
|
+
}));
|
|
84
|
+
//# sourceMappingURL=input_autogrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input_autogrow.js","sources":["../../../src/utils.ts","../../../src/plugins/input_autogrow/plugin.ts"],"sourcesContent":["\nimport TomSelect from './tom-select';\nimport { TomLoadCallback } from './types/index';\n\n\n/**\n * Converts a scalar to its best string representation\n * for hash keys and HTML attribute values.\n *\n * Transformations:\n * 'str' -> 'str'\n * null -> ''\n * undefined -> ''\n * true -> '1'\n * false -> '0'\n * 0 -> '0'\n * 1 -> '1'\n *\n */\nexport const hash_key = (value:undefined|null|boolean|string):string|null => {\n\tif (typeof value === 'undefined' || value === null) return null;\n\treturn get_hash(value);\n};\n\nexport const get_hash = (value:boolean|string):string => {\n\tif (typeof value === 'boolean') return value ? '1' : '0';\n\treturn value + '';\n};\n\n/**\n * Escapes a string for use within HTML.\n *\n */\nexport const escape_html = (str:string):string => {\n\treturn (str + '')\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"');\n};\n\n\n/**\n * Debounce the user provided load function\n *\n */\nexport const loadDebounce = (fn:(value:string,callback:TomLoadCallback) => void,delay:number) => {\n\tvar timeout: null|ReturnType<typeof setTimeout>;\n\treturn function(this:TomSelect, value:string,callback:TomLoadCallback) {\n\t\tvar self = this;\n\n\t\tif( timeout ){\n\t\t\tself.loading = Math.max(self.loading - 1, 0);\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tself.loadedSearches[value] = true;\n\t\t\tfn.call(self, value, callback);\n\n\t\t}, delay);\n\t};\n};\n\n\n/**\n * Debounce all fired events types listed in `types`\n * while executing the provided `fn`.\n *\n */\nexport const debounce_events = ( self:TomSelect, types:string[], fn:() => void ) => {\n\tvar type:string;\n\tvar trigger = self.trigger;\n\tvar event_args:{ [key: string]: any } = {};\n\n\t// override trigger method\n\tself.trigger = function(){\n\t\tvar type = arguments[0];\n\t\tif (types.indexOf(type) !== -1) {\n\t\t\tevent_args[type] = arguments;\n\t\t} else {\n\t\t\treturn trigger.apply(self, arguments);\n\t\t}\n\t};\n\n\t// invoke provided function\n\tfn.apply(self, []);\n\tself.trigger = trigger;\n\n\t// trigger queued events\n\tfor( type of types ){\n\t\tif( type in event_args ){\n\t\t\ttrigger.apply(self, event_args[type]);\n\t\t}\n\t}\n};\n\n\n/**\n * Determines the current selection within a text input control.\n * Returns an object containing:\n * - start\n * - length\n *\n */\nexport const getSelection = (input:HTMLInputElement):{ start: number; length: number } => {\n\treturn {\n\t\tstart\t: input.selectionStart || 0,\n\t\tlength\t: (input.selectionEnd||0) - (input.selectionStart||0),\n\t};\n};\n\n\n/**\n * Prevent default\n *\n */\nexport const preventDefault = (evt?:Event, stop:boolean=false):void => {\n\tif( evt ){\n\t\tevt.preventDefault();\n\t\tif( stop ){\n\t\t\tevt.stopPropagation();\n\t\t}\n\t}\n}\n\n\n/**\n * Prevent default\n *\n */\nexport const addEvent = (target:EventTarget, type:string, callback:EventListenerOrEventListenerObject, options?:object):void => {\n\ttarget.addEventListener(type,callback,options);\n};\n\n\n/**\n * Return true if the requested key is down\n * Will return false if more than one control character is pressed ( when [ctrl+shift+a] != [ctrl+a] )\n * The current evt may not always set ( eg calling advanceSelection() )\n *\n */\nexport const isKeyDown = ( key_name:keyof (KeyboardEvent|MouseEvent), evt?:KeyboardEvent|MouseEvent ) => {\n\n\tif( !evt ){\n\t\treturn false;\n\t}\n\n\tif( !evt[key_name] ){\n\t\treturn false;\n\t}\n\n\tvar count = (evt.altKey?1:0) + (evt.ctrlKey?1:0) + (evt.shiftKey?1:0) + (evt.metaKey?1:0);\n\n\tif( count === 1 ){\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\n\n/**\n * Get the id of an element\n * If the id attribute is not set, set the attribute with the given id\n *\n */\nexport const getId = (el:Element,id:string) => {\n\tconst existing_id = el.getAttribute('id');\n\tif( existing_id ){\n\t\treturn existing_id;\n\t}\n\n\tel.setAttribute('id',id);\n\treturn id;\n};\n\n\n/**\n * Returns a string with backslashes added before characters that need to be escaped.\n */\nexport const addSlashes = (str:string):string => {\n\treturn str.replace(/[\\\\\"']/g, '\\\\$&');\n};\n\n/**\n *\n */\nexport const append = ( parent:Element|DocumentFragment, node: string|Node|null|undefined ):void =>{\n\tif( node ) parent.append(node);\n};\n","/**\n * Plugin: \"input_autogrow\" (Tom Select)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at:\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n *\n */\n\nimport TomSelect from '../../tom-select';\nimport { addEvent } from '../../utils';\n\nexport default function(this:TomSelect) {\n\tvar self\t\t\t\t\t= this;\n\n\tself.on('initialize',()=>{\n\n\n\t\tvar test_input\t\t\t\t= document.createElement('span');\n\t\tvar control\t\t\t\t\t= self.control_input;\n\t\ttest_input.style.cssText\t= 'position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ';\n\n\t\tself.wrapper.appendChild(test_input);\n\n\n\t\tvar transfer_styles\t\t\t= [ 'letterSpacing', 'fontSize', 'fontFamily', 'fontWeight', 'textTransform' ];\n\n\t\tfor( const style_name of transfer_styles ){\n\t\t\t// @ts-ignore TS7015 https://stackoverflow.com/a/50506154/697576\n\t\t\ttest_input.style[style_name] = control.style[style_name];\n\t\t}\n\n\n\t\t/**\n\t\t * Set the control width\n\t\t *\n\t\t */\n\t\tvar resize = ()=>{\n\t\t\ttest_input.textContent\t= control.value;\n\t\t\tcontrol.style.width\t\t= test_input.clientWidth+'px';\n\t\t};\n\n\t\tresize();\n\t\tself.on('update item_add item_remove',resize);\n\t\taddEvent(control,'input', resize );\n\t\taddEvent(control,'keyup', resize );\n\t\taddEvent(control,'blur', resize );\n\t\taddEvent(control,'update', resize );\n\t});\n\n};\n"],"names":["addEvent","target","type","callback","options","addEventListener","self","on","test_input","document","createElement","control","control_input","style","cssText","wrapper","appendChild","transfer_styles","style_name","resize","textContent","value","width","clientWidth"],"mappings":";;;;;;;;;;;CAKA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CA6GA;CACA;CACA;CACA;;CACO,MAAMA,QAAQ,GAAG,CAACC,MAAD,EAAqBC,IAArB,EAAkCC,QAAlC,EAA+EC,OAA/E,KAAwG;CAC/HH,EAAAA,MAAM,CAACI,gBAAP,CAAwBH,IAAxB,EAA6BC,QAA7B,EAAsCC,OAAtC;CACA,CAFM;;CCnIP;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAKe,mBAAyB;CACvC,MAAIE,IAAI,GAAO,IAAf;CAEAA,EAAAA,IAAI,CAACC,EAAL,CAAQ,YAAR,EAAqB,MAAI;CAGxB,QAAIC,UAAU,GAAMC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CAApB;CACA,QAAIC,OAAO,GAAOL,IAAI,CAACM,aAAvB;CACAJ,IAAAA,UAAU,CAACK,KAAX,CAAiBC,OAAjB,GAA2B,0FAA3B;CAEAR,IAAAA,IAAI,CAACS,OAAL,CAAaC,WAAb,CAAyBR,UAAzB;CAGA,QAAIS,eAAe,GAAK,CAAE,eAAF,EAAmB,UAAnB,EAA+B,YAA/B,EAA6C,YAA7C,EAA2D,eAA3D,CAAxB;;CAEA,SAAK,MAAMC,UAAX,IAAyBD,eAAzB,EAA0C;CACzC;CACAT,MAAAA,UAAU,CAACK,KAAX,CAAiBK,UAAjB,IAA+BP,OAAO,CAACE,KAAR,CAAcK,UAAd,CAA/B;CACA;CAGD;CACF;CACA;CACA;;;CACE,QAAIC,MAAM,GAAG,MAAI;CAChBX,MAAAA,UAAU,CAACY,WAAX,GAAyBT,OAAO,CAACU,KAAjC;CACAV,MAAAA,OAAO,CAACE,KAAR,CAAcS,KAAd,GAAuBd,UAAU,CAACe,WAAX,GAAuB,IAA9C;CACA,KAHD;;CAKAJ,IAAAA,MAAM;CACNb,IAAAA,IAAI,CAACC,EAAL,CAAQ,6BAAR,EAAsCY,MAAtC;CACAnB,IAAAA,QAAQ,CAACW,OAAD,EAAS,OAAT,EAAkBQ,MAAlB,CAAR;CACAnB,IAAAA,QAAQ,CAACW,OAAD,EAAS,OAAT,EAAkBQ,MAAlB,CAAR;CACAnB,IAAAA,QAAQ,CAACW,OAAD,EAAS,MAAT,EAAiBQ,MAAjB,CAAR;CACAnB,IAAAA,QAAQ,CAACW,OAAD,EAAS,QAAT,EAAmBQ,MAAnB,CAAR;CACA,GAjCD;CAmCA;;;;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tom Select v2.1.0
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.no_active_items = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Plugin: "no_active_items" (Tom Select)
|
|
14
|
+
*
|
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
|
16
|
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
21
|
+
* ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
* governing permissions and limitations under the License.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
function plugin () {
|
|
26
|
+
this.hook('instead', 'setActiveItem', () => {});
|
|
27
|
+
this.hook('instead', 'selectAll', () => {});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return plugin;
|
|
31
|
+
|
|
32
|
+
}));
|
|
33
|
+
//# sourceMappingURL=no_active_items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no_active_items.js","sources":["../../../src/plugins/no_active_items/plugin.ts"],"sourcesContent":["/**\n * Plugin: \"no_active_items\" (Tom Select)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at:\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n *\n */\n\nimport TomSelect from '../../tom-select';\n\nexport default function(this:TomSelect) {\n\tthis.hook('instead','setActiveItem',() => {});\n\tthis.hook('instead','selectAll',() => {});\n};\n"],"names":["hook"],"mappings":";;;;;;;;;;;CAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAIe,mBAAyB;CACvC,OAAKA,IAAL,CAAU,SAAV,EAAoB,eAApB,EAAoC,MAAM,EAA1C;CACA,OAAKA,IAAL,CAAU,SAAV,EAAoB,WAApB,EAAgC,MAAM,EAAtC;CACA;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tom Select v2.1.0
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.no_backspace_delete = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Plugin: "input_autogrow" (Tom Select)
|
|
14
|
+
*
|
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
|
16
|
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
21
|
+
* ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
* governing permissions and limitations under the License.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
function plugin () {
|
|
26
|
+
var self = this;
|
|
27
|
+
var orig_deleteSelection = self.deleteSelection;
|
|
28
|
+
this.hook('instead', 'deleteSelection', evt => {
|
|
29
|
+
if (self.activeItems.length) {
|
|
30
|
+
return orig_deleteSelection.call(self, evt);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return plugin;
|
|
38
|
+
|
|
39
|
+
}));
|
|
40
|
+
//# sourceMappingURL=no_backspace_delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no_backspace_delete.js","sources":["../../../src/plugins/no_backspace_delete/plugin.ts"],"sourcesContent":["/**\n * Plugin: \"input_autogrow\" (Tom Select)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at:\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n *\n */\n\nimport TomSelect from '../../tom-select';\n\nexport default function(this:TomSelect) {\n\tvar self = this;\n\tvar orig_deleteSelection = self.deleteSelection;\n\n\tthis.hook('instead','deleteSelection',(evt:KeyboardEvent) => {\n\n\t\tif( self.activeItems.length ){\n\t\t\treturn orig_deleteSelection.call(self, evt);\n\t\t}\n\n\t\treturn false;\n\t});\n\n};\n"],"names":["self","orig_deleteSelection","deleteSelection","hook","evt","activeItems","length","call"],"mappings":";;;;;;;;;;;CAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAIe,mBAAyB;CACvC,MAAIA,IAAI,GAAG,IAAX;CACA,MAAIC,oBAAoB,GAAGD,IAAI,CAACE,eAAhC;CAEA,OAAKC,IAAL,CAAU,SAAV,EAAoB,iBAApB,EAAuCC,GAAD,IAAuB;CAE5D,QAAIJ,IAAI,CAACK,WAAL,CAAiBC,MAArB,EAA6B;CAC5B,aAAOL,oBAAoB,CAACM,IAArB,CAA0BP,IAA1B,EAAgCI,GAAhC,CAAP;CACA;;CAED,WAAO,KAAP;CACA,GAPD;CASA;;;;;;;;"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tom Select v2.1.0
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.optgroup_columns = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
const KEY_LEFT = 37;
|
|
13
|
+
const KEY_RIGHT = 39;
|
|
14
|
+
typeof navigator === 'undefined' ? false : /Mac/.test(navigator.userAgent);
|
|
15
|
+
// ctrl key or apple key for ma
|
|
16
|
+
|
|
17
|
+
// @ts-ignore TS2691 "An import path cannot end with a '.ts' extension"
|
|
18
|
+
const latin_convert = {
|
|
19
|
+
'æ': 'ae',
|
|
20
|
+
'ⱥ': 'a',
|
|
21
|
+
'ø': 'o'
|
|
22
|
+
};
|
|
23
|
+
new RegExp(Object.keys(latin_convert).join('|'), 'gu');
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get the closest node to the evt.target matching the selector
|
|
27
|
+
* Stops at wrapper
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const parentMatch = (target, selector, wrapper) => {
|
|
32
|
+
if (wrapper && !wrapper.contains(target)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
while (target && target.matches) {
|
|
37
|
+
if (target.matches(selector)) {
|
|
38
|
+
return target;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
target = target.parentNode;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get the index of an element amongst sibling nodes of the same type
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
const nodeIndex = (el, amongst) => {
|
|
50
|
+
if (!el) return -1;
|
|
51
|
+
amongst = amongst || el.nodeName;
|
|
52
|
+
var i = 0;
|
|
53
|
+
|
|
54
|
+
while (el = el.previousElementSibling) {
|
|
55
|
+
if (el.matches(amongst)) {
|
|
56
|
+
i++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return i;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Plugin: "optgroup_columns" (Tom Select.js)
|
|
65
|
+
* Copyright (c) contributors
|
|
66
|
+
*
|
|
67
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
|
68
|
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
|
69
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
70
|
+
*
|
|
71
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
72
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
73
|
+
* ANY KIND, either express or implied. See the License for the specific language
|
|
74
|
+
* governing permissions and limitations under the License.
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
function plugin () {
|
|
78
|
+
var self = this;
|
|
79
|
+
var orig_keydown = self.onKeyDown;
|
|
80
|
+
self.hook('instead', 'onKeyDown', evt => {
|
|
81
|
+
var index, option, options, optgroup;
|
|
82
|
+
|
|
83
|
+
if (!self.isOpen || !(evt.keyCode === KEY_LEFT || evt.keyCode === KEY_RIGHT)) {
|
|
84
|
+
return orig_keydown.call(self, evt);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
self.ignoreHover = true;
|
|
88
|
+
optgroup = parentMatch(self.activeOption, '[data-group]');
|
|
89
|
+
index = nodeIndex(self.activeOption, '[data-selectable]');
|
|
90
|
+
|
|
91
|
+
if (!optgroup) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (evt.keyCode === KEY_LEFT) {
|
|
96
|
+
optgroup = optgroup.previousSibling;
|
|
97
|
+
} else {
|
|
98
|
+
optgroup = optgroup.nextSibling;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!optgroup) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
options = optgroup.querySelectorAll('[data-selectable]');
|
|
106
|
+
option = options[Math.min(options.length - 1, index)];
|
|
107
|
+
|
|
108
|
+
if (option) {
|
|
109
|
+
self.setActiveOption(option);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return plugin;
|
|
115
|
+
|
|
116
|
+
}));
|
|
117
|
+
//# sourceMappingURL=optgroup_columns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optgroup_columns.js","sources":["../../../src/constants.ts","../../../node_modules/@orchidjs/sifter/lib/diacritics.ts","../../../src/vanilla.ts","../../../src/plugins/optgroup_columns/plugin.ts"],"sourcesContent":["export const KEY_A\t\t\t\t= 65;\nexport const KEY_RETURN\t\t\t= 13;\nexport const KEY_ESC\t\t\t= 27;\nexport const KEY_LEFT\t\t\t= 37;\nexport const KEY_UP\t\t\t\t= 38;\nexport const KEY_RIGHT\t\t\t= 39;\nexport const KEY_DOWN\t\t\t= 40;\nexport const KEY_BACKSPACE\t\t= 8;\nexport const KEY_DELETE\t\t\t= 46;\nexport const KEY_TAB\t\t\t= 9;\n\nexport const IS_MAC \t\t= typeof navigator === 'undefined' ? false : /Mac/.test(navigator.userAgent);\nexport const KEY_SHORTCUT\t\t= IS_MAC ? 'metaKey' : 'ctrlKey'; // ctrl key or apple key for ma\n","\n// @ts-ignore TS2691 \"An import path cannot end with a '.ts' extension\"\nimport { escape_regex } from './utils.ts';\n\ntype TDiacraticList = {[key:string]:string};\n\n// https://github.com/andrewrk/node-diacritics/blob/master/index.js\n\nvar latin_pat:RegExp;\nconst accent_pat = '[\\u0300-\\u036F\\u{b7}\\u{2be}]'; // \\u{2bc}\nconst accent_reg = new RegExp(accent_pat,'gu');\nvar diacritic_patterns:TDiacraticList;\n\nconst latin_convert:TDiacraticList = {\n\t'æ': 'ae',\n\t'ⱥ': 'a',\n\t'ø': 'o',\n};\n\nconst convert_pat = new RegExp(Object.keys(latin_convert).join('|'),'gu');\n\nconst code_points:[[number,number]] = [[ 0, 65535 ]];\n\n/**\n * Remove accents\n * via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703\n *\n */\nexport const asciifold = (str:string):string => {\n\treturn str\n\t\t.normalize('NFKD')\n\t\t.replace(accent_reg, '')\n\t\t.toLowerCase()\n\t\t.replace(convert_pat,function(foreignletter) {\n\t\t\treturn latin_convert[foreignletter];\n\t\t});\n};\n\n/**\n * Convert array of strings to a regular expression\n *\tex ['ab','a'] => (?:ab|a)\n * \tex ['a','b'] => [ab]\n *\n */\nexport const arrayToPattern = (chars:string[],glue:string='|'):string =>{\n\n\tif( chars.length == 1 ){\n\t\treturn chars[0];\n\t}\n\n\tvar longest = 1;\n\tchars.forEach((a)=>{longest = Math.max(longest,a.length)});\n\n\tif( longest == 1 ){\n\t\treturn '['+chars.join('')+']';\n\t}\n\n\treturn '(?:'+chars.join(glue)+')';\n};\n\nexport const escapeToPattern = (chars:string[]):string =>{\n\tconst escaped = chars.map((diacritic) => escape_regex(diacritic));\n\treturn arrayToPattern(escaped);\n};\n\n/**\n * Get all possible combinations of substrings that add up to the given string\n * https://stackoverflow.com/questions/30169587/find-all-the-combination-of-substrings-that-add-up-to-the-given-string\n *\n */\nexport const allSubstrings = (input:string):string[][] => {\n\n if( input.length === 1) return [[input]];\n\n var result:string[][] = [];\n allSubstrings(input.substring(1)).forEach(function(subresult) {\n var tmp = subresult.slice(0);\n tmp[0] = input.charAt(0) + tmp[0];\n result.push(tmp);\n\n tmp = subresult.slice(0);\n tmp.unshift(input.charAt(0));\n result.push(tmp);\n });\n\n return result;\n}\n\n/**\n * Generate a list of diacritics from the list of code points\n *\n */\nexport const generateDiacritics = (code_points:[[number,number]]):TDiacraticList => {\n\n\tvar diacritics:{[key:string]:string[]} = {};\n\tcode_points.forEach((code_range)=>{\n\n\t\tfor(let i = code_range[0]; i <= code_range[1]; i++){\n\n\t\t\tlet diacritic\t= String.fromCharCode(i);\n\t\t\tlet\tlatin\t\t= asciifold(diacritic);\n\n\t\t\tif( latin == diacritic.toLowerCase() ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// skip when latin is a string longer than 3 characters long\n\t\t\t// bc the resulting regex patterns will be long\n\t\t\t// eg:\n\t\t\t// latin صلى الله عليه وسلم length 18 code point 65018\n\t\t\t// latin جل جلاله length 8 code point 65019\n\t\t\tif( latin.length > 3 ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif( !(latin in diacritics) ){\n\t\t\t\tdiacritics[latin] = [latin];\n\t\t\t}\n\n\t\t\tvar patt = new RegExp( escapeToPattern(diacritics[latin]),'iu');\n\t\t\tif( diacritic.match(patt) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdiacritics[latin].push(diacritic);\n\t\t}\n\t});\n\n\t// filter out if there's only one character in the list\n\tlet latin_chars = Object.keys(diacritics);\n\tfor( let i = 0; i < latin_chars.length; i++){\n\t\tconst latin = latin_chars[i];\n\t\tif( diacritics[latin].length < 2 ){\n\t\t\tdelete diacritics[latin];\n\t\t}\n\t}\n\n\n\t// latin character pattern\n\t// match longer substrings first\n\tlatin_chars\t\t= Object.keys(diacritics).sort((a, b) => b.length - a.length );\n\tlatin_pat\t\t= new RegExp('('+ escapeToPattern(latin_chars) + accent_pat + '*)','gu');\n\n\n\t// build diacritic patterns\n\t// ae needs:\n\t//\t(?:(?:ae|Æ|Ǽ|Ǣ)|(?:A|Ⓐ|A...)(?:E|ɛ|Ⓔ...))\n\tvar diacritic_patterns:TDiacraticList = {};\n\tlatin_chars.sort((a,b) => a.length -b.length).forEach((latin)=>{\n\n\t\tvar substrings\t= allSubstrings(latin);\n\t\tvar pattern = substrings.map((sub_pat)=>{\n\n\t\t\tsub_pat = sub_pat.map((l)=>{\n\t\t\t\tif( diacritics.hasOwnProperty(l) ){\n\t\t\t\t\treturn escapeToPattern(diacritics[l]);\n\t\t\t\t}\n\t\t\t\treturn l;\n\t\t\t});\n\n\t\t\treturn arrayToPattern(sub_pat,'');\n\t\t});\n\n\t\tdiacritic_patterns[latin] = arrayToPattern(pattern);\n\t});\n\n\n\treturn diacritic_patterns;\n}\n\n/**\n * Expand a regular expression pattern to include diacritics\n * \teg /a/ becomes /aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑAⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ/\n *\n */\nexport const diacriticRegexPoints = (regex:string):string => {\n\n\tif( diacritic_patterns === undefined ){\n\t\tdiacritic_patterns = generateDiacritics(code_points);\n\t}\n\n\tconst decomposed\t\t= regex.normalize('NFKD').toLowerCase();\n\n\treturn decomposed.split(latin_pat).map((part:string)=>{\n\n\t\t// \"ffl\" or \"ffl\"\n\t\tconst no_accent = asciifold(part);\n\t\tif( no_accent == '' ){\n\t\t\treturn '';\n\t\t}\n\n\t\tif( diacritic_patterns.hasOwnProperty(no_accent) ){\n\t\t\treturn diacritic_patterns[no_accent];\n\t\t}\n\n\t\treturn part;\n\t}).join('');\n\n}\n","\nimport { iterate } from '@orchidjs/sifter/lib/utils';\n\n/**\n * Return a dom element from either a dom query string, jQuery object, a dom element or html string\n * https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518\n *\n * param query should be {}\n */\nexport const getDom = ( query:any ):HTMLElement => {\n\n\tif( query.jquery ){\n\t\treturn query[0];\n\t}\n\n\tif( query instanceof HTMLElement ){\n\t\treturn query;\n\t}\n\n\tif( isHtmlString(query) ){\n\t\tlet div = document.createElement('div');\n\t\tdiv.innerHTML = query.trim(); // Never return a text node of whitespace as the result\n\t\treturn div.firstChild as HTMLElement;\n\t}\n\n\treturn document.querySelector(query);\n};\n\nexport const isHtmlString = (arg:any): boolean => {\n\tif( typeof arg === 'string' && arg.indexOf('<') > -1 ){\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport const escapeQuery = (query:string):string => {\n\treturn query.replace(/['\"\\\\]/g, '\\\\$&');\n}\n\n/**\n * Dispatch an event\n *\n */\nexport const triggerEvent = ( dom_el:HTMLElement, event_name:string ):void => {\n\tvar event = document.createEvent('HTMLEvents');\n\tevent.initEvent(event_name, true, false);\n\tdom_el.dispatchEvent(event)\n};\n\n/**\n * Apply CSS rules to a dom element\n *\n */\nexport const applyCSS = ( dom_el:HTMLElement, css:{ [key: string]: string|number }):void => {\n\tObject.assign(dom_el.style, css);\n}\n\n\n/**\n * Add css classes\n *\n */\nexport const addClasses = ( elmts:HTMLElement|HTMLElement[], ...classes:string[]|string[][] ) => {\n\n\tvar norm_classes \t= classesArray(classes);\n\telmts\t\t\t\t= castAsArray(elmts);\n\n\telmts.map( el => {\n\t\tnorm_classes.map( cls => {\n\t\t\tel.classList.add( cls );\n\t\t});\n\t});\n}\n\n/**\n * Remove css classes\n *\n */\n export const removeClasses = ( elmts:HTMLElement|HTMLElement[], ...classes:string[]|string[][] ) => {\n\n \tvar norm_classes \t= classesArray(classes);\n\telmts\t\t\t\t= castAsArray(elmts);\n\n\telmts.map( el => {\n\t\tnorm_classes.map(cls => {\n\t \t\tel.classList.remove( cls );\n\t\t});\n \t});\n }\n\n\n/**\n * Return arguments\n *\n */\nexport const classesArray = (args:string[]|string[][]):string[] => {\n\tvar classes:string[] = [];\n\titerate( args, (_classes) =>{\n\t\tif( typeof _classes === 'string' ){\n\t\t\t_classes = _classes.trim().split(/[\\11\\12\\14\\15\\40]/);\n\t\t}\n\t\tif( Array.isArray(_classes) ){\n\t\t\tclasses = classes.concat(_classes);\n\t\t}\n\t});\n\n\treturn classes.filter(Boolean);\n}\n\n\n/**\n * Create an array from arg if it's not already an array\n *\n */\nexport const castAsArray = (arg:any):Array<any> => {\n\tif( !Array.isArray(arg) ){\n \t\targ = [arg];\n \t}\n\treturn arg;\n}\n\n\n/**\n * Get the closest node to the evt.target matching the selector\n * Stops at wrapper\n *\n */\nexport const parentMatch = ( target:null|HTMLElement, selector:string, wrapper?:HTMLElement ):HTMLElement|void => {\n\n\tif( wrapper && !wrapper.contains(target) ){\n\t\treturn;\n\t}\n\n\twhile( target && target.matches ){\n\n\t\tif( target.matches(selector) ){\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget = target.parentNode as HTMLElement;\n\t}\n}\n\n\n/**\n * Get the first or last item from an array\n *\n * > 0 - right (last)\n * <= 0 - left (first)\n *\n */\nexport const getTail = ( list:Array<any>|NodeList, direction:number=0 ):any => {\n\n\tif( direction > 0 ){\n\t\treturn list[list.length-1];\n\t}\n\n\treturn list[0];\n}\n\n/**\n * Return true if an object is empty\n *\n */\nexport const isEmptyObject = (obj:object):boolean => {\n\treturn (Object.keys(obj).length === 0);\n}\n\n\n/**\n * Get the index of an element amongst sibling nodes of the same type\n *\n */\nexport const nodeIndex = ( el:null|Element, amongst?:string ):number => {\n\tif (!el) return -1;\n\n\tamongst = amongst || el.nodeName;\n\n\tvar i = 0;\n\twhile( el = el.previousElementSibling ){\n\n\t\tif( el.matches(amongst) ){\n\t\t\ti++;\n\t\t}\n\t}\n\treturn i;\n}\n\n\n/**\n * Set attributes of an element\n *\n */\nexport const setAttr = (el:Element,attrs:{ [key: string]: null|string|number }) => {\n\titerate( attrs,(val,attr) => {\n\t\tif( val == null ){\n\t\t\tel.removeAttribute(attr as string);\n\t\t}else{\n\t\t\tel.setAttribute(attr as string, ''+val);\n\t\t}\n\t});\n}\n\n\n/**\n * Replace a node\n */\nexport const replaceNode = ( existing:Node, replacement:Node ) => {\n\tif( existing.parentNode ) existing.parentNode.replaceChild(replacement, existing);\n}\n","/**\n * Plugin: \"optgroup_columns\" (Tom Select.js)\n * Copyright (c) contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at:\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n *\n */\n\nimport TomSelect from '../../tom-select';\nimport * as constants from '../../constants';\nimport { parentMatch, nodeIndex } from '../../vanilla';\n\nexport default function(this:TomSelect) {\n\tvar self = this;\n\n\tvar orig_keydown = self.onKeyDown;\n\n\tself.hook('instead','onKeyDown',(evt:KeyboardEvent)=>{\n\t\tvar index, option, options, optgroup;\n\n\t\tif( !self.isOpen || !(evt.keyCode === constants.KEY_LEFT || evt.keyCode === constants.KEY_RIGHT)) {\n\t\t\treturn orig_keydown.call(self,evt);\n\t\t}\n\n\t\tself.ignoreHover\t= true;\n\t\toptgroup\t\t\t= parentMatch(self.activeOption,'[data-group]');\n\t\tindex\t\t\t\t= nodeIndex(self.activeOption,'[data-selectable]');\n\n\t\tif( !optgroup ){\n\t\t\treturn;\n\t\t}\n\n\t\tif( evt.keyCode === constants.KEY_LEFT ){\n\t\t\toptgroup = optgroup.previousSibling;\n\t\t} else {\n\t\t\toptgroup = optgroup.nextSibling;\n\t\t}\n\n\t\tif( !optgroup ){\n\t\t\treturn;\n\t\t}\n\n\t\toptions\t\t\t\t= (<HTMLOptGroupElement>optgroup).querySelectorAll('[data-selectable]');\n\t\toption\t\t\t\t= options[ Math.min(options.length - 1, index) ] as HTMLElement;\n\n\t\tif( option ){\n\t\t\tself.setActiveOption(option);\n\t\t}\n\n\t});\n\n};\n"],"names":["KEY_LEFT","KEY_RIGHT","navigator","test","userAgent","latin_convert","RegExp","Object","keys","join","parentMatch","target","selector","wrapper","contains","matches","parentNode","nodeIndex","el","amongst","nodeName","i","previousElementSibling","self","orig_keydown","onKeyDown","hook","evt","index","option","options","optgroup","isOpen","keyCode","constants","call","ignoreHover","activeOption","previousSibling","nextSibling","querySelectorAll","Math","min","length","setActiveOption"],"mappings":"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"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tom Select v2.1.0
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.remove_button = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
// @ts-ignore TS2691 "An import path cannot end with a '.ts' extension"
|
|
13
|
+
const latin_convert = {
|
|
14
|
+
'æ': 'ae',
|
|
15
|
+
'ⱥ': 'a',
|
|
16
|
+
'ø': 'o'
|
|
17
|
+
};
|
|
18
|
+
new RegExp(Object.keys(latin_convert).join('|'), 'gu');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Return a dom element from either a dom query string, jQuery object, a dom element or html string
|
|
22
|
+
* https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518
|
|
23
|
+
*
|
|
24
|
+
* param query should be {}
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const getDom = query => {
|
|
28
|
+
if (query.jquery) {
|
|
29
|
+
return query[0];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (query instanceof HTMLElement) {
|
|
33
|
+
return query;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (isHtmlString(query)) {
|
|
37
|
+
let div = document.createElement('div');
|
|
38
|
+
div.innerHTML = query.trim(); // Never return a text node of whitespace as the result
|
|
39
|
+
|
|
40
|
+
return div.firstChild;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return document.querySelector(query);
|
|
44
|
+
};
|
|
45
|
+
const isHtmlString = arg => {
|
|
46
|
+
if (typeof arg === 'string' && arg.indexOf('<') > -1) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Converts a scalar to its best string representation
|
|
55
|
+
* for hash keys and HTML attribute values.
|
|
56
|
+
*
|
|
57
|
+
* Transformations:
|
|
58
|
+
* 'str' -> 'str'
|
|
59
|
+
* null -> ''
|
|
60
|
+
* undefined -> ''
|
|
61
|
+
* true -> '1'
|
|
62
|
+
* false -> '0'
|
|
63
|
+
* 0 -> '0'
|
|
64
|
+
* 1 -> '1'
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Escapes a string for use within HTML.
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
const escape_html = str => {
|
|
73
|
+
return (str + '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Prevent default
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
const preventDefault = (evt, stop = false) => {
|
|
81
|
+
if (evt) {
|
|
82
|
+
evt.preventDefault();
|
|
83
|
+
|
|
84
|
+
if (stop) {
|
|
85
|
+
evt.stopPropagation();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Prevent default
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
const addEvent = (target, type, callback, options) => {
|
|
95
|
+
target.addEventListener(type, callback, options);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Plugin: "remove_button" (Tom Select)
|
|
100
|
+
* Copyright (c) contributors
|
|
101
|
+
*
|
|
102
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
|
103
|
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
|
104
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
105
|
+
*
|
|
106
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
107
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
108
|
+
* ANY KIND, either express or implied. See the License for the specific language
|
|
109
|
+
* governing permissions and limitations under the License.
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
function plugin (userOptions) {
|
|
113
|
+
const options = Object.assign({
|
|
114
|
+
label: '×',
|
|
115
|
+
title: 'Remove',
|
|
116
|
+
className: 'remove',
|
|
117
|
+
append: true
|
|
118
|
+
}, userOptions); //options.className = 'remove-single';
|
|
119
|
+
|
|
120
|
+
var self = this; // override the render method to add remove button to each item
|
|
121
|
+
|
|
122
|
+
if (!options.append) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var html = '<a href="javascript:void(0)" class="' + options.className + '" tabindex="-1" title="' + escape_html(options.title) + '">' + options.label + '</a>';
|
|
127
|
+
self.hook('after', 'setupTemplates', () => {
|
|
128
|
+
var orig_render_item = self.settings.render.item;
|
|
129
|
+
|
|
130
|
+
self.settings.render.item = (data, escape) => {
|
|
131
|
+
var item = getDom(orig_render_item.call(self, data, escape));
|
|
132
|
+
var close_button = getDom(html);
|
|
133
|
+
item.appendChild(close_button);
|
|
134
|
+
addEvent(close_button, 'mousedown', evt => {
|
|
135
|
+
preventDefault(evt, true);
|
|
136
|
+
});
|
|
137
|
+
addEvent(close_button, 'click', evt => {
|
|
138
|
+
// propagating will trigger the dropdown to show for single mode
|
|
139
|
+
preventDefault(evt, true);
|
|
140
|
+
if (self.isLocked) return;
|
|
141
|
+
if (!self.shouldDelete([item], evt)) return;
|
|
142
|
+
self.removeItem(item);
|
|
143
|
+
self.refreshOptions(false);
|
|
144
|
+
self.inputState();
|
|
145
|
+
});
|
|
146
|
+
return item;
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return plugin;
|
|
152
|
+
|
|
153
|
+
}));
|
|
154
|
+
//# sourceMappingURL=remove_button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove_button.js","sources":["../../../node_modules/@orchidjs/sifter/lib/diacritics.ts","../../../src/vanilla.ts","../../../src/utils.ts","../../../src/plugins/remove_button/plugin.ts"],"sourcesContent":["\n// @ts-ignore TS2691 \"An import path cannot end with a '.ts' extension\"\nimport { escape_regex } from './utils.ts';\n\ntype TDiacraticList = {[key:string]:string};\n\n// https://github.com/andrewrk/node-diacritics/blob/master/index.js\n\nvar latin_pat:RegExp;\nconst accent_pat = '[\\u0300-\\u036F\\u{b7}\\u{2be}]'; // \\u{2bc}\nconst accent_reg = new RegExp(accent_pat,'gu');\nvar diacritic_patterns:TDiacraticList;\n\nconst latin_convert:TDiacraticList = {\n\t'æ': 'ae',\n\t'ⱥ': 'a',\n\t'ø': 'o',\n};\n\nconst convert_pat = new RegExp(Object.keys(latin_convert).join('|'),'gu');\n\nconst code_points:[[number,number]] = [[ 0, 65535 ]];\n\n/**\n * Remove accents\n * via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703\n *\n */\nexport const asciifold = (str:string):string => {\n\treturn str\n\t\t.normalize('NFKD')\n\t\t.replace(accent_reg, '')\n\t\t.toLowerCase()\n\t\t.replace(convert_pat,function(foreignletter) {\n\t\t\treturn latin_convert[foreignletter];\n\t\t});\n};\n\n/**\n * Convert array of strings to a regular expression\n *\tex ['ab','a'] => (?:ab|a)\n * \tex ['a','b'] => [ab]\n *\n */\nexport const arrayToPattern = (chars:string[],glue:string='|'):string =>{\n\n\tif( chars.length == 1 ){\n\t\treturn chars[0];\n\t}\n\n\tvar longest = 1;\n\tchars.forEach((a)=>{longest = Math.max(longest,a.length)});\n\n\tif( longest == 1 ){\n\t\treturn '['+chars.join('')+']';\n\t}\n\n\treturn '(?:'+chars.join(glue)+')';\n};\n\nexport const escapeToPattern = (chars:string[]):string =>{\n\tconst escaped = chars.map((diacritic) => escape_regex(diacritic));\n\treturn arrayToPattern(escaped);\n};\n\n/**\n * Get all possible combinations of substrings that add up to the given string\n * https://stackoverflow.com/questions/30169587/find-all-the-combination-of-substrings-that-add-up-to-the-given-string\n *\n */\nexport const allSubstrings = (input:string):string[][] => {\n\n if( input.length === 1) return [[input]];\n\n var result:string[][] = [];\n allSubstrings(input.substring(1)).forEach(function(subresult) {\n var tmp = subresult.slice(0);\n tmp[0] = input.charAt(0) + tmp[0];\n result.push(tmp);\n\n tmp = subresult.slice(0);\n tmp.unshift(input.charAt(0));\n result.push(tmp);\n });\n\n return result;\n}\n\n/**\n * Generate a list of diacritics from the list of code points\n *\n */\nexport const generateDiacritics = (code_points:[[number,number]]):TDiacraticList => {\n\n\tvar diacritics:{[key:string]:string[]} = {};\n\tcode_points.forEach((code_range)=>{\n\n\t\tfor(let i = code_range[0]; i <= code_range[1]; i++){\n\n\t\t\tlet diacritic\t= String.fromCharCode(i);\n\t\t\tlet\tlatin\t\t= asciifold(diacritic);\n\n\t\t\tif( latin == diacritic.toLowerCase() ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// skip when latin is a string longer than 3 characters long\n\t\t\t// bc the resulting regex patterns will be long\n\t\t\t// eg:\n\t\t\t// latin صلى الله عليه وسلم length 18 code point 65018\n\t\t\t// latin جل جلاله length 8 code point 65019\n\t\t\tif( latin.length > 3 ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif( !(latin in diacritics) ){\n\t\t\t\tdiacritics[latin] = [latin];\n\t\t\t}\n\n\t\t\tvar patt = new RegExp( escapeToPattern(diacritics[latin]),'iu');\n\t\t\tif( diacritic.match(patt) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdiacritics[latin].push(diacritic);\n\t\t}\n\t});\n\n\t// filter out if there's only one character in the list\n\tlet latin_chars = Object.keys(diacritics);\n\tfor( let i = 0; i < latin_chars.length; i++){\n\t\tconst latin = latin_chars[i];\n\t\tif( diacritics[latin].length < 2 ){\n\t\t\tdelete diacritics[latin];\n\t\t}\n\t}\n\n\n\t// latin character pattern\n\t// match longer substrings first\n\tlatin_chars\t\t= Object.keys(diacritics).sort((a, b) => b.length - a.length );\n\tlatin_pat\t\t= new RegExp('('+ escapeToPattern(latin_chars) + accent_pat + '*)','gu');\n\n\n\t// build diacritic patterns\n\t// ae needs:\n\t//\t(?:(?:ae|Æ|Ǽ|Ǣ)|(?:A|Ⓐ|A...)(?:E|ɛ|Ⓔ...))\n\tvar diacritic_patterns:TDiacraticList = {};\n\tlatin_chars.sort((a,b) => a.length -b.length).forEach((latin)=>{\n\n\t\tvar substrings\t= allSubstrings(latin);\n\t\tvar pattern = substrings.map((sub_pat)=>{\n\n\t\t\tsub_pat = sub_pat.map((l)=>{\n\t\t\t\tif( diacritics.hasOwnProperty(l) ){\n\t\t\t\t\treturn escapeToPattern(diacritics[l]);\n\t\t\t\t}\n\t\t\t\treturn l;\n\t\t\t});\n\n\t\t\treturn arrayToPattern(sub_pat,'');\n\t\t});\n\n\t\tdiacritic_patterns[latin] = arrayToPattern(pattern);\n\t});\n\n\n\treturn diacritic_patterns;\n}\n\n/**\n * Expand a regular expression pattern to include diacritics\n * \teg /a/ becomes /aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑAⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ/\n *\n */\nexport const diacriticRegexPoints = (regex:string):string => {\n\n\tif( diacritic_patterns === undefined ){\n\t\tdiacritic_patterns = generateDiacritics(code_points);\n\t}\n\n\tconst decomposed\t\t= regex.normalize('NFKD').toLowerCase();\n\n\treturn decomposed.split(latin_pat).map((part:string)=>{\n\n\t\t// \"ffl\" or \"ffl\"\n\t\tconst no_accent = asciifold(part);\n\t\tif( no_accent == '' ){\n\t\t\treturn '';\n\t\t}\n\n\t\tif( diacritic_patterns.hasOwnProperty(no_accent) ){\n\t\t\treturn diacritic_patterns[no_accent];\n\t\t}\n\n\t\treturn part;\n\t}).join('');\n\n}\n","\nimport { iterate } from '@orchidjs/sifter/lib/utils';\n\n/**\n * Return a dom element from either a dom query string, jQuery object, a dom element or html string\n * https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518\n *\n * param query should be {}\n */\nexport const getDom = ( query:any ):HTMLElement => {\n\n\tif( query.jquery ){\n\t\treturn query[0];\n\t}\n\n\tif( query instanceof HTMLElement ){\n\t\treturn query;\n\t}\n\n\tif( isHtmlString(query) ){\n\t\tlet div = document.createElement('div');\n\t\tdiv.innerHTML = query.trim(); // Never return a text node of whitespace as the result\n\t\treturn div.firstChild as HTMLElement;\n\t}\n\n\treturn document.querySelector(query);\n};\n\nexport const isHtmlString = (arg:any): boolean => {\n\tif( typeof arg === 'string' && arg.indexOf('<') > -1 ){\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport const escapeQuery = (query:string):string => {\n\treturn query.replace(/['\"\\\\]/g, '\\\\$&');\n}\n\n/**\n * Dispatch an event\n *\n */\nexport const triggerEvent = ( dom_el:HTMLElement, event_name:string ):void => {\n\tvar event = document.createEvent('HTMLEvents');\n\tevent.initEvent(event_name, true, false);\n\tdom_el.dispatchEvent(event)\n};\n\n/**\n * Apply CSS rules to a dom element\n *\n */\nexport const applyCSS = ( dom_el:HTMLElement, css:{ [key: string]: string|number }):void => {\n\tObject.assign(dom_el.style, css);\n}\n\n\n/**\n * Add css classes\n *\n */\nexport const addClasses = ( elmts:HTMLElement|HTMLElement[], ...classes:string[]|string[][] ) => {\n\n\tvar norm_classes \t= classesArray(classes);\n\telmts\t\t\t\t= castAsArray(elmts);\n\n\telmts.map( el => {\n\t\tnorm_classes.map( cls => {\n\t\t\tel.classList.add( cls );\n\t\t});\n\t});\n}\n\n/**\n * Remove css classes\n *\n */\n export const removeClasses = ( elmts:HTMLElement|HTMLElement[], ...classes:string[]|string[][] ) => {\n\n \tvar norm_classes \t= classesArray(classes);\n\telmts\t\t\t\t= castAsArray(elmts);\n\n\telmts.map( el => {\n\t\tnorm_classes.map(cls => {\n\t \t\tel.classList.remove( cls );\n\t\t});\n \t});\n }\n\n\n/**\n * Return arguments\n *\n */\nexport const classesArray = (args:string[]|string[][]):string[] => {\n\tvar classes:string[] = [];\n\titerate( args, (_classes) =>{\n\t\tif( typeof _classes === 'string' ){\n\t\t\t_classes = _classes.trim().split(/[\\11\\12\\14\\15\\40]/);\n\t\t}\n\t\tif( Array.isArray(_classes) ){\n\t\t\tclasses = classes.concat(_classes);\n\t\t}\n\t});\n\n\treturn classes.filter(Boolean);\n}\n\n\n/**\n * Create an array from arg if it's not already an array\n *\n */\nexport const castAsArray = (arg:any):Array<any> => {\n\tif( !Array.isArray(arg) ){\n \t\targ = [arg];\n \t}\n\treturn arg;\n}\n\n\n/**\n * Get the closest node to the evt.target matching the selector\n * Stops at wrapper\n *\n */\nexport const parentMatch = ( target:null|HTMLElement, selector:string, wrapper?:HTMLElement ):HTMLElement|void => {\n\n\tif( wrapper && !wrapper.contains(target) ){\n\t\treturn;\n\t}\n\n\twhile( target && target.matches ){\n\n\t\tif( target.matches(selector) ){\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget = target.parentNode as HTMLElement;\n\t}\n}\n\n\n/**\n * Get the first or last item from an array\n *\n * > 0 - right (last)\n * <= 0 - left (first)\n *\n */\nexport const getTail = ( list:Array<any>|NodeList, direction:number=0 ):any => {\n\n\tif( direction > 0 ){\n\t\treturn list[list.length-1];\n\t}\n\n\treturn list[0];\n}\n\n/**\n * Return true if an object is empty\n *\n */\nexport const isEmptyObject = (obj:object):boolean => {\n\treturn (Object.keys(obj).length === 0);\n}\n\n\n/**\n * Get the index of an element amongst sibling nodes of the same type\n *\n */\nexport const nodeIndex = ( el:null|Element, amongst?:string ):number => {\n\tif (!el) return -1;\n\n\tamongst = amongst || el.nodeName;\n\n\tvar i = 0;\n\twhile( el = el.previousElementSibling ){\n\n\t\tif( el.matches(amongst) ){\n\t\t\ti++;\n\t\t}\n\t}\n\treturn i;\n}\n\n\n/**\n * Set attributes of an element\n *\n */\nexport const setAttr = (el:Element,attrs:{ [key: string]: null|string|number }) => {\n\titerate( attrs,(val,attr) => {\n\t\tif( val == null ){\n\t\t\tel.removeAttribute(attr as string);\n\t\t}else{\n\t\t\tel.setAttribute(attr as string, ''+val);\n\t\t}\n\t});\n}\n\n\n/**\n * Replace a node\n */\nexport const replaceNode = ( existing:Node, replacement:Node ) => {\n\tif( existing.parentNode ) existing.parentNode.replaceChild(replacement, existing);\n}\n","\nimport TomSelect from './tom-select';\nimport { TomLoadCallback } from './types/index';\n\n\n/**\n * Converts a scalar to its best string representation\n * for hash keys and HTML attribute values.\n *\n * Transformations:\n * 'str' -> 'str'\n * null -> ''\n * undefined -> ''\n * true -> '1'\n * false -> '0'\n * 0 -> '0'\n * 1 -> '1'\n *\n */\nexport const hash_key = (value:undefined|null|boolean|string):string|null => {\n\tif (typeof value === 'undefined' || value === null) return null;\n\treturn get_hash(value);\n};\n\nexport const get_hash = (value:boolean|string):string => {\n\tif (typeof value === 'boolean') return value ? '1' : '0';\n\treturn value + '';\n};\n\n/**\n * Escapes a string for use within HTML.\n *\n */\nexport const escape_html = (str:string):string => {\n\treturn (str + '')\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"');\n};\n\n\n/**\n * Debounce the user provided load function\n *\n */\nexport const loadDebounce = (fn:(value:string,callback:TomLoadCallback) => void,delay:number) => {\n\tvar timeout: null|ReturnType<typeof setTimeout>;\n\treturn function(this:TomSelect, value:string,callback:TomLoadCallback) {\n\t\tvar self = this;\n\n\t\tif( timeout ){\n\t\t\tself.loading = Math.max(self.loading - 1, 0);\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tself.loadedSearches[value] = true;\n\t\t\tfn.call(self, value, callback);\n\n\t\t}, delay);\n\t};\n};\n\n\n/**\n * Debounce all fired events types listed in `types`\n * while executing the provided `fn`.\n *\n */\nexport const debounce_events = ( self:TomSelect, types:string[], fn:() => void ) => {\n\tvar type:string;\n\tvar trigger = self.trigger;\n\tvar event_args:{ [key: string]: any } = {};\n\n\t// override trigger method\n\tself.trigger = function(){\n\t\tvar type = arguments[0];\n\t\tif (types.indexOf(type) !== -1) {\n\t\t\tevent_args[type] = arguments;\n\t\t} else {\n\t\t\treturn trigger.apply(self, arguments);\n\t\t}\n\t};\n\n\t// invoke provided function\n\tfn.apply(self, []);\n\tself.trigger = trigger;\n\n\t// trigger queued events\n\tfor( type of types ){\n\t\tif( type in event_args ){\n\t\t\ttrigger.apply(self, event_args[type]);\n\t\t}\n\t}\n};\n\n\n/**\n * Determines the current selection within a text input control.\n * Returns an object containing:\n * - start\n * - length\n *\n */\nexport const getSelection = (input:HTMLInputElement):{ start: number; length: number } => {\n\treturn {\n\t\tstart\t: input.selectionStart || 0,\n\t\tlength\t: (input.selectionEnd||0) - (input.selectionStart||0),\n\t};\n};\n\n\n/**\n * Prevent default\n *\n */\nexport const preventDefault = (evt?:Event, stop:boolean=false):void => {\n\tif( evt ){\n\t\tevt.preventDefault();\n\t\tif( stop ){\n\t\t\tevt.stopPropagation();\n\t\t}\n\t}\n}\n\n\n/**\n * Prevent default\n *\n */\nexport const addEvent = (target:EventTarget, type:string, callback:EventListenerOrEventListenerObject, options?:object):void => {\n\ttarget.addEventListener(type,callback,options);\n};\n\n\n/**\n * Return true if the requested key is down\n * Will return false if more than one control character is pressed ( when [ctrl+shift+a] != [ctrl+a] )\n * The current evt may not always set ( eg calling advanceSelection() )\n *\n */\nexport const isKeyDown = ( key_name:keyof (KeyboardEvent|MouseEvent), evt?:KeyboardEvent|MouseEvent ) => {\n\n\tif( !evt ){\n\t\treturn false;\n\t}\n\n\tif( !evt[key_name] ){\n\t\treturn false;\n\t}\n\n\tvar count = (evt.altKey?1:0) + (evt.ctrlKey?1:0) + (evt.shiftKey?1:0) + (evt.metaKey?1:0);\n\n\tif( count === 1 ){\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\n\n/**\n * Get the id of an element\n * If the id attribute is not set, set the attribute with the given id\n *\n */\nexport const getId = (el:Element,id:string) => {\n\tconst existing_id = el.getAttribute('id');\n\tif( existing_id ){\n\t\treturn existing_id;\n\t}\n\n\tel.setAttribute('id',id);\n\treturn id;\n};\n\n\n/**\n * Returns a string with backslashes added before characters that need to be escaped.\n */\nexport const addSlashes = (str:string):string => {\n\treturn str.replace(/[\\\\\"']/g, '\\\\$&');\n};\n\n/**\n *\n */\nexport const append = ( parent:Element|DocumentFragment, node: string|Node|null|undefined ):void =>{\n\tif( node ) parent.append(node);\n};\n","/**\n * Plugin: \"remove_button\" (Tom Select)\n * Copyright (c) contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at:\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n *\n */\n\nimport TomSelect from '../../tom-select';\nimport { getDom } from '../../vanilla';\nimport { escape_html, preventDefault, addEvent } from '../../utils';\nimport { TomOption, TomItem } from '../../types/index';\nimport { RBOptions } from './types';\n\nexport default function(this:TomSelect, userOptions:RBOptions) {\n\n\tconst options = Object.assign({\n\t\t\tlabel : '×',\n\t\t\ttitle : 'Remove',\n\t\t\tclassName : 'remove',\n\t\t\tappend : true\n\t\t}, userOptions);\n\n\n\t//options.className = 'remove-single';\n\tvar self\t\t\t= this;\n\n\t// override the render method to add remove button to each item\n\tif( !options.append ){\n\t\treturn;\n\t}\n\n\tvar html = '<a href=\"javascript:void(0)\" class=\"' + options.className + '\" tabindex=\"-1\" title=\"' + escape_html(options.title) + '\">' + options.label + '</a>';\n\n\tself.hook('after','setupTemplates',() => {\n\n\t\tvar orig_render_item = self.settings.render.item;\n\n\t\tself.settings.render.item = (data:TomOption, escape:typeof escape_html) => {\n\n\t\t\tvar item = getDom(orig_render_item.call(self, data, escape)) as TomItem;\n\n\t\t\tvar close_button = getDom(html);\n\t\t\titem.appendChild(close_button);\n\n\t\t\taddEvent(close_button,'mousedown',(evt) => {\n\t\t\t\tpreventDefault(evt,true);\n\t\t\t});\n\n\t\t\taddEvent(close_button,'click',(evt) => {\n\n\t\t\t\t// propagating will trigger the dropdown to show for single mode\n\t\t\t\tpreventDefault(evt,true);\n\n\t\t\t\tif( self.isLocked ) return;\n\t\t\t\tif( !self.shouldDelete([item],evt as MouseEvent) ) return;\n\n\t\t\t\tself.removeItem(item);\n\t\t\t\tself.refreshOptions(false);\n\t\t\t\tself.inputState();\n\t\t\t});\n\n\t\t\treturn item;\n\t\t};\n\n\t});\n\n\n};\n"],"names":["latin_convert","RegExp","Object","keys","join","getDom","query","jquery","HTMLElement","isHtmlString","div","document","createElement","innerHTML","trim","firstChild","querySelector","arg","indexOf","escape_html","str","replace","preventDefault","evt","stop","stopPropagation","addEvent","target","type","callback","options","addEventListener","userOptions","assign","label","title","className","append","self","html","hook","orig_render_item","settings","render","item","data","escape","call","close_button","appendChild","isLocked","shouldDelete","removeItem","refreshOptions","inputState"],"mappings":";;;;;;;;;;;CACA;CAYA,MAAMA,aAA4B,GAAG;CACpC,OAAK,IAD+B;CAEpC,OAAK,GAF+B;CAGpC,OAAK;CAH+B,CAArC;CAMoB,IAAIC,MAAJ,CAAWC,MAAM,CAACC,IAAP,CAAYH,aAAZ,EAA2BI,IAA3B,CAAgC,GAAhC,CAAX,EAAgD,IAAhD;;CChBpB;CACA;CACA;CACA;CACA;CACA;;CACO,MAAMC,MAAM,GAAKC,KAAF,IAA6B;CAElD,MAAIA,KAAK,CAACC,MAAV,EAAkB;CACjB,WAAOD,KAAK,CAAC,CAAD,CAAZ;CACA;;CAED,MAAIA,KAAK,YAAYE,WAArB,EAAkC;CACjC,WAAOF,KAAP;CACA;;CAED,MAAIG,YAAY,CAACH,KAAD,CAAhB,EAAyB;CACxB,QAAII,GAAG,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAV;CACAF,IAAAA,GAAG,CAACG,SAAJ,GAAgBP,KAAK,CAACQ,IAAN,EAAhB,CAFwB;;CAGxB,WAAOJ,GAAG,CAACK,UAAX;CACA;;CAED,SAAOJ,QAAQ,CAACK,aAAT,CAAuBV,KAAvB,CAAP;CACA,CAjBM;CAmBA,MAAMG,YAAY,GAAIQ,GAAD,IAAsB;CACjD,MAAI,OAAOA,GAAP,KAAe,QAAf,IAA2BA,GAAG,CAACC,OAAJ,CAAY,GAAZ,IAAmB,CAAC,CAAnD,EAAsD;CACrD,WAAO,IAAP;CACA;;CACD,SAAO,KAAP;CACA,CALM;;CCvBP;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAWA;CACA;CACA;CACA;;CACO,MAAMC,WAAW,GAAIC,GAAD,IAAuB;CACjD,SAAO,CAACA,GAAG,GAAG,EAAP,EACLC,OADK,CACG,IADH,EACS,OADT,EAELA,OAFK,CAEG,IAFH,EAES,MAFT,EAGLA,OAHK,CAGG,IAHH,EAGS,MAHT,EAILA,OAJK,CAIG,IAJH,EAIS,QAJT,CAAP;CAKA,CANM;CAgFP;CACA;CACA;CACA;;CACO,MAAMC,cAAc,GAAG,CAACC,GAAD,EAAaC,IAAY,GAAC,KAA1B,KAAyC;CACtE,MAAID,GAAJ,EAAS;CACRA,IAAAA,GAAG,CAACD,cAAJ;;CACA,QAAIE,IAAJ,EAAU;CACTD,MAAAA,GAAG,CAACE,eAAJ;CACA;CACD;CACD,CAPM;CAUP;CACA;CACA;CACA;;CACO,MAAMC,QAAQ,GAAG,CAACC,MAAD,EAAqBC,IAArB,EAAkCC,QAAlC,EAA+EC,OAA/E,KAAwG;CAC/HH,EAAAA,MAAM,CAACI,gBAAP,CAAwBH,IAAxB,EAA6BC,QAA7B,EAAsCC,OAAtC;CACA,CAFM;;CCnIP;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAQe,iBAAyBE,WAAzB,EAAgD;CAE9D,QAAMF,OAAO,GAAG5B,MAAM,CAAC+B,MAAP,CAAc;CAC5BC,IAAAA,KAAK,EAAO,SADgB;CAE5BC,IAAAA,KAAK,EAAO,QAFgB;CAG5BC,IAAAA,SAAS,EAAG,QAHgB;CAI5BC,IAAAA,MAAM,EAAM;CAJgB,GAAd,EAKZL,WALY,CAAhB,CAF8D;;CAW9D,MAAIM,IAAI,GAAK,IAAb,CAX8D;;CAc9D,MAAI,CAACR,OAAO,CAACO,MAAb,EAAqB;CACpB;CACA;;CAED,MAAIE,IAAI,GAAG,yCAAyCT,OAAO,CAACM,SAAjD,GAA6D,yBAA7D,GAAyFjB,WAAW,CAACW,OAAO,CAACK,KAAT,CAApG,GAAsH,IAAtH,GAA6HL,OAAO,CAACI,KAArI,GAA6I,MAAxJ;CAEAI,EAAAA,IAAI,CAACE,IAAL,CAAU,OAAV,EAAkB,gBAAlB,EAAmC,MAAM;CAExC,QAAIC,gBAAgB,GAAGH,IAAI,CAACI,QAAL,CAAcC,MAAd,CAAqBC,IAA5C;;CAEAN,IAAAA,IAAI,CAACI,QAAL,CAAcC,MAAd,CAAqBC,IAArB,GAA4B,CAACC,IAAD,EAAiBC,MAAjB,KAA+C;CAE1E,UAAIF,IAAI,GAAGvC,MAAM,CAACoC,gBAAgB,CAACM,IAAjB,CAAsBT,IAAtB,EAA4BO,IAA5B,EAAkCC,MAAlC,CAAD,CAAjB;CAEA,UAAIE,YAAY,GAAG3C,MAAM,CAACkC,IAAD,CAAzB;CACAK,MAAAA,IAAI,CAACK,WAAL,CAAiBD,YAAjB;CAEAtB,MAAAA,QAAQ,CAACsB,YAAD,EAAc,WAAd,EAA2BzB,GAAD,IAAS;CAC1CD,QAAAA,cAAc,CAACC,GAAD,EAAK,IAAL,CAAd;CACA,OAFO,CAAR;CAIAG,MAAAA,QAAQ,CAACsB,YAAD,EAAc,OAAd,EAAuBzB,GAAD,IAAS;CAEtC;CACAD,QAAAA,cAAc,CAACC,GAAD,EAAK,IAAL,CAAd;CAEA,YAAIe,IAAI,CAACY,QAAT,EAAoB;CACpB,YAAI,CAACZ,IAAI,CAACa,YAAL,CAAkB,CAACP,IAAD,CAAlB,EAAyBrB,GAAzB,CAAL,EAAmD;CAEnDe,QAAAA,IAAI,CAACc,UAAL,CAAgBR,IAAhB;CACAN,QAAAA,IAAI,CAACe,cAAL,CAAoB,KAApB;CACAf,QAAAA,IAAI,CAACgB,UAAL;CACA,OAXO,CAAR;CAaA,aAAOV,IAAP;CACA,KAzBD;CA2BA,GA/BD;CAkCA;;;;;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tom Select v2.1.0
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.restore_on_backspace = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Plugin: "restore_on_backspace" (Tom Select)
|
|
14
|
+
* Copyright (c) contributors
|
|
15
|
+
*
|
|
16
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
|
17
|
+
* file except in compliance with the License. You may obtain a copy of the License at:
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
21
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
22
|
+
* ANY KIND, either express or implied. See the License for the specific language
|
|
23
|
+
* governing permissions and limitations under the License.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
function plugin (userOptions) {
|
|
27
|
+
const self = this;
|
|
28
|
+
const options = Object.assign({
|
|
29
|
+
text: option => {
|
|
30
|
+
return option[self.settings.labelField];
|
|
31
|
+
}
|
|
32
|
+
}, userOptions);
|
|
33
|
+
self.on('item_remove', function (value) {
|
|
34
|
+
if (!self.isFocused) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (self.control_input.value.trim() === '') {
|
|
39
|
+
var option = self.options[value];
|
|
40
|
+
|
|
41
|
+
if (option) {
|
|
42
|
+
self.setTextboxValue(options.text.call(self, option));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return plugin;
|
|
49
|
+
|
|
50
|
+
}));
|
|
51
|
+
//# sourceMappingURL=restore_on_backspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore_on_backspace.js","sources":["../../../src/plugins/restore_on_backspace/plugin.ts"],"sourcesContent":["/**\n * Plugin: \"restore_on_backspace\" (Tom Select)\n * Copyright (c) contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at:\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n *\n */\nimport TomSelect from '../../tom-select';\nimport { TomOption } from '../../types/index';\n\ntype TPluginOptions = {\n\ttext?:(option:TomOption)=>string,\n};\n\nexport default function(this:TomSelect, userOptions:TPluginOptions) {\n\tconst self = this;\n\n\tconst options = Object.assign({\n\t\ttext: (option:TomOption) => {\n\t\t\treturn option[self.settings.labelField];\n\t\t}\n\t},userOptions);\n\n\tself.on('item_remove',function(value:string){\n\t\tif( !self.isFocused ){\n\t\t\treturn;\n\t\t}\n\n\t\tif( self.control_input.value.trim() === '' ){\n\t\t\tvar option = self.options[value];\n\t\t\tif( option ){\n\t\t\t\tself.setTextboxValue(options.text.call(self, option));\n\t\t\t}\n\t\t}\n\t});\n\n};\n"],"names":["userOptions","self","options","Object","assign","text","option","settings","labelField","on","value","isFocused","control_input","trim","setTextboxValue","call"],"mappings":";;;;;;;;;;;CAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAQe,iBAAyBA,WAAzB,EAAqD;CACnE,QAAMC,IAAI,GAAG,IAAb;CAEA,QAAMC,OAAO,GAAGC,MAAM,CAACC,MAAP,CAAc;CAC7BC,IAAAA,IAAI,EAAGC,MAAD,IAAsB;CAC3B,aAAOA,MAAM,CAACL,IAAI,CAACM,QAAL,CAAcC,UAAf,CAAb;CACA;CAH4B,GAAd,EAIdR,WAJc,CAAhB;CAMAC,EAAAA,IAAI,CAACQ,EAAL,CAAQ,aAAR,EAAsB,UAASC,KAAT,EAAsB;CAC3C,QAAI,CAACT,IAAI,CAACU,SAAV,EAAqB;CACpB;CACA;;CAED,QAAIV,IAAI,CAACW,aAAL,CAAmBF,KAAnB,CAAyBG,IAAzB,OAAoC,EAAxC,EAA4C;CAC3C,UAAIP,MAAM,GAAGL,IAAI,CAACC,OAAL,CAAaQ,KAAb,CAAb;;CACA,UAAIJ,MAAJ,EAAY;CACXL,QAAAA,IAAI,CAACa,eAAL,CAAqBZ,OAAO,CAACG,IAAR,CAAaU,IAAb,CAAkBd,IAAlB,EAAwBK,MAAxB,CAArB;CACA;CACD;CACD,GAXD;CAaA;;;;;;;;"}
|