@mozaic-ds/web-components 0.5.0 → 0.6.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/package.json +3 -3
- package/public/ClickOutside-63071e7a.js +1 -15
- package/public/ClickOutside-63071e7a.js.map +1 -1
- package/public/DataTableDefaultAction.nested-4da4dc44.js +1 -759
- package/public/DataTableDefaultAction.nested-4da4dc44.js.map +1 -1
- package/public/DataTableUtilities-60220c78.js +1 -370
- package/public/DataTableUtilities-60220c78.js.map +1 -1
- package/public/EventForward-8492ff62.js +1 -109
- package/public/EventForward-8492ff62.js.map +1 -1
- package/public/EventHandler-02058705.js +1 -15
- package/public/EventHandler-02058705.js.map +1 -1
- package/public/adeo/components/layer/Layer.js +1 -1
- package/public/adeo/components/layer/Layer.js.map +1 -1
- package/public/adeo/components/layer/Layer.svelte +2 -1
- package/public/adeo/components/phonenumber/PhoneNumber.js +1 -1
- package/public/adeo/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/adeo/components/phonenumber/PhoneNumber.svelte +72 -9
- package/public/adeo/components/quantityselector/QuantitySelector.js +1 -1
- package/public/adeo/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/adeo/components/quantityselector/QuantitySelector.svelte +6 -3
- package/public/array-5b770a93.js +1 -13
- package/public/array-5b770a93.js.map +1 -1
- package/public/axis-fbc0f7b5.js +1 -174
- package/public/axis-fbc0f7b5.js.map +1 -1
- package/public/band-d7a07d2c.js +1 -186
- package/public/band-d7a07d2c.js.map +1 -1
- package/public/bricoman/components/chart/Donut.js +1 -1
- package/public/bricoman/components/header/Header.js +1 -1
- package/public/bricoman/components/hero/Hero.js +1 -1
- package/public/bricoman/components/layer/Layer.js +1 -1
- package/public/bricoman/components/layer/Layer.js.map +1 -1
- package/public/bricoman/components/layer/Layer.svelte +2 -1
- package/public/bricoman/components/listbox/Listbox.js +1 -1
- package/public/bricoman/components/listbox/Listbox.nested.js +1 -1
- package/public/bricoman/components/phonenumber/PhoneNumber.js +1 -1
- package/public/bricoman/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/bricoman/components/phonenumber/PhoneNumber.svelte +72 -9
- package/public/bricoman/components/price/Price.js +1 -1
- package/public/bricoman/components/quantityselector/QuantitySelector.js +1 -1
- package/public/bricoman/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/bricoman/components/quantityselector/QuantitySelector.svelte +6 -3
- package/public/components/accordion/Accordion.js +1 -365
- package/public/components/accordion/Accordion.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.js +1 -1515
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/badge/Badge.js +1 -155
- package/public/components/badge/Badge.js.map +1 -1
- package/public/components/badge/Badge.nested.js +1 -101
- package/public/components/badge/Badge.nested.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.js +1 -372
- package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js +1 -319
- package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
- package/public/components/button/Button.js +1 -1138
- package/public/components/button/Button.js.map +1 -1
- package/public/components/card/Card.js +1 -369
- package/public/components/card/Card.js.map +1 -1
- package/public/components/chart/BarChart.js +1 -582
- package/public/components/chart/BarChart.js.map +1 -1
- package/public/components/chart/Donut.js +1 -1189
- package/public/components/chart/Donut.js.map +1 -1
- package/public/components/chart/GroupedBarChart.js +1 -750
- package/public/components/chart/GroupedBarChart.js.map +1 -1
- package/public/components/chart/LineChart.js +1 -1731
- package/public/components/chart/LineChart.js.map +1 -1
- package/public/components/chart/Radar.js +1 -729
- package/public/components/chart/Radar.js.map +1 -1
- package/public/components/chart/StackedBarChart.js +1 -745
- package/public/components/chart/StackedBarChart.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +1 -307
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkboxgroup/checkboxGroup.js +1 -404
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/datatable/DataTable.js +1 -3064
- package/public/components/datatable/DataTable.js.map +1 -1
- package/public/components/datatable/DataTableDefaultAction.nested.js +1 -4
- package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -164
- package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -380
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js +1 -424
- package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -263
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
- package/public/components/datatable/DataTableFooter.nested.js +1 -637
- package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
- package/public/components/dropdown/Dropdown.js +1 -1426
- package/public/components/dropdown/Dropdown.js.map +1 -1
- package/public/components/field/Field.js +1 -375
- package/public/components/field/Field.js.map +1 -1
- package/public/components/fileuploader/FileUploader.js +1 -555
- package/public/components/fileuploader/FileUploader.js.map +1 -1
- package/public/components/fileuploader/ResultFile.nested.js +1 -265
- package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/components/flag/Flag.js +1 -174
- package/public/components/flag/Flag.js.map +1 -1
- package/public/components/header/Header.js +1 -903
- package/public/components/header/Header.js.map +1 -1
- package/public/components/hero/Hero.js +1 -271
- package/public/components/hero/Hero.js.map +1 -1
- package/public/components/layer/Layer.js +1 -453
- package/public/components/layer/Layer.js.map +1 -1
- package/public/components/layer/Layer.svelte +2 -1
- package/public/components/link/Link.js +1 -380
- package/public/components/link/Link.js.map +1 -1
- package/public/components/listbox/Listbox.js +1 -595
- package/public/components/listbox/Listbox.js.map +1 -1
- package/public/components/listbox/Listbox.nested.js +1 -629
- package/public/components/listbox/Listbox.nested.js.map +1 -1
- package/public/components/loader/Loader.js +1 -246
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.nested.js +1 -176
- package/public/components/loader/Loader.nested.js.map +1 -1
- package/public/components/modal/Modal.js +1 -395
- package/public/components/modal/Modal.js.map +1 -1
- package/public/components/notification/Notification.js +1 -458
- package/public/components/notification/Notification.js.map +1 -1
- package/public/components/optionbutton/OptionButton.js +1 -316
- package/public/components/optionbutton/OptionButton.js.map +1 -1
- package/public/components/overlay/Overlay.js +1 -104
- package/public/components/overlay/Overlay.js.map +1 -1
- package/public/components/overlay/OverlayLoader.js +1 -151
- package/public/components/overlay/OverlayLoader.js.map +1 -1
- package/public/components/pagination/Pagination.js +1 -613
- package/public/components/pagination/Pagination.js.map +1 -1
- package/public/components/passwordinput/PasswordInput.js +1 -291
- package/public/components/passwordinput/PasswordInput.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.js +1 -6894
- package/public/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/components/price/Price.js +1 -768
- package/public/components/price/Price.js.map +1 -1
- package/public/components/progressbar/ProgressBar.js +1 -278
- package/public/components/progressbar/ProgressBar.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.js +1 -333
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.svelte +6 -3
- package/public/components/radio/Radio.js +1 -273
- package/public/components/radio/Radio.js.map +1 -1
- package/public/components/radiogroup/RadioGroup.js +1 -414
- package/public/components/radiogroup/RadioGroup.js.map +1 -1
- package/public/components/ratings/StarsInput.js +1 -292
- package/public/components/ratings/StarsInput.js.map +1 -1
- package/public/components/ratings/StarsResult.js +1 -246
- package/public/components/ratings/StarsResult.js.map +1 -1
- package/public/components/select/Select.js +1 -451
- package/public/components/select/Select.js.map +1 -1
- package/public/components/sidebar/Sidebar.js +1 -784
- package/public/components/sidebar/Sidebar.js.map +1 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js +1 -594
- package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-feature.nested.js +1 -402
- package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-section.nested.js +1 -394
- package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js +1 -200
- package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-separator.nested.js +1 -49
- package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js +1 -312
- package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-user.nested.js +1 -733
- package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/components/stepper/Stepper.js +1 -371
- package/public/components/stepper/Stepper.js.map +1 -1
- package/public/components/tabs/Tabs.js +1 -615
- package/public/components/tabs/Tabs.js.map +1 -1
- package/public/components/tabs/Tabs.nested.js +1 -472
- package/public/components/tabs/Tabs.nested.js.map +1 -1
- package/public/components/tag/Tag.js +1 -665
- package/public/components/tag/Tag.js.map +1 -1
- package/public/components/tag/Tag.nested.js +1 -554
- package/public/components/tag/Tag.nested.js.map +1 -1
- package/public/components/taglist/TagList.js +1 -475
- package/public/components/taglist/TagList.js.map +1 -1
- package/public/components/textarea/Textarea.js +1 -303
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textinput/Textinput.js +1 -497
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.nested.js +1 -320
- package/public/components/textinput/Textinput.nested.js.map +1 -1
- package/public/components/toggle/Toggle.js +1 -278
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/components/tooltip/Tooltip.js +1 -173
- package/public/components/tooltip/Tooltip.js.map +1 -1
- package/public/index-c33b3772.js +1 -873
- package/public/index-c33b3772.js.map +1 -1
- package/public/linear-f46d7e9e.js +1 -700
- package/public/linear-f46d7e9e.js.map +1 -1
- package/public/path-1b5da959.js +1 -186
- package/public/path-1b5da959.js.map +1 -1
- package/public/sidebar-service-275bf9ef.js +1 -129
- package/public/sidebar-service-275bf9ef.js.map +1 -1
- package/public/symbol-b05a6e2b.js +1 -169
- package/public/symbol-b05a6e2b.js.map +1 -1
- package/public/transform-15d69d5d.js +1 -2743
- package/public/transform-15d69d5d.js.map +1 -1
- package/public/utilities/stories/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.nested.js","sources":["../../../src/components/tag/Tag.nested.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import type { TagSize, TagType } from './tag.types';\n import { EventHandler } from '../../utilities/EventHandler';\n\n export let label: string;\n export let size: TagSize = 'm';\n export let dark: boolean;\n export let type: TagType = 'text';\n export let disabled: boolean;\n export let id: string;\n export let value: string | undefined = undefined;\n export let href: string | undefined = undefined;\n export let name: string | undefined = undefined;\n export let selected = false;\n\n $: isSelected = selected ? true : false;\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n let eventHandler = new EventHandler();\n\n function getClasses(type: TagType) {\n const classes = [`mc-tag-${type}`];\n\n if (size) {\n classes.push(`mc-tag-${type}--${size}`);\n }\n\n if (dark) {\n classes.push(`mc-tag-${type}--dark`);\n }\n\n return classes.join(' ');\n }\n\n function getSubClasses(type: TagType, element: string) {\n return `mc-tag-${type}__${element}`;\n }\n\n function onSelect(): void {\n isSelected = !isSelected;\n console.log(isSelected);\n eventHandler.dispatch('tag-selected', isSelected);\n }\n\n function onRemoved(): void {\n eventHandler.dispatch('tag-removed', { id, label, value });\n }\n</script>\n\n{#if type === 'text'}\n <span class=\"{getClasses(type)} {userClass}\" {...attributes}>\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n </span>\n{/if}\n{#if type === 'link'}\n <a\n {href}\n class=\"{getClasses(type)} {userClass}\"\n {...attributes}\n on:click|stopPropagation={onSelect}\n >\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n </a>\n{/if}\n{#if type === 'selectable'}\n <span\n class=\"{getClasses(type)} {userClass}\"\n on:click|stopPropagation={onSelect}\n {...attributes}\n >\n <input\n class={getSubClasses(type, 'input')}\n type=\"checkbox\"\n {name}\n checked={isSelected}\n {id}\n {disabled}\n />\n <label class={getSubClasses(type, 'pill')} for={id}>\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n </label>\n </span>\n{/if}\n{#if type === 'removable'}\n <span class=\"{getClasses(type)} {userClass}\" {...attributes}>\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n <button\n class={getSubClasses(type, 'remove')}\n on:click|stopPropagation={onRemoved}\n >\n <span class={getSubClasses(type, 'remove-text')}> {label} </span>\n </button>\n </span>\n{/if}\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.tag';\n</style>\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Tag.nested.js","sources":["../../../src/components/tag/Tag.nested.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import type { TagSize, TagType } from './tag.types';\n import { EventHandler } from '../../utilities/EventHandler';\n\n export let label: string;\n export let size: TagSize = 'm';\n export let dark: boolean;\n export let type: TagType = 'text';\n export let disabled: boolean;\n export let id: string;\n export let value: string | undefined = undefined;\n export let href: string | undefined = undefined;\n export let name: string | undefined = undefined;\n export let selected = false;\n\n $: isSelected = selected ? true : false;\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n let eventHandler = new EventHandler();\n\n function getClasses(type: TagType) {\n const classes = [`mc-tag-${type}`];\n\n if (size) {\n classes.push(`mc-tag-${type}--${size}`);\n }\n\n if (dark) {\n classes.push(`mc-tag-${type}--dark`);\n }\n\n return classes.join(' ');\n }\n\n function getSubClasses(type: TagType, element: string) {\n return `mc-tag-${type}__${element}`;\n }\n\n function onSelect(): void {\n isSelected = !isSelected;\n console.log(isSelected);\n eventHandler.dispatch('tag-selected', isSelected);\n }\n\n function onRemoved(): void {\n eventHandler.dispatch('tag-removed', { id, label, value });\n }\n</script>\n\n{#if type === 'text'}\n <span class=\"{getClasses(type)} {userClass}\" {...attributes}>\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n </span>\n{/if}\n{#if type === 'link'}\n <a\n {href}\n class=\"{getClasses(type)} {userClass}\"\n {...attributes}\n on:click|stopPropagation={onSelect}\n >\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n </a>\n{/if}\n{#if type === 'selectable'}\n <span\n class=\"{getClasses(type)} {userClass}\"\n on:click|stopPropagation={onSelect}\n {...attributes}\n >\n <input\n class={getSubClasses(type, 'input')}\n type=\"checkbox\"\n {name}\n checked={isSelected}\n {id}\n {disabled}\n />\n <label class={getSubClasses(type, 'pill')} for={id}>\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n </label>\n </span>\n{/if}\n{#if type === 'removable'}\n <span class=\"{getClasses(type)} {userClass}\" {...attributes}>\n <span class={getSubClasses(type, 'label')}>\n {label}\n </span>\n <button\n class={getSubClasses(type, 'remove')}\n on:click|stopPropagation={onRemoved}\n >\n <span class={getSubClasses(type, 'remove-text')}> {label} </span>\n </button>\n </span>\n{/if}\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.tag';\n</style>\n"],"names":["ctx","getSubClasses","insert","target","span1","anchor","append","span0","class","span1_class_value","a","span","a_class_value","input","label_1","span2","button","span2_class_value","if_block0","create_if_block_3","if_block1","create_if_block_2","if_block2","create_if_block_1","if_block3","create_if_block","type","element","label","$$props","size","dark","disabled","id","value","href","name","selected","eventHandler","EventHandler","isSelected","$$invalidate","userClass","attributes","Object","assign","$$restProps","classes","push","join","console","log","dispatch"],"mappings":"+z1CAsDgBA,EAAU,GAACA,EAAI,IAAA,IAAKA,EAAS,IAAOA,EAAU,wFAEvDA,EAAK,oBADKC,EAAcD,EAA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|
|
|
1
|
-
import
|
|
2
|
-
import { E as EventHandler } from '../../EventHandler-02058705.js';
|
|
3
|
-
import Tag_nested from '../tag/Tag.nested.js';
|
|
4
|
-
|
|
5
|
-
/* src/components/taglist/TagList.svelte generated by Svelte v3.58.0 */
|
|
6
|
-
|
|
7
|
-
function get_each_context(ctx, list, i) {
|
|
8
|
-
const child_ctx = ctx.slice();
|
|
9
|
-
child_ctx[14] = list[i];
|
|
10
|
-
child_ctx[16] = i;
|
|
11
|
-
return child_ctx;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// (29:4) {#if index < max || showAll}
|
|
15
|
-
function create_if_block_1(ctx) {
|
|
16
|
-
let div;
|
|
17
|
-
let tag;
|
|
18
|
-
let current;
|
|
19
|
-
|
|
20
|
-
function tag_removed_handler() {
|
|
21
|
-
return /*tag_removed_handler*/ ctx[11](/*item*/ ctx[14]);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
tag = new Tag_nested({
|
|
25
|
-
props: {
|
|
26
|
-
id: /*item*/ ctx[14].id,
|
|
27
|
-
label: /*item*/ ctx[14].label,
|
|
28
|
-
size: 's',
|
|
29
|
-
type: "removable",
|
|
30
|
-
dark: false,
|
|
31
|
-
disabled: false,
|
|
32
|
-
selected: false
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
tag.$on("tag-removed", tag_removed_handler);
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
c() {
|
|
40
|
-
div = element("div");
|
|
41
|
-
create_component(tag.$$.fragment);
|
|
42
|
-
attr(div, "class", "tag-selected");
|
|
43
|
-
},
|
|
44
|
-
m(target, anchor) {
|
|
45
|
-
insert(target, div, anchor);
|
|
46
|
-
mount_component(tag, div, null);
|
|
47
|
-
current = true;
|
|
48
|
-
},
|
|
49
|
-
p(new_ctx, dirty) {
|
|
50
|
-
ctx = new_ctx;
|
|
51
|
-
const tag_changes = {};
|
|
52
|
-
if (dirty & /*parsedItems*/ 32) tag_changes.id = /*item*/ ctx[14].id;
|
|
53
|
-
if (dirty & /*parsedItems*/ 32) tag_changes.label = /*item*/ ctx[14].label;
|
|
54
|
-
tag.$set(tag_changes);
|
|
55
|
-
},
|
|
56
|
-
i(local) {
|
|
57
|
-
if (current) return;
|
|
58
|
-
transition_in(tag.$$.fragment, local);
|
|
59
|
-
current = true;
|
|
60
|
-
},
|
|
61
|
-
o(local) {
|
|
62
|
-
transition_out(tag.$$.fragment, local);
|
|
63
|
-
current = false;
|
|
64
|
-
},
|
|
65
|
-
d(detaching) {
|
|
66
|
-
if (detaching) detach(div);
|
|
67
|
-
destroy_component(tag);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// (28:2) {#each parsedItems as item, index}
|
|
73
|
-
function create_each_block(ctx) {
|
|
74
|
-
let if_block_anchor;
|
|
75
|
-
let current;
|
|
76
|
-
let if_block = (/*index*/ ctx[16] < /*max*/ ctx[0] || /*showAll*/ ctx[4]) && create_if_block_1(ctx);
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
c() {
|
|
80
|
-
if (if_block) if_block.c();
|
|
81
|
-
if_block_anchor = empty();
|
|
82
|
-
},
|
|
83
|
-
m(target, anchor) {
|
|
84
|
-
if (if_block) if_block.m(target, anchor);
|
|
85
|
-
insert(target, if_block_anchor, anchor);
|
|
86
|
-
current = true;
|
|
87
|
-
},
|
|
88
|
-
p(ctx, dirty) {
|
|
89
|
-
if (/*index*/ ctx[16] < /*max*/ ctx[0] || /*showAll*/ ctx[4]) {
|
|
90
|
-
if (if_block) {
|
|
91
|
-
if_block.p(ctx, dirty);
|
|
92
|
-
|
|
93
|
-
if (dirty & /*max, showAll*/ 17) {
|
|
94
|
-
transition_in(if_block, 1);
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
if_block = create_if_block_1(ctx);
|
|
98
|
-
if_block.c();
|
|
99
|
-
transition_in(if_block, 1);
|
|
100
|
-
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
101
|
-
}
|
|
102
|
-
} else if (if_block) {
|
|
103
|
-
group_outros();
|
|
104
|
-
|
|
105
|
-
transition_out(if_block, 1, 1, () => {
|
|
106
|
-
if_block = null;
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
check_outros();
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
i(local) {
|
|
113
|
-
if (current) return;
|
|
114
|
-
transition_in(if_block);
|
|
115
|
-
current = true;
|
|
116
|
-
},
|
|
117
|
-
o(local) {
|
|
118
|
-
transition_out(if_block);
|
|
119
|
-
current = false;
|
|
120
|
-
},
|
|
121
|
-
d(detaching) {
|
|
122
|
-
if (if_block) if_block.d(detaching);
|
|
123
|
-
if (detaching) detach(if_block_anchor);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// (44:2) {#if max && parsedItems.length > max}
|
|
129
|
-
function create_if_block(ctx) {
|
|
130
|
-
let div;
|
|
131
|
-
let tag;
|
|
132
|
-
let current;
|
|
133
|
-
|
|
134
|
-
tag = new Tag_nested({
|
|
135
|
-
props: {
|
|
136
|
-
id: "id-tag",
|
|
137
|
-
label: /*showAll*/ ctx[4] && !/*stateless*/ ctx[3]
|
|
138
|
-
? /*reducelabel*/ ctx[2]
|
|
139
|
-
: /*showlabel*/ ctx[1],
|
|
140
|
-
size: "s",
|
|
141
|
-
type: "link",
|
|
142
|
-
class: "mc-taglist__showhide",
|
|
143
|
-
dark: false,
|
|
144
|
-
disabled: false,
|
|
145
|
-
name: ""
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
tag.$on("tag-selected", /*onExtend*/ ctx[7]);
|
|
150
|
-
|
|
151
|
-
return {
|
|
152
|
-
c() {
|
|
153
|
-
div = element("div");
|
|
154
|
-
create_component(tag.$$.fragment);
|
|
155
|
-
attr(div, "class", "tag-selected");
|
|
156
|
-
},
|
|
157
|
-
m(target, anchor) {
|
|
158
|
-
insert(target, div, anchor);
|
|
159
|
-
mount_component(tag, div, null);
|
|
160
|
-
current = true;
|
|
161
|
-
},
|
|
162
|
-
p(ctx, dirty) {
|
|
163
|
-
const tag_changes = {};
|
|
164
|
-
|
|
165
|
-
if (dirty & /*showAll, stateless, reducelabel, showlabel*/ 30) tag_changes.label = /*showAll*/ ctx[4] && !/*stateless*/ ctx[3]
|
|
166
|
-
? /*reducelabel*/ ctx[2]
|
|
167
|
-
: /*showlabel*/ ctx[1];
|
|
168
|
-
|
|
169
|
-
tag.$set(tag_changes);
|
|
170
|
-
},
|
|
171
|
-
i(local) {
|
|
172
|
-
if (current) return;
|
|
173
|
-
transition_in(tag.$$.fragment, local);
|
|
174
|
-
current = true;
|
|
175
|
-
},
|
|
176
|
-
o(local) {
|
|
177
|
-
transition_out(tag.$$.fragment, local);
|
|
178
|
-
current = false;
|
|
179
|
-
},
|
|
180
|
-
d(detaching) {
|
|
181
|
-
if (detaching) detach(div);
|
|
182
|
-
destroy_component(tag);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function create_fragment(ctx) {
|
|
188
|
-
let div;
|
|
189
|
-
let t;
|
|
190
|
-
let current;
|
|
191
|
-
let each_value = /*parsedItems*/ ctx[5];
|
|
192
|
-
let each_blocks = [];
|
|
193
|
-
|
|
194
|
-
for (let i = 0; i < each_value.length; i += 1) {
|
|
195
|
-
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const out = i => transition_out(each_blocks[i], 1, 1, () => {
|
|
199
|
-
each_blocks[i] = null;
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
let if_block = /*max*/ ctx[0] && /*parsedItems*/ ctx[5].length > /*max*/ ctx[0] && create_if_block(ctx);
|
|
203
|
-
|
|
204
|
-
return {
|
|
205
|
-
c() {
|
|
206
|
-
div = element("div");
|
|
207
|
-
|
|
208
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
209
|
-
each_blocks[i].c();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
t = space();
|
|
213
|
-
if (if_block) if_block.c();
|
|
214
|
-
this.c = noop;
|
|
215
|
-
attr(div, "class", "mc-taglist");
|
|
216
|
-
},
|
|
217
|
-
m(target, anchor) {
|
|
218
|
-
insert(target, div, anchor);
|
|
219
|
-
|
|
220
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
221
|
-
if (each_blocks[i]) {
|
|
222
|
-
each_blocks[i].m(div, null);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
append(div, t);
|
|
227
|
-
if (if_block) if_block.m(div, null);
|
|
228
|
-
current = true;
|
|
229
|
-
},
|
|
230
|
-
p(ctx, [dirty]) {
|
|
231
|
-
if (dirty & /*parsedItems, onRemoved, max, showAll*/ 113) {
|
|
232
|
-
each_value = /*parsedItems*/ ctx[5];
|
|
233
|
-
let i;
|
|
234
|
-
|
|
235
|
-
for (i = 0; i < each_value.length; i += 1) {
|
|
236
|
-
const child_ctx = get_each_context(ctx, each_value, i);
|
|
237
|
-
|
|
238
|
-
if (each_blocks[i]) {
|
|
239
|
-
each_blocks[i].p(child_ctx, dirty);
|
|
240
|
-
transition_in(each_blocks[i], 1);
|
|
241
|
-
} else {
|
|
242
|
-
each_blocks[i] = create_each_block(child_ctx);
|
|
243
|
-
each_blocks[i].c();
|
|
244
|
-
transition_in(each_blocks[i], 1);
|
|
245
|
-
each_blocks[i].m(div, t);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
group_outros();
|
|
250
|
-
|
|
251
|
-
for (i = each_value.length; i < each_blocks.length; i += 1) {
|
|
252
|
-
out(i);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
check_outros();
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (/*max*/ ctx[0] && /*parsedItems*/ ctx[5].length > /*max*/ ctx[0]) {
|
|
259
|
-
if (if_block) {
|
|
260
|
-
if_block.p(ctx, dirty);
|
|
261
|
-
|
|
262
|
-
if (dirty & /*max, parsedItems*/ 33) {
|
|
263
|
-
transition_in(if_block, 1);
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
if_block = create_if_block(ctx);
|
|
267
|
-
if_block.c();
|
|
268
|
-
transition_in(if_block, 1);
|
|
269
|
-
if_block.m(div, null);
|
|
270
|
-
}
|
|
271
|
-
} else if (if_block) {
|
|
272
|
-
group_outros();
|
|
273
|
-
|
|
274
|
-
transition_out(if_block, 1, 1, () => {
|
|
275
|
-
if_block = null;
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
check_outros();
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
i(local) {
|
|
282
|
-
if (current) return;
|
|
283
|
-
|
|
284
|
-
for (let i = 0; i < each_value.length; i += 1) {
|
|
285
|
-
transition_in(each_blocks[i]);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
transition_in(if_block);
|
|
289
|
-
current = true;
|
|
290
|
-
},
|
|
291
|
-
o(local) {
|
|
292
|
-
each_blocks = each_blocks.filter(Boolean);
|
|
293
|
-
|
|
294
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
295
|
-
transition_out(each_blocks[i]);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
transition_out(if_block);
|
|
299
|
-
current = false;
|
|
300
|
-
},
|
|
301
|
-
d(detaching) {
|
|
302
|
-
if (detaching) detach(div);
|
|
303
|
-
destroy_each(each_blocks, detaching);
|
|
304
|
-
if (if_block) if_block.d();
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
function instance($$self, $$props, $$invalidate) {
|
|
310
|
-
let parsedItems;
|
|
311
|
-
let showAll;
|
|
312
|
-
let attributes;
|
|
313
|
-
const omit_props_names = ["items","max","showlabel","reducelabel","showall","stateless"];
|
|
314
|
-
let $$restProps = compute_rest_props($$props, omit_props_names);
|
|
315
|
-
let { items } = $$props;
|
|
316
|
-
let { max = 10 } = $$props;
|
|
317
|
-
let { showlabel = 'Show all' } = $$props;
|
|
318
|
-
let { reducelabel = 'Reduce' } = $$props;
|
|
319
|
-
let { showall = false } = $$props;
|
|
320
|
-
let { stateless = false } = $$props;
|
|
321
|
-
let eventHandler = new EventHandler();
|
|
322
|
-
|
|
323
|
-
function onRemoved(item) {
|
|
324
|
-
eventHandler.dispatch('tag-removed', item);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
function onExtend() {
|
|
328
|
-
if (stateless) eventHandler.dispatch(showAll ? 'reduce' : 'show-all', parsedItems); else $$invalidate(4, showAll = !showAll);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const tag_removed_handler = item => onRemoved(item);
|
|
332
|
-
|
|
333
|
-
$$self.$$set = $$new_props => {
|
|
334
|
-
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
|
|
335
|
-
$$invalidate(13, $$restProps = compute_rest_props($$props, omit_props_names));
|
|
336
|
-
if ('items' in $$new_props) $$invalidate(8, items = $$new_props.items);
|
|
337
|
-
if ('max' in $$new_props) $$invalidate(0, max = $$new_props.max);
|
|
338
|
-
if ('showlabel' in $$new_props) $$invalidate(1, showlabel = $$new_props.showlabel);
|
|
339
|
-
if ('reducelabel' in $$new_props) $$invalidate(2, reducelabel = $$new_props.reducelabel);
|
|
340
|
-
if ('showall' in $$new_props) $$invalidate(9, showall = $$new_props.showall);
|
|
341
|
-
if ('stateless' in $$new_props) $$invalidate(3, stateless = $$new_props.stateless);
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
$$self.$$.update = () => {
|
|
345
|
-
if ($$self.$$.dirty & /*items*/ 256) {
|
|
346
|
-
$$invalidate(5, parsedItems = items ? JSON.parse(items) : []);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
if ($$self.$$.dirty & /*showall*/ 512) {
|
|
350
|
-
$$invalidate(4, showAll = showall ? true : false);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
$$invalidate(10, attributes = Object.assign({}, $$restProps));
|
|
354
|
-
|
|
355
|
-
if ($$self.$$.dirty & /*attributes*/ 1024) {
|
|
356
|
-
delete attributes.class;
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
return [
|
|
361
|
-
max,
|
|
362
|
-
showlabel,
|
|
363
|
-
reducelabel,
|
|
364
|
-
stateless,
|
|
365
|
-
showAll,
|
|
366
|
-
parsedItems,
|
|
367
|
-
onRemoved,
|
|
368
|
-
onExtend,
|
|
369
|
-
items,
|
|
370
|
-
showall,
|
|
371
|
-
attributes,
|
|
372
|
-
tag_removed_handler
|
|
373
|
-
];
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
class TagList extends SvelteElement {
|
|
377
|
-
constructor(options) {
|
|
378
|
-
super();
|
|
379
|
-
const style = document.createElement('style');
|
|
380
|
-
style.textContent = `.mc-taglist{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:1rem}`;
|
|
381
|
-
this.shadowRoot.appendChild(style);
|
|
382
|
-
|
|
383
|
-
init(
|
|
384
|
-
this,
|
|
385
|
-
{
|
|
386
|
-
target: this.shadowRoot,
|
|
387
|
-
props: attribute_to_object(this.attributes),
|
|
388
|
-
customElement: true
|
|
389
|
-
},
|
|
390
|
-
instance,
|
|
391
|
-
create_fragment,
|
|
392
|
-
safe_not_equal,
|
|
393
|
-
{
|
|
394
|
-
items: 8,
|
|
395
|
-
max: 0,
|
|
396
|
-
showlabel: 1,
|
|
397
|
-
reducelabel: 2,
|
|
398
|
-
showall: 9,
|
|
399
|
-
stateless: 3
|
|
400
|
-
},
|
|
401
|
-
null
|
|
402
|
-
);
|
|
403
|
-
|
|
404
|
-
if (options) {
|
|
405
|
-
if (options.target) {
|
|
406
|
-
insert(options.target, this, options.anchor);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (options.props) {
|
|
410
|
-
this.$set(options.props);
|
|
411
|
-
flush();
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
static get observedAttributes() {
|
|
417
|
-
return ["items", "max", "showlabel", "reducelabel", "showall", "stateless"];
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
get items() {
|
|
421
|
-
return this.$$.ctx[8];
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
set items(items) {
|
|
425
|
-
this.$$set({ items });
|
|
426
|
-
flush();
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
get max() {
|
|
430
|
-
return this.$$.ctx[0];
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
set max(max) {
|
|
434
|
-
this.$$set({ max });
|
|
435
|
-
flush();
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
get showlabel() {
|
|
439
|
-
return this.$$.ctx[1];
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
set showlabel(showlabel) {
|
|
443
|
-
this.$$set({ showlabel });
|
|
444
|
-
flush();
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
get reducelabel() {
|
|
448
|
-
return this.$$.ctx[2];
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
set reducelabel(reducelabel) {
|
|
452
|
-
this.$$set({ reducelabel });
|
|
453
|
-
flush();
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
get showall() {
|
|
457
|
-
return this.$$.ctx[9];
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
set showall(showall) {
|
|
461
|
-
this.$$set({ showall });
|
|
462
|
-
flush();
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
get stateless() {
|
|
466
|
-
return this.$$.ctx[3];
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
set stateless(stateless) {
|
|
470
|
-
this.$$set({ stateless });
|
|
471
|
-
flush();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
export { TagList as default };
|
|
1
|
+
import{S as e,i as t,a as s,b as l,f as a,s as n,e as r,d as i,n as o,g as c,j as d,C as h,E as m,D as u,o as $,J as g,p,c as b,q as f,K as w,M as x,x as y,A as v,G as j}from"../../index-c33b3772.js";import{E as k}from"../../EventHandler-02058705.js";import E from"../tag/Tag.nested.js";function C(e,t,s){const l=e.slice();return l[14]=t[s],l[16]=s,l}function R(e){let t,s,a;return s=new E({props:{id:e[14].id,label:e[14].label,size:"s",type:"removable",dark:!1,disabled:!1,selected:!1}}),s.$on("tag-removed",(function(){return e[11](e[14])})),{c(){t=r("div"),y(s.$$.fragment),c(t,"class","tag-selected")},m(e,n){l(e,t,n),v(s,t,null),a=!0},p(t,l){e=t;const a={};32&l&&(a.id=e[14].id),32&l&&(a.label=e[14].label),s.$set(a)},i(e){a||(h(s.$$.fragment,e),a=!0)},o(e){u(s.$$.fragment,e),a=!1},d(e){e&&$(t),j(s)}}}function S(e){let t,s,a=(e[16]<e[0]||e[4])&&R(e);return{c(){a&&a.c(),t=w()},m(e,n){a&&a.m(e,n),l(e,t,n),s=!0},p(e,s){e[16]<e[0]||e[4]?a?(a.p(e,s),17&s&&h(a,1)):(a=R(e),a.c(),h(a,1),a.m(t.parentNode,t)):a&&(x(),u(a,1,1,(()=>{a=null})),m())},i(e){s||(h(a),s=!0)},o(e){u(a),s=!1},d(e){a&&a.d(e),e&&$(t)}}}function z(e){let t,s,a;return s=new E({props:{id:"id-tag",label:e[4]&&!e[3]?e[2]:e[1],size:"s",type:"link",class:"mc-taglist__showhide",dark:!1,disabled:!1,name:""}}),s.$on("tag-selected",e[7]),{c(){t=r("div"),y(s.$$.fragment),c(t,"class","tag-selected")},m(e,n){l(e,t,n),v(s,t,null),a=!0},p(e,t){const l={};30&t&&(l.label=e[4]&&!e[3]?e[2]:e[1]),s.$set(l)},i(e){a||(h(s.$$.fragment,e),a=!0)},o(e){u(s.$$.fragment,e),a=!1},d(e){e&&$(t),j(s)}}}function A(e){let t,s,a,n=e[5],p=[];for(let t=0;t<n.length;t+=1)p[t]=S(C(e,n,t));const b=e=>u(p[e],1,1,(()=>{p[e]=null}));let f=e[0]&&e[5].length>e[0]&&z(e);return{c(){t=r("div");for(let e=0;e<p.length;e+=1)p[e].c();s=i(),f&&f.c(),this.c=o,c(t,"class","mc-taglist")},m(e,n){l(e,t,n);for(let e=0;e<p.length;e+=1)p[e]&&p[e].m(t,null);d(t,s),f&&f.m(t,null),a=!0},p(e,[l]){if(113&l){let a;for(n=e[5],a=0;a<n.length;a+=1){const r=C(e,n,a);p[a]?(p[a].p(r,l),h(p[a],1)):(p[a]=S(r),p[a].c(),h(p[a],1),p[a].m(t,s))}for(x(),a=n.length;a<p.length;a+=1)b(a);m()}e[0]&&e[5].length>e[0]?f?(f.p(e,l),33&l&&h(f,1)):(f=z(e),f.c(),h(f,1),f.m(t,null)):f&&(x(),u(f,1,1,(()=>{f=null})),m())},i(e){if(!a){for(let e=0;e<n.length;e+=1)h(p[e]);h(f),a=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)u(p[e]);u(f),a=!1},d(e){e&&$(t),g(p,e),f&&f.d()}}}function J(e,t,s){let l,a,n;const r=["items","max","showlabel","reducelabel","showall","stateless"];let i=p(t,r),{items:o}=t,{max:c=10}=t,{showlabel:d="Show all"}=t,{reducelabel:h="Reduce"}=t,{showall:m=!1}=t,{stateless:u=!1}=t,$=new k;function g(e){$.dispatch("tag-removed",e)}return e.$$set=e=>{t=b(b({},t),f(e)),s(13,i=p(t,r)),"items"in e&&s(8,o=e.items),"max"in e&&s(0,c=e.max),"showlabel"in e&&s(1,d=e.showlabel),"reducelabel"in e&&s(2,h=e.reducelabel),"showall"in e&&s(9,m=e.showall),"stateless"in e&&s(3,u=e.stateless)},e.$$.update=()=>{256&e.$$.dirty&&s(5,l=o?JSON.parse(o):[]),512&e.$$.dirty&&s(4,a=!!m),s(10,n=Object.assign({},i)),1024&e.$$.dirty&&delete n.class},[c,d,h,u,a,l,g,function(){u?$.dispatch(a?"reduce":"show-all",l):s(4,a=!a)},o,m,n,e=>g(e)]}class N extends e{constructor(e){super();const r=document.createElement("style");r.textContent=".mc-taglist{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:1rem}",this.shadowRoot.appendChild(r),t(this,{target:this.shadowRoot,props:s(this.attributes),customElement:!0},J,A,n,{items:8,max:0,showlabel:1,reducelabel:2,showall:9,stateless:3},null),e&&(e.target&&l(e.target,this,e.anchor),e.props&&(this.$set(e.props),a()))}static get observedAttributes(){return["items","max","showlabel","reducelabel","showall","stateless"]}get items(){return this.$$.ctx[8]}set items(e){this.$$set({items:e}),a()}get max(){return this.$$.ctx[0]}set max(e){this.$$set({max:e}),a()}get showlabel(){return this.$$.ctx[1]}set showlabel(e){this.$$set({showlabel:e}),a()}get reducelabel(){return this.$$.ctx[2]}set reducelabel(e){this.$$set({reducelabel:e}),a()}get showall(){return this.$$.ctx[9]}set showall(e){this.$$set({showall:e}),a()}get stateless(){return this.$$.ctx[3]}set stateless(e){this.$$set({stateless:e}),a()}}export{N as default};
|
|
476
2
|
//# sourceMappingURL=TagList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagList.js","sources":["../../../src/components/taglist/TagList.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { EventHandler } from '../../utilities/EventHandler';\n import Tag from '../tag/Tag.nested.svelte';\n import type { TagElem } from '../tag/tag.types';\n export let items: string;\n export let max = 10;\n export let showlabel = 'Show all';\n export let reducelabel = 'Reduce';\n export let showall = false;\n export let stateless = false;\n\n $: parsedItems = items ? (JSON.parse(items) as TagElem[]) : [];\n $: showAll = showall ? true : false;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n let eventHandler = new EventHandler();\n\n function onRemoved(item: any): void {\n eventHandler.dispatch('tag-removed', item);\n }\n\n function onExtend(): void {\n if (stateless)\n eventHandler.dispatch(showAll ? 'reduce' : 'show-all', parsedItems);\n else showAll = !showAll;\n }\n</script>\n\n<div class=\"mc-taglist\">\n {#each parsedItems as item, index}\n {#if index < max || showAll}\n <div class=\"tag-selected\">\n <Tag\n id={item.id}\n label={item.label}\n size={'s'}\n type=\"removable\"\n dark={false}\n disabled={false}\n selected={false}\n on:tag-removed={() => onRemoved(item)}\n />\n </div>\n {/if}\n {/each}\n {#if max && parsedItems.length > max}\n <div class=\"tag-selected\">\n <Tag\n id=\"id-tag\"\n label={showAll && !stateless ? reducelabel : showlabel}\n size=\"s\"\n type=\"link\"\n class=\"mc-taglist__showhide\"\n dark={false}\n disabled={false}\n name=\"\"\n on:tag-selected={onExtend}\n />\n </div>\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n .mc-taglist {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: $mu100;\n\n &__showhide {\n cursor: pointer;\n }\n }\n</style>\n"],"names":[
|
|
1
|
+
{"version":3,"file":"TagList.js","sources":["../../../src/components/taglist/TagList.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { EventHandler } from '../../utilities/EventHandler';\n import Tag from '../tag/Tag.nested.svelte';\n import type { TagElem } from '../tag/tag.types';\n export let items: string;\n export let max = 10;\n export let showlabel = 'Show all';\n export let reducelabel = 'Reduce';\n export let showall = false;\n export let stateless = false;\n\n $: parsedItems = items ? (JSON.parse(items) as TagElem[]) : [];\n $: showAll = showall ? true : false;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n let eventHandler = new EventHandler();\n\n function onRemoved(item: any): void {\n eventHandler.dispatch('tag-removed', item);\n }\n\n function onExtend(): void {\n if (stateless)\n eventHandler.dispatch(showAll ? 'reduce' : 'show-all', parsedItems);\n else showAll = !showAll;\n }\n</script>\n\n<div class=\"mc-taglist\">\n {#each parsedItems as item, index}\n {#if index < max || showAll}\n <div class=\"tag-selected\">\n <Tag\n id={item.id}\n label={item.label}\n size={'s'}\n type=\"removable\"\n dark={false}\n disabled={false}\n selected={false}\n on:tag-removed={() => onRemoved(item)}\n />\n </div>\n {/if}\n {/each}\n {#if max && parsedItems.length > max}\n <div class=\"tag-selected\">\n <Tag\n id=\"id-tag\"\n label={showAll && !stateless ? reducelabel : showlabel}\n size=\"s\"\n type=\"link\"\n class=\"mc-taglist__showhide\"\n dark={false}\n disabled={false}\n name=\"\"\n on:tag-selected={onExtend}\n />\n </div>\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n .mc-taglist {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: $mu100;\n\n &__showhide {\n cursor: pointer;\n }\n }\n</style>\n"],"names":["id","ctx","label","insert","target","div","anchor","dirty","tag_changes","create_if_block_1","length","i","if_block","create_if_block","each_blocks","items","$$props","max","showlabel","reducelabel","showall","stateless","eventHandler","EventHandler","onRemoved","item","dispatch","$$invalidate","parsedItems","JSON","parse","showAll","attributes","Object","assign","$$restProps","class"],"mappings":"8YAoCcA,GAAAC,MAAKD,GACFE,MAAAD,MAAKC,WACN,2BAEA,YACI,YACA,iIARdC,EAWKC,EAAAC,EAAAC,2CATG,GAAAC,IAAAC,EAAAR,GAAAC,MAAKD,IACF,GAAAO,IAAAC,EAAAN,MAAAD,MAAKC,gIAJbD,EAAK,IAAGA,EAAG,IAAIA,EAAO,KAAAQ,EAAAR,uEAAtBA,EAAK,IAAGA,EAAG,IAAIA,EAAO,sOAmBhBC,MAAAD,OAAYA,EAAS,GAAGA,EAAW,GAAGA,EAAS,2DAIhD,YACI,kCAEOA,EAAQ,yEAV7BE,EAYKC,EAAAC,EAAAC,uCATM,GAAAC,IAAAC,EAAAN,MAAAD,OAAYA,EAAS,GAAGA,EAAW,GAAGA,EAAS,8HApBrDA,EAAW,wBAAhBS,OAAIC,GAAA,4DAgBD,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