@watermarkinsights/ripple 5.13.0 → 5.13.1-0
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/README.md +1 -1
- package/dist/cjs/app-globals-12979223.js +92 -0
- package/dist/cjs/chartFunctions-5a8c4095.js +742 -0
- package/dist/cjs/functions-0774d303.js +10479 -0
- package/dist/cjs/index-788526f5.js +1863 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/interfaces-85d78ae9.js +37 -0
- package/dist/cjs/intl-4a204fe7.js +283 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/priv-calendar.cjs.entry.js +574 -0
- package/dist/{ripple/wm-optgroup.entry.js → cjs/priv-chart-popover.cjs.entry.js} +120 -48
- package/dist/{ripple/wm-modal-footer.entry.js → cjs/priv-navigator-button.cjs.entry.js} +20 -35
- package/dist/{ripple/wm-navigator.entry.js → cjs/priv-navigator-item.cjs.entry.js} +24 -357
- package/dist/{ripple/wm-search.entry.js → cjs/priv-option-list.cjs.entry.js} +365 -180
- package/dist/cjs/ripple.cjs.js +25 -0
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +335 -0
- package/dist/cjs/wm-button.cjs.entry.js +207 -0
- package/dist/cjs/wm-chart-slice.cjs.entry.js +27 -0
- package/dist/cjs/wm-chart.cjs.entry.js +163 -0
- package/dist/cjs/wm-date-range.cjs.entry.js +484 -0
- package/dist/cjs/wm-datepicker.cjs.entry.js +254 -0
- package/dist/cjs/wm-file-list.cjs.entry.js +23 -0
- package/dist/cjs/wm-file.cjs.entry.js +194 -0
- package/dist/cjs/wm-flyout.cjs.entry.js +180 -0
- package/dist/cjs/wm-input.cjs.entry.js +125 -0
- package/dist/cjs/wm-line-chart.cjs.entry.js +461 -0
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +217 -0
- package/dist/cjs/wm-modal_3.cjs.entry.js +217 -0
- package/dist/cjs/wm-navigation_3.cjs.entry.js +188 -0
- package/dist/cjs/wm-navigator.cjs.entry.js +327 -0
- package/dist/cjs/wm-nested-select.cjs.entry.js +315 -0
- package/dist/cjs/wm-optgroup.cjs.entry.js +74 -0
- package/dist/cjs/wm-option_2.cjs.entry.js +427 -0
- package/dist/cjs/wm-pagination.cjs.entry.js +228 -0
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +204 -0
- package/dist/cjs/wm-search.cjs.entry.js +194 -0
- package/dist/cjs/wm-snackbar.cjs.entry.js +189 -0
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +263 -0
- package/dist/cjs/wm-tag-input.cjs.entry.js +892 -0
- package/dist/cjs/wm-tag-option.cjs.entry.js +43 -0
- package/dist/cjs/wm-textarea.cjs.entry.js +88 -0
- package/dist/cjs/wm-timepicker.cjs.entry.js +307 -0
- package/dist/cjs/wm-toggletip.cjs.entry.js +183 -0
- package/dist/cjs/wm-uploader.cjs.entry.js +325 -0
- package/dist/cjs/wm-wrapper.cjs.entry.js +21 -0
- package/dist/collection/collection-manifest.json +197 -0
- package/dist/collection/components/charts/chartFunctions.js +675 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +1044 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +257 -0
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +125 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.css +1497 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.js +422 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1202 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +723 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +1497 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +264 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +1060 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +151 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +121 -0
- package/dist/collection/components/datepickers/datepicker.css +1179 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +1414 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +840 -0
- package/dist/collection/components/datepickers/wm-date-range.js +849 -0
- package/dist/collection/components/datepickers/wm-datepicker.js +524 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +1053 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +780 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1316 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +620 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +965 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +258 -0
- package/dist/collection/components/selects/wm-option/wm-option.css +1066 -0
- package/dist/collection/components/selects/wm-option/wm-option.js +530 -0
- package/dist/collection/components/selects/wm-select/wm-select.css +1239 -0
- package/dist/collection/components/selects/wm-select/wm-select.js +584 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +1026 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -0
- package/dist/collection/components/wm-button/wm-button.css +1571 -0
- package/dist/collection/components/wm-button/wm-button.js +489 -0
- package/dist/collection/components/wm-file/wm-file.css +1062 -0
- package/dist/collection/components/wm-file/wm-file.js +412 -0
- package/dist/collection/components/wm-file-list/wm-file-list.css +955 -0
- package/dist/collection/components/wm-file-list/wm-file-list.js +45 -0
- package/dist/collection/components/wm-flyout/wm-flyout.css +1149 -0
- package/dist/collection/components/wm-flyout/wm-flyout.js +448 -0
- package/dist/collection/components/wm-input/wm-input.css +1139 -0
- package/dist/collection/components/wm-input/wm-input.js +471 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +1026 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +419 -0
- package/dist/collection/components/wm-modal/wm-modal-footer.css +980 -0
- package/dist/collection/components/wm-modal/wm-modal-footer.js +142 -0
- package/dist/collection/components/wm-modal/wm-modal-header.css +979 -0
- package/dist/collection/components/wm-modal/wm-modal-header.js +79 -0
- package/dist/collection/components/wm-modal/wm-modal.css +1027 -0
- package/dist/collection/components/wm-modal/wm-modal.js +350 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +987 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +138 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +981 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +82 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +1063 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +362 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +982 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +119 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +991 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +98 -0
- package/dist/collection/components/wm-navigation/wm-navigation.css +1033 -0
- package/dist/collection/components/wm-navigation/wm-navigation.js +190 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +985 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +86 -0
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +965 -0
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +124 -0
- package/dist/collection/components/wm-navigator/wm-navigator.css +1038 -0
- package/dist/collection/components/wm-navigator/wm-navigator.js +496 -0
- package/dist/collection/components/wm-pagination/wm-pagination.css +1106 -0
- package/dist/collection/components/wm-pagination/wm-pagination.js +363 -0
- package/dist/collection/components/wm-search/wm-search.css +1031 -0
- package/dist/collection/components/wm-search/wm-search.js +427 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +1213 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +276 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +1004 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +175 -0
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +976 -0
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +273 -0
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +960 -0
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +87 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +1411 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +1227 -0
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +243 -0
- package/dist/collection/components/wm-textarea/wm-textarea.css +1115 -0
- package/dist/collection/components/wm-textarea/wm-textarea.js +313 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +1229 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +547 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +1287 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +289 -0
- package/dist/collection/components/wm-uploader/wm-uploader.css +1873 -0
- package/dist/collection/components/wm-uploader/wm-uploader.js +603 -0
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +28 -0
- package/dist/collection/dev/action-menu.js +0 -0
- package/dist/collection/dev/button.js +0 -0
- package/dist/collection/dev/chart-small.js +56 -0
- package/dist/collection/dev/chart.js +18 -0
- package/dist/collection/dev/date-range.js +6 -0
- package/dist/collection/dev/datepicker.js +46 -0
- package/dist/collection/dev/file-list.js +16 -0
- package/dist/collection/dev/file.js +0 -0
- package/dist/collection/dev/flyout.js +194 -0
- package/dist/collection/dev/input.js +6 -0
- package/dist/collection/dev/line-chart.js +0 -0
- package/dist/collection/dev/modal.js +48 -0
- package/dist/collection/dev/navigation.js +13 -0
- package/dist/collection/dev/navigator.js +34 -0
- package/dist/collection/dev/nested-select.js +36 -0
- package/dist/collection/dev/pagination.js +7 -0
- package/dist/collection/dev/progress-monitor.js +0 -0
- package/dist/collection/dev/pss-modal.js +8 -0
- package/dist/collection/dev/scripts.js +49 -0
- package/dist/collection/dev/search.js +72 -0
- package/dist/collection/dev/select.js +57 -0
- package/dist/collection/dev/snackbar.js +60 -0
- package/dist/collection/dev/tabs.js +44 -0
- package/dist/collection/dev/tag-input.js +32 -0
- package/dist/collection/dev/textarea.js +28 -0
- package/dist/collection/dev/timepicker.js +32 -0
- package/dist/collection/dev/toggletip.js +9 -0
- package/dist/collection/dev/uploader.js +139 -0
- package/dist/collection/global/__mocks__/functions.js +6 -0
- package/dist/collection/global/functions.js +841 -0
- package/dist/{ripple/app-globals-B7cOtGhY.js → collection/global/global.js} +2 -84
- package/dist/{ripple/interfaces-CrANcZM9.js → collection/global/interfaces.js} +4 -6
- package/dist/collection/global/intl.js +274 -0
- package/dist/collection/global/services/__mocks__/http-service.js +130 -0
- package/dist/collection/global/services/http-service.js +50 -0
- package/dist/collection/lang/lang.js +5 -0
- package/dist/collection/lang/missing.js +43 -0
- package/dist/collection/lang/piglatin.js +101 -0
- package/dist/esm/app-globals-8110c96f.js +90 -0
- package/dist/{ripple/chartFunctions-CmeM8Tyx.js → esm/chartFunctions-4095a787.js} +3 -3
- package/dist/{ripple/functions-DVLl0rH_.js → esm/functions-682e95b4.js} +390 -8060
- package/dist/esm/index-130e07bb.js +1832 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/interfaces-cc5b177f.js +34 -0
- package/dist/{ripple/intl-7p27BJSM.js → esm/intl-e0444831.js} +1 -1
- package/dist/esm/loader.js +11 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/priv-calendar.entry.js +570 -0
- package/dist/{ripple/wm-menuitem.entry.js → esm/priv-chart-popover.entry.js} +109 -98
- package/dist/{ripple/wm-modal-header.entry.js → esm/priv-navigator-button.entry.js} +14 -25
- package/dist/{ripple/wm-toggletip.entry.js → esm/priv-navigator-item.entry.js} +19 -164
- package/dist/{ripple/wm-option.entry.js → esm/priv-option-list.entry.js} +347 -129
- package/dist/esm/ripple.js +20 -0
- package/dist/esm/wm-action-menu_2.entry.js +330 -0
- package/dist/esm/wm-button.entry.js +203 -0
- package/dist/{ripple → esm}/wm-chart-slice.entry.js +6 -1
- package/dist/esm/wm-chart.entry.js +159 -0
- package/dist/esm/wm-date-range.entry.js +480 -0
- package/dist/esm/wm-datepicker.entry.js +250 -0
- package/dist/esm/wm-file-list.entry.js +19 -0
- package/dist/{ripple/wm-chart.entry.js → esm/wm-file.entry.js} +169 -136
- package/dist/esm/wm-flyout.entry.js +176 -0
- package/dist/esm/wm-input.entry.js +121 -0
- package/dist/esm/wm-line-chart.entry.js +457 -0
- package/dist/esm/wm-modal-pss_3.entry.js +211 -0
- package/dist/esm/wm-modal_3.entry.js +211 -0
- package/dist/esm/wm-navigation_3.entry.js +182 -0
- package/dist/esm/wm-navigator.entry.js +323 -0
- package/dist/{ripple/wm-select.entry.js → esm/wm-nested-select.entry.js} +199 -137
- package/dist/esm/wm-optgroup.entry.js +70 -0
- package/dist/esm/wm-option_2.entry.js +422 -0
- package/dist/esm/wm-pagination.entry.js +224 -0
- package/dist/esm/wm-progress-indicator_3.entry.js +198 -0
- package/dist/esm/wm-search.entry.js +190 -0
- package/dist/esm/wm-snackbar.entry.js +185 -0
- package/dist/esm/wm-tab-item_3.entry.js +257 -0
- package/dist/esm/wm-tag-input.entry.js +888 -0
- package/dist/{ripple → esm}/wm-tag-option.entry.js +6 -2
- package/dist/esm/wm-textarea.entry.js +84 -0
- package/dist/esm/wm-timepicker.entry.js +303 -0
- package/dist/esm/wm-toggletip.entry.js +179 -0
- package/dist/esm/wm-uploader.entry.js +321 -0
- package/dist/{ripple → esm}/wm-wrapper.entry.js +1 -1
- package/dist/esm-es5/app-globals-8110c96f.js +1 -0
- package/dist/esm-es5/chartFunctions-4095a787.js +1 -0
- package/dist/esm-es5/functions-682e95b4.js +1 -0
- package/dist/esm-es5/index-130e07bb.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/interfaces-cc5b177f.js +1 -0
- package/dist/esm-es5/intl-e0444831.js +1 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/priv-calendar.entry.js +1 -0
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -0
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -0
- package/dist/{ripple/wm-progress-monitor.entry.js → esm-es5/priv-navigator-item.entry.js} +1 -71
- package/dist/esm-es5/priv-option-list.entry.js +1 -0
- package/dist/esm-es5/ripple.js +1 -0
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -0
- package/dist/esm-es5/wm-button.entry.js +1 -0
- package/dist/esm-es5/wm-chart-slice.entry.js +1 -0
- package/dist/esm-es5/wm-chart.entry.js +1 -0
- package/dist/esm-es5/wm-date-range.entry.js +1 -0
- package/dist/{ripple/wm-uploader.entry.js → esm-es5/wm-datepicker.entry.js} +1 -313
- package/dist/{ripple/wm-tab-item.entry.js → esm-es5/wm-file-list.entry.js} +1 -63
- package/dist/esm-es5/wm-file.entry.js +1 -0
- package/dist/{ripple/wm-input.entry.js → esm-es5/wm-flyout.entry.js} +1 -111
- package/dist/esm-es5/wm-input.entry.js +1 -0
- package/dist/esm-es5/wm-line-chart.entry.js +1 -0
- package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -0
- package/dist/esm-es5/wm-modal_3.entry.js +1 -0
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -0
- package/dist/esm-es5/wm-navigator.entry.js +1 -0
- package/dist/esm-es5/wm-nested-select.entry.js +1 -0
- package/dist/esm-es5/wm-optgroup.entry.js +1 -0
- package/dist/esm-es5/wm-option_2.entry.js +1 -0
- package/dist/esm-es5/wm-pagination.entry.js +1 -0
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -0
- package/dist/esm-es5/wm-search.entry.js +1 -0
- package/dist/esm-es5/wm-snackbar.entry.js +1 -0
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -0
- package/dist/esm-es5/wm-tag-input.entry.js +1 -0
- package/dist/esm-es5/wm-tag-option.entry.js +1 -0
- package/dist/esm-es5/wm-textarea.entry.js +1 -0
- package/dist/esm-es5/wm-timepicker.entry.js +1 -0
- package/dist/esm-es5/wm-toggletip.entry.js +1 -0
- package/dist/esm-es5/wm-uploader.entry.js +1 -0
- package/dist/esm-es5/wm-wrapper.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +2 -0
- package/dist/loader/index.cjs.js +2 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +2 -0
- package/dist/loader/index.js +3 -0
- package/dist/loader/package.json +11 -0
- package/dist/ripple/index.esm.js +0 -1
- package/dist/ripple/p-00baa278.entry.js +1 -0
- package/dist/ripple/{wm-flyout.entry.js → p-015af452.system.entry.js} +1 -167
- package/dist/ripple/p-039a53d7.entry.js +1 -0
- package/dist/ripple/p-043901ab.system.entry.js +1 -0
- package/dist/ripple/p-0528bf4d.entry.js +1 -0
- package/dist/ripple/p-0d4c017e.system.entry.js +1 -0
- package/dist/ripple/p-11aef4e8.entry.js +1 -0
- package/dist/ripple/p-13b1d775.entry.js +1 -0
- package/dist/ripple/p-14b3b062.system.entry.js +1 -0
- package/dist/ripple/p-15712a55.entry.js +1 -0
- package/dist/ripple/p-187c694f.js +1 -0
- package/dist/ripple/{wm-navigation-item.entry.js → p-18d6408f.system.entry.js} +1 -18
- package/dist/ripple/p-199fd014.system.entry.js +1 -0
- package/dist/ripple/p-1d43bc57.system.entry.js +1 -0
- package/dist/ripple/p-2732bddd.js +1 -0
- package/dist/ripple/p-29d32ee5.system.js +1 -0
- package/dist/ripple/p-31da9108.system.entry.js +1 -0
- package/dist/ripple/p-371c36f5.entry.js +1 -0
- package/dist/ripple/p-37301ba0.system.js +1 -0
- package/dist/ripple/p-42fa7a77.system.js +1 -0
- package/dist/ripple/p-43a28379.entry.js +1 -0
- package/dist/ripple/p-44577815.entry.js +1 -0
- package/dist/ripple/p-45f831ef.entry.js +1 -0
- package/dist/ripple/p-50ea2036.system.js +1 -0
- package/dist/ripple/p-55f880af.entry.js +1 -0
- package/dist/ripple/p-5642cfb5.system.entry.js +1 -0
- package/dist/ripple/p-5a564d92.system.entry.js +1 -0
- package/dist/ripple/p-5f09e972.entry.js +1 -0
- package/dist/ripple/p-61f8a6d4.system.entry.js +1 -0
- package/dist/ripple/p-6439b435.system.entry.js +1 -0
- package/dist/ripple/p-6747a274.system.js +1 -0
- package/dist/ripple/p-704bacb9.system.entry.js +1 -0
- package/dist/ripple/p-72b88618.system.entry.js +1 -0
- package/dist/ripple/p-733c7bd5.system.js +1 -0
- package/dist/ripple/p-7360ce37.entry.js +1 -0
- package/dist/ripple/p-7a08da5c.system.js +1 -0
- package/dist/ripple/{priv-option-list.entry.js → p-7a6f535f.system.entry.js} +1 -385
- package/dist/ripple/p-7c9bf5f6.system.entry.js +1 -0
- package/dist/ripple/p-8194ee04.entry.js +1 -0
- package/dist/ripple/p-823d7b4e.system.entry.js +1 -0
- package/dist/ripple/p-8303bd1e.entry.js +1 -0
- package/dist/ripple/{wm-modal-pss-header.entry.js → p-849384be.system.entry.js} +1 -39
- package/dist/ripple/p-8cd5206a.entry.js +1 -0
- package/dist/ripple/p-8dde12bd.entry.js +1 -0
- package/dist/ripple/p-91a8e524.system.entry.js +1 -0
- package/dist/ripple/p-927df284.system.entry.js +1 -0
- package/dist/ripple/p-932922ed.system.entry.js +1 -0
- package/dist/ripple/p-95d5618f.js +1 -0
- package/dist/ripple/p-9859635f.entry.js +1 -0
- package/dist/ripple/{wm-modal.entry.js → p-9d8c5fb4.system.entry.js} +1 -133
- package/dist/ripple/p-9e7e5948.system.entry.js +1 -0
- package/dist/ripple/p-a02cdb4f.js +1 -0
- package/dist/ripple/p-a399fb79.entry.js +1 -0
- package/dist/ripple/p-a4c26c21.entry.js +1 -0
- package/dist/ripple/{wm-modal-pss-footer.entry.js → p-a685a5fa.entry.js} +1 -40
- package/dist/ripple/p-a70f8d7a.entry.js +1 -0
- package/dist/ripple/p-ac241e42.system.entry.js +1 -0
- package/dist/ripple/p-afa213ca.entry.js +1 -0
- package/dist/ripple/p-b1e4f8d0.entry.js +1 -0
- package/dist/ripple/p-b4a9a118.entry.js +1 -0
- package/dist/ripple/p-b73936b2.system.entry.js +1 -0
- package/dist/ripple/p-bb00a18f.js +1 -0
- package/dist/ripple/p-bbb37d6e.entry.js +1 -0
- package/dist/ripple/{wm-file.entry.js → p-c3ab1c4b.system.entry.js} +1 -182
- package/dist/ripple/p-cd0cc88d.entry.js +1 -0
- package/dist/ripple/{wm-nested-select.entry.js → p-cd5c59ef.system.entry.js} +1 -308
- package/dist/ripple/p-cef8a45b.system.js +2 -0
- package/dist/ripple/p-cf77cdd0.system.entry.js +1 -0
- package/dist/ripple/p-d1950a60.entry.js +1 -0
- package/dist/ripple/p-d4ac08de.system.entry.js +1 -0
- package/dist/ripple/p-d8f0c9b4.system.entry.js +1 -0
- package/dist/ripple/p-d9da0502.js +2 -0
- package/dist/ripple/p-dbd8a6c4.system.entry.js +1 -0
- package/dist/ripple/p-dc600a24.entry.js +1 -0
- package/dist/ripple/p-dc82b6d2.entry.js +1 -0
- package/dist/ripple/p-e12e6b00.system.entry.js +1 -0
- package/dist/ripple/p-e7ee2171.system.entry.js +1 -0
- package/dist/ripple/p-e8f5c8cd.entry.js +1 -0
- package/dist/ripple/{priv-navigator-item.entry.js → p-e9c4ed97.entry.js} +1 -30
- package/dist/ripple/p-ec4c1020.system.entry.js +1 -0
- package/dist/ripple/p-ee01e771.entry.js +1 -0
- package/dist/ripple/p-f2c40a23.system.entry.js +1 -0
- package/dist/ripple/p-f65448ac.entry.js +1 -0
- package/dist/ripple/p-feaa4c19.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -48
- package/dist/ripple/ripple.js +127 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -28
- package/package.json +12 -32
- package/LICENSE +0 -21
- package/dist/components/index.d.ts +0 -33
- package/dist/components/priv-calendar.d.ts +0 -11
- package/dist/components/priv-chart-popover.d.ts +0 -11
- package/dist/components/priv-navigator-button.d.ts +0 -11
- package/dist/components/priv-navigator-item.d.ts +0 -11
- package/dist/components/priv-option-list.d.ts +0 -11
- package/dist/components/wm-action-menu.d.ts +0 -11
- package/dist/components/wm-button.d.ts +0 -11
- package/dist/components/wm-chart-slice.d.ts +0 -11
- package/dist/components/wm-chart.d.ts +0 -11
- package/dist/components/wm-date-range.d.ts +0 -11
- package/dist/components/wm-datepicker.d.ts +0 -11
- package/dist/components/wm-file-list.d.ts +0 -11
- package/dist/components/wm-file.d.ts +0 -11
- package/dist/components/wm-flyout.d.ts +0 -11
- package/dist/components/wm-input.d.ts +0 -11
- package/dist/components/wm-line-chart.d.ts +0 -11
- package/dist/components/wm-menuitem.d.ts +0 -11
- package/dist/components/wm-modal-footer.d.ts +0 -11
- package/dist/components/wm-modal-header.d.ts +0 -11
- package/dist/components/wm-modal-pss-footer.d.ts +0 -11
- package/dist/components/wm-modal-pss-header.d.ts +0 -11
- package/dist/components/wm-modal-pss.d.ts +0 -11
- package/dist/components/wm-modal.d.ts +0 -11
- package/dist/components/wm-navigation-hamburger.d.ts +0 -11
- package/dist/components/wm-navigation-item.d.ts +0 -11
- package/dist/components/wm-navigation.d.ts +0 -11
- package/dist/components/wm-navigator.d.ts +0 -11
- package/dist/components/wm-nested-select.d.ts +0 -11
- package/dist/components/wm-optgroup.d.ts +0 -11
- package/dist/components/wm-option.d.ts +0 -11
- package/dist/components/wm-pagination.d.ts +0 -11
- package/dist/components/wm-progress-indicator.d.ts +0 -11
- package/dist/components/wm-progress-monitor.d.ts +0 -11
- package/dist/components/wm-progress-slice.d.ts +0 -11
- package/dist/components/wm-search.d.ts +0 -11
- package/dist/components/wm-select.d.ts +0 -11
- package/dist/components/wm-snackbar.d.ts +0 -11
- package/dist/components/wm-tab-item.d.ts +0 -11
- package/dist/components/wm-tab-list.d.ts +0 -11
- package/dist/components/wm-tab-panel.d.ts +0 -11
- package/dist/components/wm-tag-input.d.ts +0 -11
- package/dist/components/wm-tag-option.d.ts +0 -11
- package/dist/components/wm-textarea.d.ts +0 -11
- package/dist/components/wm-timepicker.d.ts +0 -11
- package/dist/components/wm-toggletip.d.ts +0 -11
- package/dist/components/wm-uploader.d.ts +0 -11
- package/dist/components/wm-wrapper.d.ts +0 -11
- package/dist/ripple/index-CU5QNCKv.js +0 -4167
- package/dist/ripple/priv-calendar.entry.js +0 -566
- package/dist/ripple/priv-chart-popover.entry.js +0 -134
- package/dist/ripple/priv-navigator-button.entry.js +0 -24
- package/dist/ripple/wm-action-menu.entry.js +0 -201
- package/dist/ripple/wm-button.entry.js +0 -197
- package/dist/ripple/wm-date-range.entry.js +0 -477
- package/dist/ripple/wm-datepicker.entry.js +0 -247
- package/dist/ripple/wm-file-list.entry.js +0 -18
- package/dist/ripple/wm-line-chart.entry.js +0 -449
- package/dist/ripple/wm-modal-pss.entry.js +0 -135
- package/dist/ripple/wm-navigation-hamburger.entry.js +0 -48
- package/dist/ripple/wm-navigation.entry.js +0 -116
- package/dist/ripple/wm-pagination.entry.js +0 -223
- package/dist/ripple/wm-progress-indicator.entry.js +0 -107
- package/dist/ripple/wm-progress-slice.entry.js +0 -13
- package/dist/ripple/wm-snackbar.entry.js +0 -185
- package/dist/ripple/wm-tab-list.entry.js +0 -175
- package/dist/ripple/wm-tab-panel.entry.js +0 -32
- package/dist/ripple/wm-tag-input.entry.js +0 -877
- package/dist/ripple/wm-textarea.entry.js +0 -79
- package/dist/ripple/wm-timepicker.entry.js +0 -300
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
document.addEventListener("wmSelectBlurred", renderErrors);
|
|
2
|
+
|
|
3
|
+
function renderErrors() {
|
|
4
|
+
const errorDiv = document.getElementById("errors");
|
|
5
|
+
const select = document.getElementById("select1");
|
|
6
|
+
const selectedOption = Array.from(select.querySelectorAll("wm-option")).filter((o) => o.selected)[0];
|
|
7
|
+
|
|
8
|
+
if (selectedOption.value === "C") {
|
|
9
|
+
select.invalid = true;
|
|
10
|
+
select.errorMessage = "C is my least favorite letter.";
|
|
11
|
+
} else {
|
|
12
|
+
select.invalid = false;
|
|
13
|
+
select.errorMessage = null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function testSelectedOption(selectComp) {
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
// making sure the selected and aria-selected attributes are always in sync
|
|
20
|
+
const options = selectComp.querySelectorAll("wm-option");
|
|
21
|
+
let selectedOption = Array.from(options).filter((option) => !!option.selected)[0];
|
|
22
|
+
const ariaSelectedOption = Array.from(options).filter((option) => !!option.getAttribute("aria-selected"))[0];
|
|
23
|
+
if (selectedOption != ariaSelectedOption) {
|
|
24
|
+
console.log(selectComp.id, selectedOption, ariaSelectedOption);
|
|
25
|
+
}
|
|
26
|
+
}, 150);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const selects = document.querySelectorAll("wm-select");
|
|
30
|
+
selects.forEach((select) => {
|
|
31
|
+
select.addEventListener("wmOptionSelected", (ev) => handleOptionSelected(ev));
|
|
32
|
+
select.addEventListener("wmOptionDeselected", (ev) => handleOptionDeselected(ev));
|
|
33
|
+
select.addEventListener("wmSelectAllSelected", (ev) => handleAllSelected(ev));
|
|
34
|
+
select.addEventListener("wmSelectAllDeselected", (ev) => handleAllDeselected(ev));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function handleOptionSelected(ev) {
|
|
38
|
+
const parentSelect = ev.target.parentElement;
|
|
39
|
+
|
|
40
|
+
if (!parentSelect.multiple) {
|
|
41
|
+
// in single select, deselect all other options
|
|
42
|
+
parentSelect.querySelectorAll("wm-option").forEach((option) => (option.selected = false));
|
|
43
|
+
}
|
|
44
|
+
ev.target.selected = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleOptionDeselected(ev) {
|
|
48
|
+
ev.target.selected = false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function handleAllSelected(ev) {
|
|
52
|
+
ev.target.querySelectorAll("wm-option").forEach((option) => (option.selected = true));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function handleAllDeselected(ev) {
|
|
56
|
+
ev.target.querySelectorAll("wm-option").forEach((option) => (option.selected = false));
|
|
57
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
let notifications = [];
|
|
2
|
+
|
|
3
|
+
function getRandomId() {
|
|
4
|
+
return (Math.floor(Math.random() * 10000) + 1).toString();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function generateSnackbar(id, message, link, newWindow) {
|
|
8
|
+
let newNotification = {
|
|
9
|
+
id: id,
|
|
10
|
+
message: message,
|
|
11
|
+
link: link,
|
|
12
|
+
newWindow: newWindow,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const snackbar = document.getElementById("snackbar");
|
|
16
|
+
notifications = [newNotification, ...notifications];
|
|
17
|
+
snackbar.notifications = JSON.stringify(notifications);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function generateBasicSnackbar() {
|
|
21
|
+
const id = getRandomId();
|
|
22
|
+
const message = `Snackbar's id: ${id}`;
|
|
23
|
+
const link = "View this person in the table";
|
|
24
|
+
const newWindow = false;
|
|
25
|
+
generateSnackbar(id, message, link, newWindow);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function generateCustomSnackbar() {
|
|
29
|
+
const id = getRandomId();
|
|
30
|
+
const message = document.getElementById("custom-notif").value;
|
|
31
|
+
const link = document.getElementById("custom-link").value;
|
|
32
|
+
const newWindow = link && document.getElementById("new-window").checked;
|
|
33
|
+
generateSnackbar(id, message, link, newWindow);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function updateSnackText() {
|
|
37
|
+
notifications[0].message = notifications[0].message === "DING" ? "DONG" : "DING";
|
|
38
|
+
const snackbar = document.querySelector("#snackbar");
|
|
39
|
+
snackbar.notifications = JSON.stringify(notifications);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
document.querySelector("#snack-basic").addEventListener("click", () => generateBasicSnackbar());
|
|
43
|
+
document.querySelector("#snack-custom").addEventListener("click", () => generateCustomSnackbar());
|
|
44
|
+
document.querySelector("#snack-update").addEventListener("click", () => updateSnackText());
|
|
45
|
+
|
|
46
|
+
document.addEventListener("wmSnackbarSnackFinished", function (ev) {
|
|
47
|
+
const snackbar = document.getElementById("snackbar");
|
|
48
|
+
let newSnacks = notifications.filter((snack) => snack.id !== ev.detail.id);
|
|
49
|
+
notifications = newSnacks;
|
|
50
|
+
snackbar.notifications = JSON.stringify(notifications);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
document.addEventListener("wmSnackbarActionTriggered", function (ev) {
|
|
54
|
+
const snackbar = document.getElementById("snackbar");
|
|
55
|
+
let newSnacks = JSON.parse(snackbar.notifications).filter(function (snack) {
|
|
56
|
+
return snack.id !== +ev.detail.id;
|
|
57
|
+
});
|
|
58
|
+
snackbar.notifications = JSON.stringify(newSnacks);
|
|
59
|
+
console.log("You clicked the action.");
|
|
60
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const tab1 = document.getElementById("tab-1");
|
|
2
|
+
if (tab1) {
|
|
3
|
+
tab1.addEventListener("wmTabSelected", function (ev) {
|
|
4
|
+
let activeTab = ev.detail.tabId;
|
|
5
|
+
let tabContainer = document.getElementById("tab-1-wrapper");
|
|
6
|
+
let panel = tabContainer.querySelector("#tab-panel");
|
|
7
|
+
let tabList = document.getElementById("tab-1");
|
|
8
|
+
|
|
9
|
+
tabList.selectedTab = activeTab;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const cloudTabs = document.getElementById("cloud-tabs");
|
|
13
|
+
cloudTabs &&
|
|
14
|
+
cloudTabs.addEventListener("wmTabSelected", (ev) => {
|
|
15
|
+
const tabId = ev.detail.tabId;
|
|
16
|
+
const cloudTabs = document.getElementById("cloud-tabs");
|
|
17
|
+
cloudTabs.selectedTab = tabId;
|
|
18
|
+
let panel = document.querySelector(`wm-tab-panel[tab-id=${tabId}]`);
|
|
19
|
+
console.log(panel);
|
|
20
|
+
|
|
21
|
+
if (panel) {
|
|
22
|
+
let text;
|
|
23
|
+
|
|
24
|
+
switch (tabId) {
|
|
25
|
+
case "cumulonimbus":
|
|
26
|
+
text =
|
|
27
|
+
'Cumulonimbus (from Latin cumulus, "heaped" and nimbus, "rainstorm") is a dense, towering vertical cloud.';
|
|
28
|
+
break;
|
|
29
|
+
case "cirrostratus":
|
|
30
|
+
text =
|
|
31
|
+
"Cirrostratus /ˌsɪroʊˈstrɑːtəs/ is a high-level, very thin, generally uniform stratiform genus-type of cloud.";
|
|
32
|
+
break;
|
|
33
|
+
case "altostratus":
|
|
34
|
+
text =
|
|
35
|
+
"Altostratus is a middle altitude cloud genus belonging to the stratiform physical category characterized by a generally uniform gray to bluish-green sheet or layer.";
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
text = "";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
panel.innerHTML = text;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const allTagInputs = document.querySelectorAll("wm-tag-input");
|
|
2
|
+
|
|
3
|
+
allTagInputs.forEach((ti) => {
|
|
4
|
+
const initialTags = Array.from(ti.querySelectorAll("wm-tag-option")).map((o) => o.textContent);
|
|
5
|
+
|
|
6
|
+
ti.addEventListener("wmTagInputTagAdded", (ev) => {
|
|
7
|
+
const ciTagName = ev.detail.toLowerCase().trim();
|
|
8
|
+
const ciExistingTagNames = Array.from(ti.querySelectorAll("wm-tag-option")).map((o) =>
|
|
9
|
+
o.textContent.toLowerCase().trim()
|
|
10
|
+
);
|
|
11
|
+
if (ti.tagInputType === "dropdown" && !ciExistingTagNames.includes(ciTagName)) {
|
|
12
|
+
const to = document.createElement("wm-tag-option");
|
|
13
|
+
to.textContent = ev.detail;
|
|
14
|
+
to.id = "tag" + Math.random().toString(36).substr(2, 6);
|
|
15
|
+
to.selected = true;
|
|
16
|
+
ti.appendChild(to);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
ti.addEventListener("wmTagOptionSelected", (ev) => {
|
|
21
|
+
ev.target.selected = true;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
ti.addEventListener("wmTagOptionDeselected", (ev) => {
|
|
25
|
+
const isUserTag = !initialTags.includes(ev.target.textContent);
|
|
26
|
+
if (isUserTag) {
|
|
27
|
+
ev.target.remove();
|
|
28
|
+
} else {
|
|
29
|
+
ev.target.selected = false;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const textAreaEls = document.querySelectorAll("wm-textarea");
|
|
2
|
+
|
|
3
|
+
textAreaEls.forEach((textAreaEl) => {
|
|
4
|
+
textAreaEl.addEventListener("wmTextareaValueChanged", (ev) => {
|
|
5
|
+
console.log("wmTextareaValueChanged heard: ", ev.target.value);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
textAreaEl.addEventListener("blur", (ev) => {
|
|
9
|
+
textAreaEl.characterLimit && handleCharacterLimit(textAreaEl);
|
|
10
|
+
textAreaEl.requiredField && handleRequiredTextArea(textAreaEl);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
function handleCharacterLimit(textAreaEl) {
|
|
14
|
+
if (textAreaEl.value.length > textAreaEl.characterLimit) {
|
|
15
|
+
textAreaEl.errorMessage = "Character limit exceeded, please reduce entered text.";
|
|
16
|
+
} else if (textAreaEl.errorMessage == "Character limit exceeded, please reduce entered text.") {
|
|
17
|
+
textAreaEl.errorMessage = "";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function handleRequiredTextArea(textAreaEl) {
|
|
22
|
+
if (textAreaEl.value.length == 0) {
|
|
23
|
+
textAreaEl.errorMessage = "This field is required.";
|
|
24
|
+
} else if (textAreaEl.errorMessage == "This field is required.") {
|
|
25
|
+
textAreaEl.errorMessage = "";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const timepickers = document.querySelectorAll("wm-timepicker");
|
|
2
|
+
|
|
3
|
+
timepickers.forEach((timepicker) => {
|
|
4
|
+
timepicker.addEventListener("wmTimepickerInputBlurred", async (ev) => {
|
|
5
|
+
// reformat time and validate for invalid date
|
|
6
|
+
if (timepicker.value) {
|
|
7
|
+
if (await timepicker.isValidTime(ev.target.value)) {
|
|
8
|
+
const displayTime = await timepicker.reformatTime("12", timepicker.value);
|
|
9
|
+
|
|
10
|
+
timepicker.errorMessage = "";
|
|
11
|
+
timepicker.value = displayTime;
|
|
12
|
+
} else {
|
|
13
|
+
timepicker.errorMessage = "Please enter a valid time";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
timepicker.addEventListener("blur", (ev) => {
|
|
19
|
+
// validate for required time
|
|
20
|
+
if (timepicker.requiredField && timepicker.value === "") {
|
|
21
|
+
timepicker.errorMessage = "A time is required";
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
timepicker.addEventListener("wmTimepickerTimeSelected", async (ev) => {
|
|
26
|
+
// handle user time selection
|
|
27
|
+
const selectedTime = ev.detail.time;
|
|
28
|
+
|
|
29
|
+
timepicker.errorMessage = "";
|
|
30
|
+
timepicker.value = await timepicker.reformatTime("12", selectedTime);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
requestAnimationFrame(() => {
|
|
2
|
+
// put toggletip in shadow DOM
|
|
3
|
+
const host = document.querySelector("#host");
|
|
4
|
+
const shadow = host.attachShadow({ mode: "open" });
|
|
5
|
+
const tsd = document.querySelector("#tsd");
|
|
6
|
+
tsd.label = "Toggletip in shadow DOM";
|
|
7
|
+
tsd.tooltip = "Toggletip in shadow DOM";
|
|
8
|
+
shadow.appendChild(tsd);
|
|
9
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
function addServerError() {
|
|
2
|
+
document.getElementById("uploader11").errorMessage = "An error has occurred!";
|
|
3
|
+
}
|
|
4
|
+
const uploaders = document.querySelectorAll("wm-uploader");
|
|
5
|
+
|
|
6
|
+
uploaders.forEach((upl) => {
|
|
7
|
+
upl.addEventListener("wmUploaderFilesSelected", (ev) => handleFilesSelected(ev));
|
|
8
|
+
upl.addEventListener("wmFileErrorCleared", (ev) => handleErrorCleared(ev));
|
|
9
|
+
upl.addEventListener("wmFileDownload", (ev) => alert("downloading " + ev.target.id));
|
|
10
|
+
upl.addEventListener("wmFilePreview", (ev) => alert("previewing " + ev.target.id));
|
|
11
|
+
upl.addEventListener("wmFileDelete", (ev) => removeFile(ev));
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
function validateFile(upl, file) {
|
|
15
|
+
const fileList = Array.from(upl.querySelectorAll("wm-file:not([error-message])"));
|
|
16
|
+
const sizeLimit = 100; // in MB
|
|
17
|
+
|
|
18
|
+
if (fileList.some((currentFile) => `${currentFile.name}.${currentFile.type}` === `${file.name}.${file.type}`)) {
|
|
19
|
+
// check for duplicate file name
|
|
20
|
+
return `A file named "${file.name}.${file.type}" has already been uploaded.`;
|
|
21
|
+
} else if (upl.maxSize && file.size / (1024 * 1024) > sizeLimit) {
|
|
22
|
+
// check against maxSize
|
|
23
|
+
return `The file is larger than maximum size ${upl.maxSize}.`;
|
|
24
|
+
} else if (!upl.fileTypes.split(" ").includes(file.type)) {
|
|
25
|
+
// check against accepted file types
|
|
26
|
+
return `.${file.type} is not an accepted file type.`;
|
|
27
|
+
} else {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function addFile(upl, newFile) {
|
|
33
|
+
const newFileEl = document.createElement("wm-file");
|
|
34
|
+
const convertedSize = convertBytes(newFile.size);
|
|
35
|
+
newFileEl.id = newFile.id;
|
|
36
|
+
newFileEl.name = newFile.name;
|
|
37
|
+
newFileEl.type = newFile.type;
|
|
38
|
+
newFileEl.lastUpdated = newFile.lastUpdated;
|
|
39
|
+
newFileEl.size = `${convertedSize.size} ${convertedSize.unit}`;
|
|
40
|
+
newFileEl.progress = newFile.progress;
|
|
41
|
+
|
|
42
|
+
upl.append(newFileEl);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function addError(upl, newFile, errorMessage) {
|
|
46
|
+
const newFileEl = document.createElement("wm-file");
|
|
47
|
+
newFileEl.id = newFile.id;
|
|
48
|
+
newFileEl.name = newFile.name;
|
|
49
|
+
newFileEl.type = newFile.type;
|
|
50
|
+
newFileEl.errorMessage = errorMessage;
|
|
51
|
+
upl.prepend(newFileEl);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function removeFile(ev) {
|
|
55
|
+
const upl = ev.target.parentElement;
|
|
56
|
+
const fileId = ev.target.id;
|
|
57
|
+
upl.querySelector(`#${fileId}`).remove();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function handleFilesSelected(ev) {
|
|
61
|
+
const upl = ev.target;
|
|
62
|
+
const selectedFiles = ev.detail;
|
|
63
|
+
let currentFiles = upl.querySelectorAll("wm-file:not([error-message])");
|
|
64
|
+
|
|
65
|
+
if (upl.maxFiles && currentFiles.length + selectedFiles.length > upl.maxFiles) {
|
|
66
|
+
// validate for number of files exceeding file limit
|
|
67
|
+
upl.errorMessage = "Upload unsuccessful because file selection would exceed the maximum number of files";
|
|
68
|
+
} else {
|
|
69
|
+
upl.errorMessage = "";
|
|
70
|
+
|
|
71
|
+
selectedFiles.map((file, idx) => {
|
|
72
|
+
const filenameParts = file.name.split(".");
|
|
73
|
+
const fileType = filenameParts.pop();
|
|
74
|
+
const name = filenameParts.join(".");
|
|
75
|
+
const currentDate = `${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`;
|
|
76
|
+
const fileId = `file${Math.floor(Math.random() * 9999)}`; // mock random file id
|
|
77
|
+
const uploadStagger = idx * 2000; // stagger for more realistic mocked upload "speed"
|
|
78
|
+
const newFile = {
|
|
79
|
+
id: fileId,
|
|
80
|
+
name: name,
|
|
81
|
+
type: fileType,
|
|
82
|
+
lastUpdated: currentDate,
|
|
83
|
+
size: file.size,
|
|
84
|
+
progress: 0,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const fileError = validateFile(upl, newFile);
|
|
88
|
+
if (!fileError) {
|
|
89
|
+
addFile(upl, newFile);
|
|
90
|
+
|
|
91
|
+
// mock series of upload progress updates
|
|
92
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 25), 1000);
|
|
93
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 50), 3000 + uploadStagger);
|
|
94
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 75), 3250 + uploadStagger);
|
|
95
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 100), 3500 + uploadStagger);
|
|
96
|
+
} else {
|
|
97
|
+
addError(upl, newFile, fileError);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function updateUploadProgress(upl, fileId, mockProgress) {
|
|
104
|
+
const fileEl = upl.querySelector(`#${fileId}`);
|
|
105
|
+
fileEl.progress = mockProgress;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function handleErrorCleared(ev) {
|
|
109
|
+
const upl = ev.target.parentElement;
|
|
110
|
+
const errorId = ev.target.id;
|
|
111
|
+
upl.querySelector(`#${errorId}`).remove();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function handleSubmit() {
|
|
115
|
+
const requiredUploader = document.getElementById("uploader2");
|
|
116
|
+
const fileList = requiredUploader.querySelectorAll("wm-file:not([error-message])");
|
|
117
|
+
requiredUploader.errorMessage = fileList.length === 0 ? "Please upload at least one file" : "";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function convertBytes(bytes, unit) {
|
|
121
|
+
const unitOrder = ["bytes", "KB", "MB", "GB", "TB"];
|
|
122
|
+
let unitIndex = 0;
|
|
123
|
+
let result = typeof bytes === "number" ? bytes : parseInt(bytes);
|
|
124
|
+
|
|
125
|
+
if (unit) {
|
|
126
|
+
// convert until result matches desired unit
|
|
127
|
+
while (unitOrder.indexOf(unit) > unitIndex) {
|
|
128
|
+
result /= 1024;
|
|
129
|
+
unitIndex++;
|
|
130
|
+
}
|
|
131
|
+
} else {
|
|
132
|
+
// convert until result is appropriate unit (value is under 1000)
|
|
133
|
+
while (result > 1000) {
|
|
134
|
+
result /= 1024;
|
|
135
|
+
unitIndex++;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { size: result, unit: unitOrder[unitIndex] };
|
|
139
|
+
}
|