@mozaic-ds/web-components 1.0.0-alpha.0 → 1.0.0-alpha.2
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/package.json +34 -35
- package/public/attributes-Dd-ZbJDt.js +2 -0
- package/public/attributes-Dd-ZbJDt.js.map +1 -0
- package/public/bundle.js +11 -279
- package/public/components/badge/Badge.js +1 -1
- package/public/components/badge/Badge.js.map +1 -1
- package/public/components/badge/Badge.svelte +9 -12
- package/public/components/button/Button.js +1 -1
- package/public/components/button/Button.js.map +1 -1
- package/public/components/button/Button.svelte +70 -49
- package/public/components/button/IconButton.js +1 -1
- package/public/components/button/IconButton.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +1 -1
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkbox/Checkbox.svelte +29 -31
- package/public/components/checkboxgroup/checkboxGroup.js +1 -1
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/checkboxgroup/checkboxGroup.svelte +25 -35
- package/public/components/field/Field.js +1 -1
- package/public/components/field/Field.js.map +1 -1
- package/public/components/field/Field.svelte +31 -13
- package/public/components/iconbutton/IconButton.svelte +23 -13
- package/public/components/link/Link.js +1 -1
- package/public/components/link/Link.js.map +1 -1
- package/public/components/link/Link.svelte +1 -7
- package/public/components/loader/Loader.js +1 -1
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.svelte +10 -5
- package/public/components/overlay/Overlay.js +1 -1
- package/public/components/overlay/Overlay.js.map +1 -1
- package/public/components/overlay/Overlay.svelte +8 -4
- package/public/components/overlay/OverlayLoader.js +1 -1
- package/public/components/overlay/OverlayLoader.js.map +1 -1
- package/public/components/overlayloader/OverlayLoader.svelte +8 -4
- package/public/components/quantityselector/QuantitySelector.js +1 -1
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.svelte +47 -34
- package/public/components/radio/Radio.js +1 -1
- package/public/components/radio/Radio.js.map +1 -1
- package/public/components/radio/Radio.svelte +11 -22
- package/public/components/radiogroup/RadioGroup.js +1 -1
- package/public/components/radiogroup/RadioGroup.js.map +1 -1
- package/public/components/radiogroup/RadioGroup.svelte +25 -28
- package/public/components/select/Select.js +1 -1
- package/public/components/select/Select.js.map +1 -1
- package/public/components/select/Select.svelte +34 -30
- package/public/components/statusbadge/StatusBadge.js +1 -1
- package/public/components/statusbadge/StatusBadge.js.map +1 -1
- package/public/components/statusbadge/StatusBadge.svelte +6 -2
- package/public/components/statusbadge/StatusDot.js +1 -1
- package/public/components/statusbadge/StatusDot.js.map +1 -1
- package/public/components/statusdot/StatusDot.svelte +7 -3
- package/public/components/textarea/Textarea.js +1 -1
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textarea/Textarea.svelte +30 -28
- package/public/components/textinput/Textinput.js +1 -1
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.svelte +48 -50
- package/public/components/toggle/Toggle.js +1 -1
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/components/toggle/Toggle.svelte +19 -24
- package/public/custom-element-D6iR2OWc.js +2 -0
- package/public/custom-element-D6iR2OWc.js.map +1 -0
- package/public/each-BEbHCKXS.js +2 -0
- package/public/each-BEbHCKXS.js.map +1 -0
- package/public/html-BTWDDGk7.js +2 -0
- package/public/html-BTWDDGk7.js.map +1 -0
- package/public/if-CxjAhvpF.js +2 -0
- package/public/if-CxjAhvpF.js.map +1 -0
- package/public/input-D1i5U2EE.js +2 -0
- package/public/input-D1i5U2EE.js.map +1 -0
- package/public/main.d.ts +22 -56
- package/public/main.d.ts.map +1 -1
- package/public/slot-snFjRYH3.js +2 -0
- package/public/slot-snFjRYH3.js.map +1 -0
- package/public/utilities/ClickOutside.d.ts +0 -1
- package/public/utilities/ClickOutside.d.ts.map +1 -1
- package/public/utilities/EventForward.d.ts.map +1 -1
- package/public/EventForward-bb916157.js +0 -2
- package/public/EventForward-bb916157.js.map +0 -1
- package/public/EventHandler-f7ee47ca.js +0 -2
- package/public/EventHandler-f7ee47ca.js.map +0 -1
- package/public/components/accordion/Accordion.svelte +0 -98
- package/public/components/accordion/accordion.types.d.ts +0 -2
- package/public/components/accordion/accordion.types.d.ts.map +0 -1
- package/public/components/actionbar/ActionBar.svelte +0 -97
- package/public/components/autocomplete/Autocomplete.svelte +0 -442
- package/public/components/autocomplete/autocomplete.types.d.ts +0 -3
- package/public/components/autocomplete/autocomplete.types.d.ts.map +0 -1
- package/public/components/barchart/BarChart.svelte +0 -318
- package/public/components/bottombar/BottomBar.svelte +0 -18
- package/public/components/breadcrumb/Breadcrumb.svelte +0 -63
- package/public/components/breadcrumb/breadcrumb.types.d.ts +0 -7
- package/public/components/breadcrumb/breadcrumb.types.d.ts.map +0 -1
- package/public/components/card/Card.svelte +0 -56
- package/public/components/card/card.types.d.ts +0 -4
- package/public/components/card/card.types.d.ts.map +0 -1
- package/public/components/carousel/Carousel.svelte +0 -419
- package/public/components/carousel/carousel.types.d.ts +0 -19
- package/public/components/carousel/carousel.types.d.ts.map +0 -1
- package/public/components/chart/bar-chart.types.d.ts +0 -26
- package/public/components/chart/bar-chart.types.d.ts.map +0 -1
- package/public/components/chart/donut.types.d.ts +0 -13
- package/public/components/chart/donut.types.d.ts.map +0 -1
- package/public/components/chart/grouped-bar-chart.types.d.ts +0 -25
- package/public/components/chart/grouped-bar-chart.types.d.ts.map +0 -1
- package/public/components/chart/line-chart.types.d.ts +0 -14
- package/public/components/chart/line-chart.types.d.ts.map +0 -1
- package/public/components/chart/radar.types.d.ts +0 -10
- package/public/components/chart/radar.types.d.ts.map +0 -1
- package/public/components/datatable/DataTable.svelte +0 -935
- package/public/components/datatable/data.d.ts +0 -9
- package/public/components/datatable/data.d.ts.map +0 -1
- package/public/components/datatable/datatable-default-action.nested.svelte +0 -341
- package/public/components/datatable/datatable-default-edtion.nested.svelte +0 -64
- package/public/components/datatable/datatable-default-filter-tags.nested.svelte +0 -117
- package/public/components/datatable/datatable-default-footer.nested.svelte +0 -136
- package/public/components/datatable/datatable-default-selection-label.nested.svelte +0 -56
- package/public/components/datatable/datatable-default-selection.nested.svelte +0 -85
- package/public/components/datatable/datatable.types.d.ts +0 -170
- package/public/components/datatable/datatable.types.d.ts.map +0 -1
- package/public/components/donut/Donut.svelte +0 -439
- package/public/components/dropdown/Dropdown.svelte +0 -355
- package/public/components/fileuploader/FileUploader.svelte +0 -201
- package/public/components/fileuploader/fileuploader-result.nested.svelte +0 -118
- package/public/components/fileuploader-result/fileuploader-result.svelte +0 -118
- package/public/components/flag/Flag.svelte +0 -45
- package/public/components/flag/flag.types.d.ts +0 -2
- package/public/components/flag/flag.types.d.ts.map +0 -1
- package/public/components/groupedbarchart/GroupedBarChart.svelte +0 -446
- package/public/components/header/Header.svelte +0 -194
- package/public/components/header/Header.types.d.ts +0 -5
- package/public/components/header/Header.types.d.ts.map +0 -1
- package/public/components/hero/Hero.svelte +0 -58
- package/public/components/hero/hero.type.d.ts +0 -7
- package/public/components/hero/hero.type.d.ts.map +0 -1
- package/public/components/kpi/Kpi.svelte +0 -237
- package/public/components/layer/Layer.svelte +0 -121
- package/public/components/layer/layer.types.d.ts +0 -2
- package/public/components/layer/layer.types.d.ts.map +0 -1
- package/public/components/linechart/LineChart.svelte +0 -327
- package/public/components/listbox/Listbox.nested.svelte +0 -157
- package/public/components/listbox/Listbox.svelte +0 -101
- package/public/components/listbox/listbox.types.d.ts +0 -8
- package/public/components/listbox/listbox.types.d.ts.map +0 -1
- package/public/components/menu/Menu.svelte +0 -66
- package/public/components/menu/menu.types.d.ts +0 -9
- package/public/components/menu/menu.types.d.ts.map +0 -1
- package/public/components/modal/Modal.svelte +0 -92
- package/public/components/notification/Notification.svelte +0 -97
- package/public/components/notification/notification.types.d.ts +0 -14
- package/public/components/notification/notification.types.d.ts.map +0 -1
- package/public/components/optionbutton/OptionButton.svelte +0 -64
- package/public/components/optionbutton/optionbutton.types.d.ts +0 -10
- package/public/components/optionbutton/optionbutton.types.d.ts.map +0 -1
- package/public/components/pagination/Pagination.svelte +0 -125
- package/public/components/pagination/pagination.types.d.ts +0 -2
- package/public/components/pagination/pagination.types.d.ts.map +0 -1
- package/public/components/passwordinput/PasswordInput.svelte +0 -65
- package/public/components/passwordinput/passwordinput.types.d.ts +0 -6
- package/public/components/passwordinput/passwordinput.types.d.ts.map +0 -1
- package/public/components/phonenumber/PhoneNumber.svelte +0 -337
- package/public/components/phonenumber/phonenumber.types.d.ts +0 -15
- package/public/components/phonenumber/phonenumber.types.d.ts.map +0 -1
- package/public/components/price/Price.svelte +0 -224
- package/public/components/price/price.types.d.ts +0 -2
- package/public/components/price/price.types.d.ts.map +0 -1
- package/public/components/progressbar/ProgressBar.svelte +0 -53
- package/public/components/progressbar/progressbar.types.d.ts +0 -2
- package/public/components/progressbar/progressbar.types.d.ts.map +0 -1
- package/public/components/radar/Radar.svelte +0 -386
- package/public/components/ratings/ratings.types.d.ts +0 -2
- package/public/components/ratings/ratings.types.d.ts.map +0 -1
- package/public/components/segmentedcontrol/SegmentedControl.svelte +0 -61
- package/public/components/segmentedcontrol/segmentedControl.types.d.ts +0 -9
- package/public/components/segmentedcontrol/segmentedControl.types.d.ts.map +0 -1
- package/public/components/sidebar/Sidebar.svelte +0 -282
- package/public/components/sidebar/sidebar-feature-group.nested.svelte +0 -311
- package/public/components/sidebar/sidebar-feature.nested.svelte +0 -249
- package/public/components/sidebar/sidebar-section.nested.svelte +0 -138
- package/public/components/sidebar/sidebar-segment.nested.svelte +0 -136
- package/public/components/sidebar/sidebar-separator.nested.svelte +0 -30
- package/public/components/sidebar/sidebar-service.d.ts +0 -20
- package/public/components/sidebar/sidebar-service.d.ts.map +0 -1
- package/public/components/sidebar/sidebar-sub-features.nested.svelte +0 -118
- package/public/components/sidebar/sidebar-user.nested.svelte +0 -292
- package/public/components/sidebar/sidebar.types.d.ts +0 -44
- package/public/components/sidebar/sidebar.types.d.ts.map +0 -1
- package/public/components/stackedbarchart/StackedBarChart.svelte +0 -348
- package/public/components/starsinput/StarsInput.svelte +0 -77
- package/public/components/starsresult/StarsResult.svelte +0 -85
- package/public/components/stepper/Stepper.svelte +0 -97
- package/public/components/stepper/stepper.types.d.ts +0 -6
- package/public/components/stepper/stepper.types.d.ts.map +0 -1
- package/public/components/stepperbar/StepperBar.svelte +0 -101
- package/public/components/tabs/Tabs.svelte +0 -170
- package/public/components/tabs/tabs.types.d.ts +0 -14
- package/public/components/tabs/tabs.types.d.ts.map +0 -1
- package/public/components/tag/Tag.svelte +0 -118
- package/public/components/tag/tag.types.d.ts +0 -9
- package/public/components/tag/tag.types.d.ts.map +0 -1
- package/public/components/taglist/TagList.svelte +0 -84
- package/public/components/tooltip/Tooltip.svelte +0 -36
- package/public/components/tooltip/tooltip.types.d.ts +0 -2
- package/public/components/tooltip/tooltip.types.d.ts.map +0 -1
- package/public/each-45e2db5c.js +0 -2
- package/public/each-45e2db5c.js.map +0 -1
- package/public/index-c0bfe08f.js +0 -2
- package/public/index-c0bfe08f.js.map +0 -1
- package/public/spread-ed04f539.js +0 -2
- package/public/spread-ed04f539.js.map +0 -1
- package/public/stories/carousel/items.d.ts +0 -3
- package/public/stories/carousel/items.d.ts.map +0 -1
- package/public/utilities/ClickOutside.js +0 -2
- package/public/utilities/ClickOutside.js.map +0 -1
- package/public/utilities/DataTableUtilities.d.ts +0 -19
- package/public/utilities/DataTableUtilities.d.ts.map +0 -1
- package/public/utilities/DataTableUtilities.ts +0 -507
- package/public/utilities/EventForward.js +0 -2
- package/public/utilities/EventForward.js.map +0 -1
- package/public/utilities/additional-svelte-jsx.d.ts +0 -9
- package/public/utilities/components/accordion/accordion.types.d.ts +0 -2
- package/public/utilities/components/accordion/accordion.types.d.ts.map +0 -1
- package/public/utilities/components/autocomplete/autocomplete.types.d.ts +0 -3
- package/public/utilities/components/autocomplete/autocomplete.types.d.ts.map +0 -1
- package/public/utilities/components/badge/badge.types.d.ts +0 -3
- package/public/utilities/components/badge/badge.types.d.ts.map +0 -1
- package/public/utilities/components/breadcrumb/breadcrumb.types.d.ts +0 -7
- package/public/utilities/components/breadcrumb/breadcrumb.types.d.ts.map +0 -1
- package/public/utilities/components/button/button.types.d.ts +0 -13
- package/public/utilities/components/button/button.types.d.ts.map +0 -1
- package/public/utilities/components/card/card.types.d.ts +0 -4
- package/public/utilities/components/card/card.types.d.ts.map +0 -1
- package/public/utilities/components/carousel/carousel.types.d.ts +0 -19
- package/public/utilities/components/carousel/carousel.types.d.ts.map +0 -1
- package/public/utilities/components/chart/bar-chart.types.d.ts +0 -26
- package/public/utilities/components/chart/bar-chart.types.d.ts.map +0 -1
- package/public/utilities/components/chart/donut.types.d.ts +0 -13
- package/public/utilities/components/chart/donut.types.d.ts.map +0 -1
- package/public/utilities/components/chart/grouped-bar-chart.types.d.ts +0 -25
- package/public/utilities/components/chart/grouped-bar-chart.types.d.ts.map +0 -1
- package/public/utilities/components/chart/line-chart.types.d.ts +0 -14
- package/public/utilities/components/chart/line-chart.types.d.ts.map +0 -1
- package/public/utilities/components/chart/radar.types.d.ts +0 -10
- package/public/utilities/components/chart/radar.types.d.ts.map +0 -1
- package/public/utilities/components/checkboxgroup/checkboxgroup.types.d.ts +0 -11
- package/public/utilities/components/checkboxgroup/checkboxgroup.types.d.ts.map +0 -1
- package/public/utilities/components/datatable/data.d.ts +0 -9
- package/public/utilities/components/datatable/data.d.ts.map +0 -1
- package/public/utilities/components/datatable/datatable.types.d.ts +0 -170
- package/public/utilities/components/datatable/datatable.types.d.ts.map +0 -1
- package/public/utilities/components/flag/flag.types.d.ts +0 -2
- package/public/utilities/components/flag/flag.types.d.ts.map +0 -1
- package/public/utilities/components/header/Header.types.d.ts +0 -5
- package/public/utilities/components/header/Header.types.d.ts.map +0 -1
- package/public/utilities/components/hero/hero.type.d.ts +0 -7
- package/public/utilities/components/hero/hero.type.d.ts.map +0 -1
- package/public/utilities/components/layer/layer.types.d.ts +0 -2
- package/public/utilities/components/layer/layer.types.d.ts.map +0 -1
- package/public/utilities/components/link/link.types.d.ts +0 -4
- package/public/utilities/components/link/link.types.d.ts.map +0 -1
- package/public/utilities/components/listbox/listbox.types.d.ts +0 -8
- package/public/utilities/components/listbox/listbox.types.d.ts.map +0 -1
- package/public/utilities/components/loader/loader.types.d.ts +0 -3
- package/public/utilities/components/loader/loader.types.d.ts.map +0 -1
- package/public/utilities/components/menu/menu.types.d.ts +0 -9
- package/public/utilities/components/menu/menu.types.d.ts.map +0 -1
- package/public/utilities/components/notification/notification.types.d.ts +0 -14
- package/public/utilities/components/notification/notification.types.d.ts.map +0 -1
- package/public/utilities/components/optionbutton/optionbutton.types.d.ts +0 -10
- package/public/utilities/components/optionbutton/optionbutton.types.d.ts.map +0 -1
- package/public/utilities/components/pagination/pagination.types.d.ts +0 -2
- package/public/utilities/components/pagination/pagination.types.d.ts.map +0 -1
- package/public/utilities/components/passwordinput/passwordinput.types.d.ts +0 -6
- package/public/utilities/components/passwordinput/passwordinput.types.d.ts.map +0 -1
- package/public/utilities/components/phonenumber/phonenumber.types.d.ts +0 -15
- package/public/utilities/components/phonenumber/phonenumber.types.d.ts.map +0 -1
- package/public/utilities/components/price/price.types.d.ts +0 -2
- package/public/utilities/components/price/price.types.d.ts.map +0 -1
- package/public/utilities/components/progressbar/progressbar.types.d.ts +0 -2
- package/public/utilities/components/progressbar/progressbar.types.d.ts.map +0 -1
- package/public/utilities/components/radiogroup/radioGroup.types.d.ts +0 -9
- package/public/utilities/components/radiogroup/radioGroup.types.d.ts.map +0 -1
- package/public/utilities/components/ratings/ratings.types.d.ts +0 -2
- package/public/utilities/components/ratings/ratings.types.d.ts.map +0 -1
- package/public/utilities/components/segmentedcontrol/segmentedControl.types.d.ts +0 -9
- package/public/utilities/components/segmentedcontrol/segmentedControl.types.d.ts.map +0 -1
- package/public/utilities/components/select/select.types.d.ts +0 -9
- package/public/utilities/components/select/select.types.d.ts.map +0 -1
- package/public/utilities/components/sidebar/sidebar-service.d.ts +0 -20
- package/public/utilities/components/sidebar/sidebar-service.d.ts.map +0 -1
- package/public/utilities/components/sidebar/sidebar.types.d.ts +0 -44
- package/public/utilities/components/sidebar/sidebar.types.d.ts.map +0 -1
- package/public/utilities/components/statusbadge/badge.types.d.ts +0 -3
- package/public/utilities/components/statusbadge/badge.types.d.ts.map +0 -1
- package/public/utilities/components/stepper/stepper.types.d.ts +0 -6
- package/public/utilities/components/stepper/stepper.types.d.ts.map +0 -1
- package/public/utilities/components/tabs/tabs.types.d.ts +0 -14
- package/public/utilities/components/tabs/tabs.types.d.ts.map +0 -1
- package/public/utilities/components/tag/tag.types.d.ts +0 -9
- package/public/utilities/components/tag/tag.types.d.ts.map +0 -1
- package/public/utilities/components/textinput/textinput.types.d.ts +0 -3
- package/public/utilities/components/textinput/textinput.types.d.ts.map +0 -1
- package/public/utilities/components/toggle/toggle.types.d.ts +0 -2
- package/public/utilities/components/toggle/toggle.types.d.ts.map +0 -1
- package/public/utilities/components/tooltip/tooltip.types.d.ts +0 -2
- package/public/utilities/components/tooltip/tooltip.types.d.ts.map +0 -1
- package/public/utilities/main.d.ts +0 -60
- package/public/utilities/main.d.ts.map +0 -1
- package/public/utilities/sidebar-service.d.ts +0 -9
- package/public/utilities/sidebar-service.d.ts.map +0 -1
- package/public/utilities/sidebar-service.ts +0 -93
- package/public/utilities/stories/accordion/Accordion.stories.d.ts +0 -17
- package/public/utilities/stories/accordion/Accordion.stories.d.ts.map +0 -1
- package/public/utilities/stories/actionbar/ActionBar.stories.d.ts +0 -7
- package/public/utilities/stories/actionbar/ActionBar.stories.d.ts.map +0 -1
- package/public/utilities/stories/autocomplete/Autocomplete.stories.d.ts +0 -10
- package/public/utilities/stories/autocomplete/Autocomplete.stories.d.ts.map +0 -1
- package/public/utilities/stories/badge/Badge.stories.d.ts +0 -8
- package/public/utilities/stories/badge/Badge.stories.d.ts.map +0 -1
- package/public/utilities/stories/bottombar/BottomBar.stories.d.ts +0 -6
- package/public/utilities/stories/bottombar/BottomBar.stories.d.ts.map +0 -1
- package/public/utilities/stories/breadcrumb/Breadcrumb.stories.d.ts +0 -7
- package/public/utilities/stories/breadcrumb/Breadcrumb.stories.d.ts.map +0 -1
- package/public/utilities/stories/button/Button.stories.d.ts +0 -8
- package/public/utilities/stories/button/Button.stories.d.ts.map +0 -1
- package/public/utilities/stories/button/IconButton.stories.d.ts +0 -7
- package/public/utilities/stories/button/IconButton.stories.d.ts.map +0 -1
- package/public/utilities/stories/card/Card.stories.d.ts +0 -7
- package/public/utilities/stories/card/Card.stories.d.ts.map +0 -1
- package/public/utilities/stories/carousel/Carousel.stories.d.ts +0 -8
- package/public/utilities/stories/carousel/Carousel.stories.d.ts.map +0 -1
- package/public/utilities/stories/carousel/items.d.ts +0 -3
- package/public/utilities/stories/carousel/items.d.ts.map +0 -1
- package/public/utilities/stories/chart/BarChart.stories.d.ts +0 -7
- package/public/utilities/stories/chart/BarChart.stories.d.ts.map +0 -1
- package/public/utilities/stories/chart/Donut.stories.d.ts +0 -7
- package/public/utilities/stories/chart/Donut.stories.d.ts.map +0 -1
- package/public/utilities/stories/chart/GroupedBarChart.stories.d.ts +0 -6
- package/public/utilities/stories/chart/GroupedBarChart.stories.d.ts.map +0 -1
- package/public/utilities/stories/chart/LineChart.stories.d.ts +0 -5
- package/public/utilities/stories/chart/LineChart.stories.d.ts.map +0 -1
- package/public/utilities/stories/chart/Radar.stories.d.ts +0 -7
- package/public/utilities/stories/chart/Radar.stories.d.ts.map +0 -1
- package/public/utilities/stories/chart/StackedBarChart.stories.d.ts +0 -6
- package/public/utilities/stories/chart/StackedBarChart.stories.d.ts.map +0 -1
- package/public/utilities/stories/checkbox/Checkbox.stories.d.ts +0 -9
- package/public/utilities/stories/checkbox/Checkbox.stories.d.ts.map +0 -1
- package/public/utilities/stories/checkbox-group/Checkbox-group.stories.d.ts +0 -7
- package/public/utilities/stories/checkbox-group/Checkbox-group.stories.d.ts.map +0 -1
- package/public/utilities/stories/datatable/DataTable.stories.d.ts +0 -15
- package/public/utilities/stories/datatable/DataTable.stories.d.ts.map +0 -1
- package/public/utilities/stories/dropdown/Dropdown.stories.d.ts +0 -9
- package/public/utilities/stories/dropdown/Dropdown.stories.d.ts.map +0 -1
- package/public/utilities/stories/field/Field.stories.d.ts +0 -10
- package/public/utilities/stories/field/Field.stories.d.ts.map +0 -1
- package/public/utilities/stories/fileuploader/FileUploader.stories.d.ts +0 -11
- package/public/utilities/stories/fileuploader/FileUploader.stories.d.ts.map +0 -1
- package/public/utilities/stories/flag/Flag.stories.d.ts +0 -6
- package/public/utilities/stories/flag/Flag.stories.d.ts.map +0 -1
- package/public/utilities/stories/header/Header.stories.d.ts +0 -9
- package/public/utilities/stories/header/Header.stories.d.ts.map +0 -1
- package/public/utilities/stories/hero/Hero.stories.d.ts +0 -8
- package/public/utilities/stories/hero/Hero.stories.d.ts.map +0 -1
- package/public/utilities/stories/icon/Icon.stories.d.ts +0 -6
- package/public/utilities/stories/icon/Icon.stories.d.ts.map +0 -1
- package/public/utilities/stories/kpi/kpi.stories.d.ts +0 -7
- package/public/utilities/stories/kpi/kpi.stories.d.ts.map +0 -1
- package/public/utilities/stories/layer/Layer.stories.d.ts +0 -9
- package/public/utilities/stories/layer/Layer.stories.d.ts.map +0 -1
- package/public/utilities/stories/link/Link.stories.d.ts +0 -7
- package/public/utilities/stories/link/Link.stories.d.ts.map +0 -1
- package/public/utilities/stories/listbox/Listbox.stories.d.ts +0 -6
- package/public/utilities/stories/listbox/Listbox.stories.d.ts.map +0 -1
- package/public/utilities/stories/loader/Loader.stories.d.ts +0 -7
- package/public/utilities/stories/loader/Loader.stories.d.ts.map +0 -1
- package/public/utilities/stories/menu/Menu.stories.d.ts +0 -5
- package/public/utilities/stories/menu/Menu.stories.d.ts.map +0 -1
- package/public/utilities/stories/modal/Modal.stories.d.ts +0 -5
- package/public/utilities/stories/modal/Modal.stories.d.ts.map +0 -1
- package/public/utilities/stories/notification/Notification.stories.d.ts +0 -13
- package/public/utilities/stories/notification/Notification.stories.d.ts.map +0 -1
- package/public/utilities/stories/optionbutton/OptionButton.stories.d.ts +0 -6
- package/public/utilities/stories/optionbutton/OptionButton.stories.d.ts.map +0 -1
- package/public/utilities/stories/overlay/Overlay.stories.d.ts +0 -5
- package/public/utilities/stories/overlay/Overlay.stories.d.ts.map +0 -1
- package/public/utilities/stories/overlay/OverlayLoader.stories.d.ts +0 -5
- package/public/utilities/stories/overlay/OverlayLoader.stories.d.ts.map +0 -1
- package/public/utilities/stories/pagination/Pagination.stories.d.ts +0 -6
- package/public/utilities/stories/pagination/Pagination.stories.d.ts.map +0 -1
- package/public/utilities/stories/passwordinput/PasswordInput.stories.d.ts +0 -5
- package/public/utilities/stories/passwordinput/PasswordInput.stories.d.ts.map +0 -1
- package/public/utilities/stories/phonenumber/PhoneNumber.stories.d.ts +0 -7
- package/public/utilities/stories/phonenumber/PhoneNumber.stories.d.ts.map +0 -1
- package/public/utilities/stories/price/Price.stories.d.ts +0 -10
- package/public/utilities/stories/price/Price.stories.d.ts.map +0 -1
- package/public/utilities/stories/progressbar/ProgressBar.stories.d.ts +0 -10
- package/public/utilities/stories/progressbar/ProgressBar.stories.d.ts.map +0 -1
- package/public/utilities/stories/quantityselector/QuantitySelector.stories.d.ts +0 -7
- package/public/utilities/stories/quantityselector/QuantitySelector.stories.d.ts.map +0 -1
- package/public/utilities/stories/radio/Radio.stories.d.ts +0 -8
- package/public/utilities/stories/radio/Radio.stories.d.ts.map +0 -1
- package/public/utilities/stories/radio-group/Radio-group.stories.d.ts +0 -7
- package/public/utilities/stories/radio-group/Radio-group.stories.d.ts.map +0 -1
- package/public/utilities/stories/ratings/StarsInput.stories.d.ts +0 -5
- package/public/utilities/stories/ratings/StarsInput.stories.d.ts.map +0 -1
- package/public/utilities/stories/ratings/StarsResult.stories.d.ts +0 -5
- package/public/utilities/stories/ratings/StarsResult.stories.d.ts.map +0 -1
- package/public/utilities/stories/segmentedcontrol/segmentedcontrol.stories.d.ts +0 -5
- package/public/utilities/stories/segmentedcontrol/segmentedcontrol.stories.d.ts.map +0 -1
- package/public/utilities/stories/select/Select.stories.d.ts +0 -8
- package/public/utilities/stories/select/Select.stories.d.ts.map +0 -1
- package/public/utilities/stories/sidebar/Sidebar.stories.d.ts +0 -5
- package/public/utilities/stories/sidebar/Sidebar.stories.d.ts.map +0 -1
- package/public/utilities/stories/status-badge/StatusBadge.stories.d.ts +0 -8
- package/public/utilities/stories/status-badge/StatusBadge.stories.d.ts.map +0 -1
- package/public/utilities/stories/status-dot/StatusDot.stories.d.ts +0 -9
- package/public/utilities/stories/status-dot/StatusDot.stories.d.ts.map +0 -1
- package/public/utilities/stories/stepper/Stepper.stories.d.ts +0 -6
- package/public/utilities/stories/stepper/Stepper.stories.d.ts.map +0 -1
- package/public/utilities/stories/stepperbar/StepperBar.stories.d.ts +0 -7
- package/public/utilities/stories/stepperbar/StepperBar.stories.d.ts.map +0 -1
- package/public/utilities/stories/tabs/Tabs.stories.d.ts +0 -9
- package/public/utilities/stories/tabs/Tabs.stories.d.ts.map +0 -1
- package/public/utilities/stories/tag/Tag.stories.d.ts +0 -8
- package/public/utilities/stories/tag/Tag.stories.d.ts.map +0 -1
- package/public/utilities/stories/taglist/Taglist.stories.d.ts +0 -6
- package/public/utilities/stories/taglist/Taglist.stories.d.ts.map +0 -1
- package/public/utilities/stories/textarea/Textarea.stories.d.ts +0 -8
- package/public/utilities/stories/textarea/Textarea.stories.d.ts.map +0 -1
- package/public/utilities/stories/textinput/Textinput.stories.d.ts +0 -7
- package/public/utilities/stories/textinput/Textinput.stories.d.ts.map +0 -1
- package/public/utilities/stories/toggle/Toggle.stories.d.ts +0 -8
- package/public/utilities/stories/toggle/Toggle.stories.d.ts.map +0 -1
- package/public/utilities/stories/tooltip/Tooltip.stories.d.ts +0 -5
- package/public/utilities/stories/tooltip/Tooltip.stories.d.ts.map +0 -1
- package/public/utilities/utilities/ClickOutside.d.ts +0 -4
- package/public/utilities/utilities/ClickOutside.d.ts.map +0 -1
- package/public/utilities/utilities/DataTableUtilities.d.ts +0 -19
- package/public/utilities/utilities/DataTableUtilities.d.ts.map +0 -1
- package/public/utilities/utilities/EventForward.d.ts +0 -10
- package/public/utilities/utilities/EventForward.d.ts.map +0 -1
- package/public/utilities/utilities/EventHandler.d.ts +0 -8
- package/public/utilities/utilities/EventHandler.d.ts.map +0 -1
- package/public/utilities/utilities/sidebar-service.d.ts +0 -9
- package/public/utilities/utilities/sidebar-service.d.ts.map +0 -1
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
<svelte:options customElement="" />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { createEventDispatcher, tick } from 'svelte';
|
|
5
|
-
// @ts-ignore Need to use internal Svelte function
|
|
6
|
-
import { get_current_component } from 'svelte/internal';
|
|
7
|
-
import { EventHandler } from '../../utilities/EventHandler';
|
|
8
|
-
import { clickOutside } from '../../utilities/ClickOutside';
|
|
9
|
-
import type { ListboxItems } from '../listbox/listbox.types';
|
|
10
|
-
import type { SelectSize } from '../select/select.types';
|
|
11
|
-
|
|
12
|
-
import Tag from '../tag/Tag.nested.svelte';
|
|
13
|
-
import Loader from '../loader/Loader.nested.svelte';
|
|
14
|
-
import Listbox from '../listbox/Listbox.nested.svelte';
|
|
15
|
-
|
|
16
|
-
export let maxwidth = '100%';
|
|
17
|
-
export let tagid: string;
|
|
18
|
-
export let taglabel = '';
|
|
19
|
-
export let placeholder = '-- Placeholder --';
|
|
20
|
-
export let disabled = false;
|
|
21
|
-
export let size: SelectSize = 'm';
|
|
22
|
-
export let isvalid: boolean;
|
|
23
|
-
export let isinvalid: boolean;
|
|
24
|
-
export let loading = false;
|
|
25
|
-
export let name: string;
|
|
26
|
-
export let items: string;
|
|
27
|
-
export let value: any;
|
|
28
|
-
export let open = false;
|
|
29
|
-
export let multiple = false;
|
|
30
|
-
export let emptysearchlabel = 'No results found';
|
|
31
|
-
export let datatextexpr = 'label';
|
|
32
|
-
export let datavalueexpr = 'value';
|
|
33
|
-
export let nosort = false;
|
|
34
|
-
export let clearfield = false;
|
|
35
|
-
export let layertitle = 'Title layer';
|
|
36
|
-
export let showmoretagslabel = 'Show more';
|
|
37
|
-
export let maxnumbertoshowtags = 12;
|
|
38
|
-
export let alltags = false;
|
|
39
|
-
export let selectall = false;
|
|
40
|
-
export let labelselectall = 'Select all';
|
|
41
|
-
|
|
42
|
-
let component: HTMLDivElement;
|
|
43
|
-
const uuid = Math.random();
|
|
44
|
-
let eventHandler = new EventHandler(
|
|
45
|
-
get_current_component(),
|
|
46
|
-
createEventDispatcher(),
|
|
47
|
-
);
|
|
48
|
-
let tag: any;
|
|
49
|
-
let tagWidth = '0px';
|
|
50
|
-
let tagValue: any;
|
|
51
|
-
let buttonvalue: string;
|
|
52
|
-
let sortedListItems: any;
|
|
53
|
-
let isfiltered = false;
|
|
54
|
-
let selectedItems: ListboxItems[] = [];
|
|
55
|
-
let openLayer: any = null;
|
|
56
|
-
|
|
57
|
-
$: parsedItems = items ? (JSON.parse(items) as ListboxItems[]) : [];
|
|
58
|
-
$: localItems = parsedItems;
|
|
59
|
-
$: listboxValue = !value && multiple ? [] : value ? JSON.parse(value) : value;
|
|
60
|
-
$: setTagLabel = () => {
|
|
61
|
-
return listboxValue.length.toString() + ' ' + taglabel;
|
|
62
|
-
};
|
|
63
|
-
$: watchListboxValue(listboxValue);
|
|
64
|
-
$: setTagWidth(tagValue);
|
|
65
|
-
$: openState = open;
|
|
66
|
-
$: {
|
|
67
|
-
const eventName = openState ? 'open' : 'close';
|
|
68
|
-
eventHandler.dispatch(eventName, openState);
|
|
69
|
-
}
|
|
70
|
-
$: attributes = { ...$$restProps };
|
|
71
|
-
$: delete attributes.class;
|
|
72
|
-
function clearListbox() {
|
|
73
|
-
listboxValue = multiple ? [] : '';
|
|
74
|
-
closeListBox();
|
|
75
|
-
eventHandler.dispatch('clear', true);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function removeTagSelected(itemSelectedId: any) {
|
|
79
|
-
listboxValue = listboxValue.filter(
|
|
80
|
-
(value: any) => value !== itemSelectedId,
|
|
81
|
-
);
|
|
82
|
-
eventHandler.dispatch('onchange', listboxValue);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function openLayerFn() {
|
|
86
|
-
openLayer = true;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function closeLayerFn() {
|
|
90
|
-
openLayer = null;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function closeListBox() {
|
|
94
|
-
openState = false;
|
|
95
|
-
|
|
96
|
-
if (multiple && !nosort) {
|
|
97
|
-
sortItems();
|
|
98
|
-
} else {
|
|
99
|
-
localItems = parsedItems;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function onChange() {
|
|
104
|
-
eventHandler.dispatch('onchange', listboxValue);
|
|
105
|
-
|
|
106
|
-
if (!multiple) {
|
|
107
|
-
closeListBox();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function getSelectedItems(val?: any) {
|
|
112
|
-
const value = val ? val : listboxValue;
|
|
113
|
-
|
|
114
|
-
const selectedItems = parsedItems.filter((item: ListboxItems) => {
|
|
115
|
-
return multiple
|
|
116
|
-
? value.includes(item[datavalueexpr])
|
|
117
|
-
: value === item[datavalueexpr];
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
return selectedItems;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function sortItems() {
|
|
124
|
-
sortedListItems = parsedItems;
|
|
125
|
-
const selectedItems = getSelectedItems();
|
|
126
|
-
|
|
127
|
-
sortedListItems.sort((a: any, b: any) => {
|
|
128
|
-
const hasItemA = selectedItems.includes(a);
|
|
129
|
-
const hasItemB = selectedItems.includes(b);
|
|
130
|
-
|
|
131
|
-
if (hasItemA === hasItemB) {
|
|
132
|
-
return a[datavalueexpr] - b[datavalueexpr];
|
|
133
|
-
} else if (hasItemA < hasItemB) {
|
|
134
|
-
return 1;
|
|
135
|
-
} else {
|
|
136
|
-
return -1;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
localItems = sortedListItems;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function onScrollEnd() {
|
|
144
|
-
eventHandler.dispatch('scrollend', true);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function onSelectAll(e: CustomEvent) {
|
|
148
|
-
eventHandler.dispatch('select-all', e.detail);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Watch Functions
|
|
152
|
-
async function watchListboxValue(value: any) {
|
|
153
|
-
await tick();
|
|
154
|
-
selectedItems = getSelectedItems(value);
|
|
155
|
-
const seletedLabels = selectedItems.map((item) => item[datatextexpr]);
|
|
156
|
-
|
|
157
|
-
buttonvalue = seletedLabels.join(', ');
|
|
158
|
-
|
|
159
|
-
if (multiple) {
|
|
160
|
-
tagValue = value;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
async function setTagWidth(tagValue: any) {
|
|
165
|
-
await tick();
|
|
166
|
-
|
|
167
|
-
tagWidth =
|
|
168
|
-
tag && tagValue && tagValue.length
|
|
169
|
-
? `${
|
|
170
|
-
component?.querySelector('.mc-tag-removable')?.clientWidth ?? 0 + 8
|
|
171
|
-
}px`
|
|
172
|
-
: '0px';
|
|
173
|
-
}
|
|
174
|
-
</script>
|
|
175
|
-
|
|
176
|
-
<div
|
|
177
|
-
class="mc-dropdown"
|
|
178
|
-
class:mc-dropdown--multi={multiple}
|
|
179
|
-
style="--dropdown-tag-width: {tagWidth}; --dropdown-width: {maxwidth};"
|
|
180
|
-
use:clickOutside
|
|
181
|
-
on:outclick={closeListBox}
|
|
182
|
-
{...attributes}
|
|
183
|
-
bind:this={component}
|
|
184
|
-
>
|
|
185
|
-
<div class="mc-dropdown__main">
|
|
186
|
-
<!-- TAG REMOVABLE -->
|
|
187
|
-
{#if multiple && listboxValue.length > 0 && !alltags}
|
|
188
|
-
<Tag
|
|
189
|
-
id={tagid ? tagid : `autocompleteTag-${uuid}`}
|
|
190
|
-
class="mc-dropdown__tag"
|
|
191
|
-
label={setTagLabel()}
|
|
192
|
-
size="s"
|
|
193
|
-
type="removable"
|
|
194
|
-
dark={false}
|
|
195
|
-
disabled={false}
|
|
196
|
-
href=""
|
|
197
|
-
name=""
|
|
198
|
-
selected={false}
|
|
199
|
-
value=""
|
|
200
|
-
bind:this={tag}
|
|
201
|
-
on:tag-removed={clearListbox}
|
|
202
|
-
/>
|
|
203
|
-
{/if}
|
|
204
|
-
|
|
205
|
-
<!-- TRIGGER BUTTON -->
|
|
206
|
-
<button
|
|
207
|
-
type="button"
|
|
208
|
-
class="mc-select mc-dropdown__trigger"
|
|
209
|
-
class:is-open={openState}
|
|
210
|
-
class:is-valid={isvalid}
|
|
211
|
-
class:is-invalid={isinvalid}
|
|
212
|
-
class:mc-select--s={size === 's'}
|
|
213
|
-
{disabled}
|
|
214
|
-
on:click={() => (openState = !openState)}
|
|
215
|
-
>
|
|
216
|
-
{buttonvalue ? buttonvalue : placeholder}
|
|
217
|
-
</button>
|
|
218
|
-
|
|
219
|
-
<div class="mc-dropdown__tools">
|
|
220
|
-
<!-- LOADER -->
|
|
221
|
-
{#if loading}
|
|
222
|
-
<Loader size="s" theme="primary" text="" class="mc-dropdown__loader" />
|
|
223
|
-
{/if}
|
|
224
|
-
|
|
225
|
-
<!-- CLEAR BUTTON -->
|
|
226
|
-
{#if !multiple && buttonvalue && clearfield}
|
|
227
|
-
<button
|
|
228
|
-
class="mc-dropdown__clear"
|
|
229
|
-
type="button"
|
|
230
|
-
on:click|stopPropagation={() => {
|
|
231
|
-
clearListbox();
|
|
232
|
-
}}
|
|
233
|
-
>
|
|
234
|
-
<ui-cross-circle-filled-24 />
|
|
235
|
-
</button>
|
|
236
|
-
{/if}
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
|
|
240
|
-
<!-- LISTBOX -->
|
|
241
|
-
{#if openState}
|
|
242
|
-
<Listbox
|
|
243
|
-
items={JSON.stringify(localItems)}
|
|
244
|
-
{name}
|
|
245
|
-
{multiple}
|
|
246
|
-
{isfiltered}
|
|
247
|
-
{emptysearchlabel}
|
|
248
|
-
{maxwidth}
|
|
249
|
-
{datatextexpr}
|
|
250
|
-
{datavalueexpr}
|
|
251
|
-
{selectall}
|
|
252
|
-
{labelselectall}
|
|
253
|
-
overlay={true}
|
|
254
|
-
width="100%"
|
|
255
|
-
bind:value={listboxValue}
|
|
256
|
-
on:change={onChange}
|
|
257
|
-
on:scrollend={onScrollEnd}
|
|
258
|
-
on:select-all={onSelectAll}
|
|
259
|
-
/>
|
|
260
|
-
{/if}
|
|
261
|
-
|
|
262
|
-
{#if multiple && alltags}
|
|
263
|
-
<div class="tags-selected">
|
|
264
|
-
{#each selectedItems as selectedItem, index}
|
|
265
|
-
{#if index < maxnumbertoshowtags}
|
|
266
|
-
<div class="tag-selected">
|
|
267
|
-
<m-tag
|
|
268
|
-
id={selectedItem.id}
|
|
269
|
-
label={selectedItem.label}
|
|
270
|
-
size="s"
|
|
271
|
-
type="removable"
|
|
272
|
-
on:tag-removed={() => removeTagSelected(selectedItem.id)}
|
|
273
|
-
/>
|
|
274
|
-
</div>
|
|
275
|
-
{/if}
|
|
276
|
-
{/each}
|
|
277
|
-
{#if listboxValue.length > maxnumbertoshowtags}
|
|
278
|
-
<div class="tag-selected">
|
|
279
|
-
<m-tag
|
|
280
|
-
id="id-tag"
|
|
281
|
-
label="({listboxValue.length}) {showmoretagslabel} "
|
|
282
|
-
size="s"
|
|
283
|
-
type="link"
|
|
284
|
-
on:tag-selected={() => openLayerFn()}
|
|
285
|
-
/>
|
|
286
|
-
</div>
|
|
287
|
-
{/if}
|
|
288
|
-
</div>
|
|
289
|
-
{/if}
|
|
290
|
-
|
|
291
|
-
<span class="mc-dropdown__tag" style="display:none;" />
|
|
292
|
-
<span class="mc-dropdown__loader" style="display:none;" />
|
|
293
|
-
<span class="mc-text-input mc-dropdown__trigger" style="display:none;" />
|
|
294
|
-
{#if multiple && alltags}
|
|
295
|
-
<div>
|
|
296
|
-
<m-layer
|
|
297
|
-
title={layertitle}
|
|
298
|
-
layertitletag="h3"
|
|
299
|
-
isopen={openLayer}
|
|
300
|
-
on:layer-closed={() => closeLayerFn()}
|
|
301
|
-
>
|
|
302
|
-
<small slot="content">
|
|
303
|
-
<div class="tags-selected">
|
|
304
|
-
{#each selectedItems as selectedItem}
|
|
305
|
-
<div class="tag-selected">
|
|
306
|
-
<m-tag
|
|
307
|
-
id={selectedItem.id}
|
|
308
|
-
label={selectedItem.label}
|
|
309
|
-
size="s"
|
|
310
|
-
type="removable"
|
|
311
|
-
on:tag-removed={() => removeTagSelected(selectedItem.id)}
|
|
312
|
-
/>
|
|
313
|
-
</div>
|
|
314
|
-
{/each}
|
|
315
|
-
</div>
|
|
316
|
-
</small>
|
|
317
|
-
</m-layer>
|
|
318
|
-
</div>
|
|
319
|
-
{/if}
|
|
320
|
-
</div>
|
|
321
|
-
|
|
322
|
-
<style lang="scss">
|
|
323
|
-
@import '@mozaic-ds/styles/settings-tools/all-settings';
|
|
324
|
-
@import '@mozaic-ds/styles/components/c.select';
|
|
325
|
-
@import '@mozaic-ds/styles/components/c.dropdown';
|
|
326
|
-
|
|
327
|
-
// Dropdown
|
|
328
|
-
// NOTE: These styles with the "!important" allow to overload the edge effects
|
|
329
|
-
// due to the scoping applied by Svelte on the CSS selectors
|
|
330
|
-
.mc-dropdown {
|
|
331
|
-
min-width: auto;
|
|
332
|
-
|
|
333
|
-
&__tag {
|
|
334
|
-
position: absolute !important; // due to the Svelte CSS scope
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
&--multi {
|
|
338
|
-
.mc-dropdown__trigger {
|
|
339
|
-
padding-left: calc($mu075 + var(--dropdown-tag-width)) !important;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// Selected Tags
|
|
345
|
-
.tags-selected {
|
|
346
|
-
display: flex;
|
|
347
|
-
flex-wrap: wrap;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
.tag-selected {
|
|
351
|
-
margin-top: 1em;
|
|
352
|
-
margin-left: 5px;
|
|
353
|
-
margin-right: 5px;
|
|
354
|
-
}
|
|
355
|
-
</style>
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
<svelte:options customElement='' />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
// @ts-nocheck
|
|
5
|
-
import { createEventDispatcher } from 'svelte';
|
|
6
|
-
// @ts-ignore Need to use internal Svelte function
|
|
7
|
-
import { get_current_component } from 'svelte/internal';
|
|
8
|
-
import { EventHandler } from '../../utilities/EventHandler';
|
|
9
|
-
import ResultFile from './fileuploader-result.nested.svelte';
|
|
10
|
-
|
|
11
|
-
export let id: string;
|
|
12
|
-
export let name: string;
|
|
13
|
-
export let label: string;
|
|
14
|
-
export let accept: string;
|
|
15
|
-
export let multiple = true;
|
|
16
|
-
export let allowedextensions: string;
|
|
17
|
-
export let maxsize: number;
|
|
18
|
-
export let displayfileslist = false;
|
|
19
|
-
export let disabled = false;
|
|
20
|
-
export let removelabel = 'Remove';
|
|
21
|
-
export let uploadedfiles: string;
|
|
22
|
-
export let errorlabels: string;
|
|
23
|
-
export let stateless: false;
|
|
24
|
-
export let keepPrevious: boolean;
|
|
25
|
-
|
|
26
|
-
let files: FileList;
|
|
27
|
-
let root: HTMLElement;
|
|
28
|
-
let eventHandler = new EventHandler(
|
|
29
|
-
get_current_component(),
|
|
30
|
-
createEventDispatcher(),
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
$: allowedExtensions = allowedextensions ? JSON.parse(allowedextensions) : [];
|
|
34
|
-
$: uploadedFiles = uploadedfiles ? JSON.parse(uploadedfiles) : [];
|
|
35
|
-
$: files;
|
|
36
|
-
$: maxSize = maxsize ? maxsize : undefined;
|
|
37
|
-
$: errorLabels = errorlabels ? JSON.parse(errorlabels) : [];
|
|
38
|
-
|
|
39
|
-
function checkFileSize(fileSize: number): boolean {
|
|
40
|
-
const fileSizeMB = fileSize / 1024 / 1024; // in MB
|
|
41
|
-
if (maxSize && fileSizeMB > maxSize) {
|
|
42
|
-
return false; // invalid
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return true; // valid
|
|
46
|
-
}
|
|
47
|
-
function checkFileExtension(fileName: string): boolean {
|
|
48
|
-
if (allowedExtensions && allowedExtensions.length > 0) {
|
|
49
|
-
const extension: string = fileName.slice(
|
|
50
|
-
((fileName.lastIndexOf('.') - 1) >>> 0) + 2,
|
|
51
|
-
);
|
|
52
|
-
if (allowedExtensions && !allowedExtensions.includes(String(extension))) {
|
|
53
|
-
return false; // invalid
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return true; // valid
|
|
58
|
-
}
|
|
59
|
-
function handleChange(e: Event): void {
|
|
60
|
-
const target = e.target as HTMLInputElement;
|
|
61
|
-
|
|
62
|
-
if(keepPrevious && files?.length > 0){
|
|
63
|
-
const previousSelection: File[] = [...files]
|
|
64
|
-
const newSelection: File[] = [...target.files as FileList]
|
|
65
|
-
const dataTransfer: DataTransfer = new DataTransfer()
|
|
66
|
-
previousSelection.forEach((item) => dataTransfer.items.add(item))
|
|
67
|
-
newSelection.forEach((item) => dataTransfer.items.add(item))
|
|
68
|
-
|
|
69
|
-
files = dataTransfer.files
|
|
70
|
-
|
|
71
|
-
} else {
|
|
72
|
-
files = target.files as FileList;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
displayfileslist = true;
|
|
76
|
-
const invalidFiles: Array<any> = [];
|
|
77
|
-
const fileList = [...files];
|
|
78
|
-
|
|
79
|
-
fileList.forEach((file, index) => {
|
|
80
|
-
const fileName = file.name;
|
|
81
|
-
const fileSize = file.size;
|
|
82
|
-
const validExtension = checkFileExtension(fileName);
|
|
83
|
-
const validSize = checkFileSize(fileSize);
|
|
84
|
-
let errorType = '';
|
|
85
|
-
|
|
86
|
-
if (!validExtension) {
|
|
87
|
-
errorType = 'invalid-extension';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (!validSize) {
|
|
91
|
-
errorType = 'invalid-size';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!validExtension || !validSize) {
|
|
95
|
-
invalidFiles.push({
|
|
96
|
-
index: index,
|
|
97
|
-
fileName: fileName,
|
|
98
|
-
fileSize: fileSize,
|
|
99
|
-
errorType: errorType,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
if (invalidFiles.length > 0) {
|
|
105
|
-
eventHandler.dispatch(
|
|
106
|
-
get_current_component(),
|
|
107
|
-
'invalid-files',
|
|
108
|
-
invalidFiles,
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
eventHandler.dispatch('change', files);
|
|
112
|
-
|
|
113
|
-
const fileuploader = root.querySelector(
|
|
114
|
-
'.mc-fileuploader__input',
|
|
115
|
-
) as HTMLInputElement;
|
|
116
|
-
if (stateless) {
|
|
117
|
-
fileuploader.value = '';
|
|
118
|
-
} else {
|
|
119
|
-
fileuploader.files = files
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function removeFromArray(fileList: FileList, value: File): FileList {
|
|
124
|
-
const array = Array.from(fileList);
|
|
125
|
-
const idx = array.indexOf(value);
|
|
126
|
-
if (idx !== -1) {
|
|
127
|
-
array.splice(idx, 1);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const dataTransfer: DataTransfer = new DataTransfer()
|
|
131
|
-
array.forEach((item) => dataTransfer.items.add(item))
|
|
132
|
-
|
|
133
|
-
return dataTransfer.files
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function deleteFile(e: CustomEvent): void {
|
|
137
|
-
files = removeFromArray(files, e.detail);
|
|
138
|
-
const fileuploader = root.querySelector(
|
|
139
|
-
'.mc-fileuploader__input',
|
|
140
|
-
) as HTMLInputElement;
|
|
141
|
-
fileuploader.files = files;
|
|
142
|
-
|
|
143
|
-
eventHandler.dispatch('change', files);
|
|
144
|
-
eventHandler.dispatch('file-removed', e.detail);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function deleteUploadedFile(e: CustomEvent): void {
|
|
148
|
-
const files = removeFromArray(uploadedFiles, e.detail);
|
|
149
|
-
uploadedFiles = files;
|
|
150
|
-
eventHandler.dispatch('uploaded-file-removed', e.detail);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function hasInvalidFiles(e: CustomEvent): void {
|
|
154
|
-
eventHandler.dispatch('invalid-files', e.detail);
|
|
155
|
-
}
|
|
156
|
-
</script>
|
|
157
|
-
|
|
158
|
-
<div class="mc-fileuploader" bind:this={root}>
|
|
159
|
-
<input
|
|
160
|
-
{id}
|
|
161
|
-
{name}
|
|
162
|
-
type="file"
|
|
163
|
-
class="mc-fileuploader__input"
|
|
164
|
-
{accept}
|
|
165
|
-
{multiple}
|
|
166
|
-
{disabled}
|
|
167
|
-
on:change={handleChange}
|
|
168
|
-
/>
|
|
169
|
-
<label for={id} class="mc-fileuploader__label">
|
|
170
|
-
<span class="mc-fileuploader__label--center">
|
|
171
|
-
{label}
|
|
172
|
-
</span>
|
|
173
|
-
</label>
|
|
174
|
-
{#if displayfileslist && files && files.length > 0}
|
|
175
|
-
<ResultFile
|
|
176
|
-
{files}
|
|
177
|
-
{allowedExtensions}
|
|
178
|
-
{disabled}
|
|
179
|
-
{maxSize}
|
|
180
|
-
{removelabel}
|
|
181
|
-
{errorLabels}
|
|
182
|
-
on:file-removed={deleteFile}
|
|
183
|
-
/>
|
|
184
|
-
{/if}
|
|
185
|
-
{#if uploadedFiles.length > 0}
|
|
186
|
-
<ResultFile
|
|
187
|
-
files={uploadedFiles}
|
|
188
|
-
{allowedExtensions}
|
|
189
|
-
{disabled}
|
|
190
|
-
{maxSize}
|
|
191
|
-
{removelabel}
|
|
192
|
-
{errorLabels}
|
|
193
|
-
on:file-removed={deleteUploadedFile}
|
|
194
|
-
/>
|
|
195
|
-
{/if}
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
<style lang="scss">
|
|
199
|
-
@import '@mozaic-ds/styles/settings-tools/all-settings';
|
|
200
|
-
@import '@mozaic-ds/styles/components/file-uploader';
|
|
201
|
-
</style>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<svelte:options customElement="" />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
// @ts-nocheck
|
|
5
|
-
import { createEventDispatcher } from 'svelte';
|
|
6
|
-
// @ts-ignore Need to use internal Svelte function
|
|
7
|
-
import { get_current_component } from 'svelte/internal';
|
|
8
|
-
import { EventHandler } from '../../utilities/EventHandler';
|
|
9
|
-
|
|
10
|
-
export let allowedExtensions: [];
|
|
11
|
-
export let maxSize: number;
|
|
12
|
-
export let disabled = false;
|
|
13
|
-
export let files: FileList;
|
|
14
|
-
export let removelabel = 'Remove';
|
|
15
|
-
export let errorLabels;
|
|
16
|
-
|
|
17
|
-
let eventHandler = new EventHandler(
|
|
18
|
-
get_current_component(),
|
|
19
|
-
createEventDispatcher(),
|
|
20
|
-
);
|
|
21
|
-
$: files = files ? handleChange(files) : [];
|
|
22
|
-
$: maxSize = maxSize ? maxSize : undefined;
|
|
23
|
-
|
|
24
|
-
function setClasses(file: File): string {
|
|
25
|
-
let classes = ['mc-fileuploader__file'];
|
|
26
|
-
|
|
27
|
-
if (checkFileStatus(file) && !file.errorType)
|
|
28
|
-
classes.push('mc-fileuploader__file--is-valid');
|
|
29
|
-
else classes.push('mc-fileuploader__file--is-invalid');
|
|
30
|
-
return classes.join(' ');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function checkFileExtension(fileName: string): boolean {
|
|
34
|
-
if (allowedExtensions && allowedExtensions.length > 0) {
|
|
35
|
-
const extension: string = fileName.slice(
|
|
36
|
-
((fileName.lastIndexOf('.') - 1) >>> 0) + 2,
|
|
37
|
-
);
|
|
38
|
-
if (allowedExtensions && !allowedExtensions.includes(String(extension))) {
|
|
39
|
-
return false; // invalid
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return true; // valid
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function checkFileSize(fileSize: number): boolean {
|
|
47
|
-
const fileSizeMB = fileSize / 1024 / 1024; // in MB
|
|
48
|
-
if (maxSize && fileSizeMB > maxSize) {
|
|
49
|
-
return false; // invalid
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return true; // valid
|
|
53
|
-
}
|
|
54
|
-
function handleChange(myFiles: FileList): void {
|
|
55
|
-
let files = [...myFiles];
|
|
56
|
-
files.forEach((file, index) => {
|
|
57
|
-
const validExtension = checkFileExtension(file.name);
|
|
58
|
-
const validSize = checkFileSize(file.size);
|
|
59
|
-
let errorType = '';
|
|
60
|
-
if (!validExtension) {
|
|
61
|
-
errorType = 'invalid-extension';
|
|
62
|
-
}
|
|
63
|
-
if (!validSize) {
|
|
64
|
-
errorType = 'invalid-size';
|
|
65
|
-
}
|
|
66
|
-
if (file.errorType) {
|
|
67
|
-
errorType = file.errorType;
|
|
68
|
-
}
|
|
69
|
-
if (!validExtension || !validSize || file.errorType) {
|
|
70
|
-
file.errorType = errorType;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
return files;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function checkFileStatus(file: File): boolean {
|
|
77
|
-
const validExtension = allowedExtensions
|
|
78
|
-
? checkFileExtension(file.name)
|
|
79
|
-
: true;
|
|
80
|
-
const validSize = checkFileSize(file.size);
|
|
81
|
-
|
|
82
|
-
if (!validExtension || !validSize) {
|
|
83
|
-
return false; // invalid
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return true; // valid
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function deleteFile(file) {
|
|
90
|
-
eventHandler.dispatch('file-removed', file);
|
|
91
|
-
}
|
|
92
|
-
</script>
|
|
93
|
-
|
|
94
|
-
<ul id="file_uploaded" class="mc-fileuploader__files">
|
|
95
|
-
{#each files as file, index}
|
|
96
|
-
<li id={`file-${index}`} class="{setClasses(file)} {$$props.class}">
|
|
97
|
-
<span class="mc-fileuploader__file-name">{file.name}</span>
|
|
98
|
-
<span class="mc-fileuploader__file-icon"> </span>
|
|
99
|
-
<button
|
|
100
|
-
type="button"
|
|
101
|
-
class="mc-fileuploader__delete"
|
|
102
|
-
aria-label={removelabel}
|
|
103
|
-
{disabled}
|
|
104
|
-
on:click={() => deleteFile(file)}
|
|
105
|
-
/>
|
|
106
|
-
{#if file.errorType}
|
|
107
|
-
<div class="mc-fileuploader__file-message">
|
|
108
|
-
{errorLabels[file.errorType]}
|
|
109
|
-
</div>
|
|
110
|
-
{/if}
|
|
111
|
-
</li>
|
|
112
|
-
{/each}
|
|
113
|
-
</ul>
|
|
114
|
-
|
|
115
|
-
<style lang="scss">
|
|
116
|
-
@import '@mozaic-ds/styles/settings-tools/all-settings';
|
|
117
|
-
@import '@mozaic-ds/styles/components/c.file-uploader';
|
|
118
|
-
</style>
|