@mozaic-ds/web-components 0.16.1-beta.0 → 0.17.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 +1 -1
- package/public/DataTableUtilities-f652653f.js +2 -0
- package/public/DataTableUtilities-f652653f.js.map +1 -0
- package/public/adeo/DataTableUtilities-f652653f.js +2 -0
- package/public/adeo/DataTableUtilities-f652653f.js.map +1 -0
- package/public/adeo/bundle.js +5 -0
- package/public/adeo/components/button/ButtonSlot.js +2 -0
- package/public/adeo/components/button/ButtonSlot.js.map +1 -0
- package/public/adeo/components/buttonslot/ButtonSlot.svelte +148 -0
- package/public/adeo/components/datatable/DataTable.js +1 -1
- package/public/adeo/components/datatable/datatable-default-action.nested.js +1 -1
- package/public/adeo/components/datatable/datatable-default-edtion.nested.js +1 -1
- package/public/adeo/components/datatable/datatable-default-filter-tags.nested.js +1 -1
- package/public/adeo/components/datatable/datatable-default-footer.nested.js +1 -1
- package/public/adeo/components/header/Header.js +1 -1
- package/public/adeo/components/header/Header.js.map +1 -1
- package/public/adeo/components/header/Header.svelte +2 -0
- package/public/adeo/components/progressbar/ProgressBar.js +1 -1
- package/public/adeo/components/progressbar/ProgressBar.js.map +1 -1
- package/public/adeo/components/progressbar/ProgressBar.svelte +7 -11
- package/public/adeo/components/tabs/Tabs.js +1 -1
- package/public/adeo/components/tabs/Tabs.js.map +1 -1
- package/public/adeo/components/tabs/Tabs.nested.js +1 -1
- package/public/adeo/components/tabs/Tabs.nested.js.map +1 -1
- package/public/adeo/components/tabs/Tabs.nested.svelte +64 -28
- package/public/adeo/components/tabs/Tabs.svelte +28 -0
- package/public/adeo/components/tabs/tabs.types.d.ts +2 -0
- package/public/adeo/components/tabs/tabs.types.d.ts.map +1 -1
- package/public/adeo/icons-storybook.js +8 -0
- package/public/adeo/main.d.ts +1 -0
- package/public/adeo/main.d.ts.map +1 -1
- package/public/adeo/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/adeo/utilities/DataTableUtilities.ts +3 -1
- package/public/adeo/utilities/components/tabs/tabs.types.d.ts +2 -0
- package/public/adeo/utilities/components/tabs/tabs.types.d.ts.map +1 -1
- package/public/adeo/utilities/main.d.ts +1 -0
- package/public/adeo/utilities/main.d.ts.map +1 -1
- package/public/adeo/utilities/stories/accordion/Accordion.stories.d.ts.map +1 -1
- package/public/adeo/utilities/stories/button/ButtonSlot.stories.d.ts +10 -0
- package/public/adeo/utilities/stories/button/ButtonSlot.stories.d.ts.map +1 -0
- package/public/adeo/utilities/stories/tabs/Tabs.stories.d.ts.map +1 -1
- package/public/adeo/utilities/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/bricoman/DataTableUtilities-f652653f.js +2 -0
- package/public/bricoman/DataTableUtilities-f652653f.js.map +1 -0
- package/public/bricoman/bundle.js +5 -0
- package/public/bricoman/components/button/ButtonSlot.js +2 -0
- package/public/bricoman/components/button/ButtonSlot.js.map +1 -0
- package/public/bricoman/components/buttonslot/ButtonSlot.svelte +148 -0
- package/public/bricoman/components/datatable/DataTable.js +1 -1
- package/public/bricoman/components/datatable/datatable-default-action.nested.js +1 -1
- package/public/bricoman/components/datatable/datatable-default-edtion.nested.js +1 -1
- package/public/bricoman/components/datatable/datatable-default-filter-tags.nested.js +1 -1
- package/public/bricoman/components/datatable/datatable-default-footer.nested.js +1 -1
- package/public/bricoman/components/header/Header.js +1 -1
- package/public/bricoman/components/header/Header.js.map +1 -1
- package/public/bricoman/components/header/Header.svelte +2 -0
- package/public/bricoman/components/progressbar/ProgressBar.js +1 -1
- package/public/bricoman/components/progressbar/ProgressBar.js.map +1 -1
- package/public/bricoman/components/progressbar/ProgressBar.svelte +7 -11
- package/public/bricoman/components/tabs/Tabs.js +1 -1
- package/public/bricoman/components/tabs/Tabs.js.map +1 -1
- package/public/bricoman/components/tabs/Tabs.nested.js +1 -1
- package/public/bricoman/components/tabs/Tabs.nested.js.map +1 -1
- package/public/bricoman/components/tabs/Tabs.nested.svelte +64 -28
- package/public/bricoman/components/tabs/Tabs.svelte +28 -0
- package/public/bricoman/components/tabs/tabs.types.d.ts +2 -0
- package/public/bricoman/components/tabs/tabs.types.d.ts.map +1 -1
- package/public/bricoman/icons-storybook.js +8 -0
- package/public/bricoman/main.d.ts +1 -0
- package/public/bricoman/main.d.ts.map +1 -1
- package/public/bricoman/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/bricoman/utilities/DataTableUtilities.ts +3 -1
- package/public/bricoman/utilities/components/tabs/tabs.types.d.ts +2 -0
- package/public/bricoman/utilities/components/tabs/tabs.types.d.ts.map +1 -1
- package/public/bricoman/utilities/main.d.ts +1 -0
- package/public/bricoman/utilities/main.d.ts.map +1 -1
- package/public/bricoman/utilities/stories/accordion/Accordion.stories.d.ts.map +1 -1
- package/public/bricoman/utilities/stories/button/ButtonSlot.stories.d.ts +10 -0
- package/public/bricoman/utilities/stories/button/ButtonSlot.stories.d.ts.map +1 -0
- package/public/bricoman/utilities/stories/tabs/Tabs.stories.d.ts.map +1 -1
- package/public/bricoman/utilities/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/bundle.js +5 -0
- package/public/components/button/ButtonSlot.js +2 -0
- package/public/components/button/ButtonSlot.js.map +1 -0
- package/public/components/buttonslot/ButtonSlot.svelte +148 -0
- package/public/components/datatable/DataTable.js +1 -1
- package/public/components/datatable/datatable-default-action.nested.js +1 -1
- package/public/components/datatable/datatable-default-edtion.nested.js +1 -1
- package/public/components/datatable/datatable-default-filter-tags.nested.js +1 -1
- package/public/components/datatable/datatable-default-footer.nested.js +1 -1
- package/public/components/header/Header.js +1 -1
- package/public/components/header/Header.js.map +1 -1
- package/public/components/header/Header.svelte +2 -0
- package/public/components/progressbar/ProgressBar.js +1 -1
- package/public/components/progressbar/ProgressBar.js.map +1 -1
- package/public/components/progressbar/ProgressBar.svelte +7 -11
- package/public/components/tabs/Tabs.js +1 -1
- package/public/components/tabs/Tabs.js.map +1 -1
- package/public/components/tabs/Tabs.nested.js +1 -1
- package/public/components/tabs/Tabs.nested.js.map +1 -1
- package/public/components/tabs/Tabs.nested.svelte +64 -28
- package/public/components/tabs/Tabs.svelte +28 -0
- package/public/components/tabs/tabs.types.d.ts +2 -0
- package/public/components/tabs/tabs.types.d.ts.map +1 -1
- package/public/icons-storybook.js +8 -0
- package/public/main.d.ts +1 -0
- package/public/main.d.ts.map +1 -1
- package/public/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/utilities/DataTableUtilities.ts +3 -1
- package/public/utilities/components/tabs/tabs.types.d.ts +2 -0
- package/public/utilities/components/tabs/tabs.types.d.ts.map +1 -1
- package/public/utilities/main.d.ts +1 -0
- package/public/utilities/main.d.ts.map +1 -1
- package/public/utilities/stories/accordion/Accordion.stories.d.ts.map +1 -1
- package/public/utilities/stories/button/ButtonSlot.stories.d.ts +10 -0
- package/public/utilities/stories/button/ButtonSlot.stories.d.ts.map +1 -0
- package/public/utilities/stories/tabs/Tabs.stories.d.ts.map +1 -1
- package/public/utilities/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/DataTableUtilities-190a23f3.js +0 -2
- package/public/DataTableUtilities-190a23f3.js.map +0 -1
- package/public/adeo/DataTableUtilities-190a23f3.js +0 -2
- package/public/adeo/DataTableUtilities-190a23f3.js.map +0 -1
- package/public/bricoman/DataTableUtilities-190a23f3.js +0 -2
- package/public/bricoman/DataTableUtilities-190a23f3.js.map +0 -1
|
@@ -45,6 +45,10 @@
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
function generateIconName(iconName: string, iconColor: string): string {
|
|
50
|
+
return `${iconName} size="1.5rem" fill="${iconColor}"`;
|
|
51
|
+
}
|
|
48
52
|
</script>
|
|
49
53
|
|
|
50
54
|
<div
|
|
@@ -78,6 +82,14 @@
|
|
|
78
82
|
manageTabs(event, Object.assign({ index: index }, tab))}
|
|
79
83
|
>
|
|
80
84
|
<span class="mc-tabs__text">
|
|
85
|
+
{#if tab.iconName}
|
|
86
|
+
<span class="mc-tabs__icon"
|
|
87
|
+
>{@html `<${generateIconName(
|
|
88
|
+
tab.iconName,
|
|
89
|
+
tab.iconColor,
|
|
90
|
+
)} />`}</span
|
|
91
|
+
>
|
|
92
|
+
{/if}
|
|
81
93
|
{tab.text}
|
|
82
94
|
</span>
|
|
83
95
|
</a>
|
|
@@ -93,6 +105,14 @@
|
|
|
93
105
|
aria-selected={tab.isActive ? 'true' : 'false'}
|
|
94
106
|
>
|
|
95
107
|
<span class="mc-tabs__text">
|
|
108
|
+
{#if tab.iconName}
|
|
109
|
+
<span class="mc-tabs__icon"
|
|
110
|
+
>{@html `<${generateIconName(
|
|
111
|
+
tab.iconName,
|
|
112
|
+
tab.iconColor,
|
|
113
|
+
)} />`}</span
|
|
114
|
+
>
|
|
115
|
+
{/if}
|
|
96
116
|
{tab.text}
|
|
97
117
|
</span>
|
|
98
118
|
</span>
|
|
@@ -113,6 +133,14 @@
|
|
|
113
133
|
manageTabs(event, Object.assign({ index: index }, tab))}
|
|
114
134
|
>
|
|
115
135
|
<span class="mc-tabs__text">
|
|
136
|
+
{#if tab.iconName}
|
|
137
|
+
<span class="mc-tabs__icon"
|
|
138
|
+
>{@html `<${generateIconName(
|
|
139
|
+
tab.iconName,
|
|
140
|
+
tab.iconColor,
|
|
141
|
+
)} />`}</span
|
|
142
|
+
>
|
|
143
|
+
{/if}
|
|
116
144
|
{tab.text}
|
|
117
145
|
</span>
|
|
118
146
|
</button>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.types.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs.types.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC"}
|
|
@@ -15,6 +15,14 @@ import DisplayBlink24 from './icons/DisplayBlink24.js';
|
|
|
15
15
|
import AspectQuantity24 from './icons/AspectQuantity24.js';
|
|
16
16
|
import ArrowArrowTopRight16 from './icons/ArrowArrowTopRight16.js';
|
|
17
17
|
import ArrowArrowBottomRight16 from './icons/ArrowArrowBottomRight16.js';
|
|
18
|
+
import NotificationWarning24 from './icons/NotificationWarning24.js';
|
|
19
|
+
|
|
20
|
+
if (!customElements.get('navigation-notification-warning-24px')) {
|
|
21
|
+
customElements.define(
|
|
22
|
+
'navigation-notification-warning-24px',
|
|
23
|
+
NotificationWarning24,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
18
26
|
|
|
19
27
|
if (!customElements.get('navigation-arrow-arrowtopright-16px')) {
|
|
20
28
|
customElements.define(
|
package/public/adeo/main.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAsDhE,YAAY,EACV,OAAO,IAAI,WAAW,EACtB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,IAAI,GACL,MAAM,oCAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG5C,wBAuDE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableUtilities.d.ts","sourceRoot":"","sources":["../../../src/utilities/DataTableUtilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EACR,aAAa,EACb,WAAW,EAEX,eAAe,EAKhB,MAAM,yCAAyC,CAAC;AAsIjD,eAAO,MAAM,cAAc,aACf,QAAQ,YACR,QAAQ,KACjB,MAMF,CAAC;AAEF,eAAO,MAAM,gBAAgB,oBACV,MAAM,GAAG,SAAS,SAC5B,MAAM;;CAQd,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAW,QAAQ,EAAE,KAAG,OASvD,CAAC;AACF,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,KAAG,OAQ/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBACL,aAAa,KAClC,
|
|
1
|
+
{"version":3,"file":"DataTableUtilities.d.ts","sourceRoot":"","sources":["../../../src/utilities/DataTableUtilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EACR,aAAa,EACb,WAAW,EAEX,eAAe,EAKhB,MAAM,yCAAyC,CAAC;AAsIjD,eAAO,MAAM,cAAc,aACf,QAAQ,YACR,QAAQ,KACjB,MAMF,CAAC;AAEF,eAAO,MAAM,gBAAgB,oBACV,MAAM,GAAG,SAAS,SAC5B,MAAM;;CAQd,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAW,QAAQ,EAAE,KAAG,OASvD,CAAC;AACF,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,KAAG,OAQ/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBACL,aAAa,KAClC,aAeF,CAAC;AAEF,eAAO,MAAM,WAAW,UACf,QAAQ,EAAE,YACP,MAAM,eACH,WAAW,iBACT,aAAa,KAC3B,QAAQ,EA8DV,CAAC;AAEF,eAAO,MAAM,yBAAyB,eACxB,MAAM,eACL,MAAM,gBACL,OAAO,KACpB,MAAM,EAmBR,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAC7B,QAAQ,mBACG,eAAe,GAAG,SAAS,sBACxB,OAAO,KAC1B,eAAe,GAAG,SAyCpB,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAC3B,QAAQ,EAAE,mBACA,eAAe,GAAG,SAAS,sBACxB,OAAO,iBACZ,OAAO,YACZ,OAAO,KAChB,eAAe,GAAG,SAwFpB,CAAC;AAEF,eAAO,MAAM,cAAc,oBACR,eAAe,GAAG,SAAS,KAC3C,eAAe,GAAG,SAOpB,CAAC;AAEF,eAAO,MAAM,SAAS,oBACH,eAAe,GAAG,SAAS,KAC3C,eAAe,GAAG,SAOpB,CAAC;AAEF,eAAO,MAAM,mCAAmC,UACvC,QAAQ,EAAE,mBACA,eAAe,GAAG,SAAS,iBAC7B,OAAO,KACrB,OA4BF,CAAC;AAEF,oBAAY,aAAa;IACvB,KAAK,UAAU;CAChB"}
|
|
@@ -196,12 +196,14 @@ export const getSortDirection = (
|
|
|
196
196
|
let sortDirection: SortDirection;
|
|
197
197
|
switch (initialSortDirection) {
|
|
198
198
|
case 'na':
|
|
199
|
+
sortDirection = 'desc';
|
|
200
|
+
break;
|
|
199
201
|
case 'desc':
|
|
200
202
|
default:
|
|
201
203
|
sortDirection = 'asc';
|
|
202
204
|
break;
|
|
203
205
|
case 'asc':
|
|
204
|
-
sortDirection = '
|
|
206
|
+
sortDirection = 'na';
|
|
205
207
|
break;
|
|
206
208
|
}
|
|
207
209
|
return sortDirection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.types.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs.types.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAsDhE,YAAY,EACV,OAAO,IAAI,WAAW,EACtB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,IAAI,GACL,MAAM,oCAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG5C,wBAuDE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/accordion/Accordion.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;;AAInD,wBAuDU;
|
|
1
|
+
{"version":3,"file":"Accordion.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/accordion/Accordion.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;;AAInD,wBAuDU;AAuDV,eAAO,MAAM,OAAO,uCAAoB,CAAC;AAKzC,eAAO,MAAM,IAAI,uCAAoB,CAAC;AAOtC,eAAO,MAAM,iBAAiB,uCAAoB,CAAC;AAOnD,eAAO,MAAM,eAAe,uCAAoB,CAAC;AAQjD,eAAO,MAAM,SAAS,uCAAoB,CAAC;AAO3C,eAAO,MAAM,QAAQ,uCAAoB,CAAC;AAO1C,eAAO,MAAM,cAAc,uCAAoB,CAAC;AAOhD,eAAO,MAAM,cAAc,uCAAwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Story, Meta } from '@storybook/html';
|
|
2
|
+
declare const _default: Meta<import("@storybook/html").Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Solid: Story<import("@storybook/html").Args>;
|
|
5
|
+
export declare const Bordered: Story<import("@storybook/html").Args>;
|
|
6
|
+
export declare const IconLeft: Story<import("@storybook/html").Args>;
|
|
7
|
+
export declare const IconRight: Story<import("@storybook/html").Args>;
|
|
8
|
+
export declare const IconOnly: Story<import("@storybook/html").Args>;
|
|
9
|
+
export declare const WithLoading: Story<import("@storybook/html").Args>;
|
|
10
|
+
//# sourceMappingURL=ButtonSlot.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonSlot.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/button/ButtonSlot.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;;AAGnD,wBA2EU;AA8FV,eAAO,MAAM,KAAK,uCAAoB,CAAC;AAGvC,eAAO,MAAM,QAAQ,uCAAoB,CAAC;AAK1C,eAAO,MAAM,QAAQ,uCAAoB,CAAC;AAa1C,eAAO,MAAM,SAAS,uCAAoB,CAAC;AAa3C,eAAO,MAAM,QAAQ,uCAAoB,CAAC;AAkB1C,eAAO,MAAM,WAAW,uCAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/tabs/Tabs.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;;AAGnD,wBAkDU;
|
|
1
|
+
{"version":3,"file":"Tabs.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/tabs/Tabs.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;;AAGnD,wBAkDU;AAgEV,eAAO,MAAM,OAAO,uCAAoB,CAAC;AAMzC,eAAO,MAAM,mBAAmB,uCAAoB,CAAC;AAMrD,eAAO,MAAM,qBAAqB,uCAAoB,CAAC;AAMvD,eAAO,MAAM,SAAS,uCAAoB,CAAC;AAM3C,eAAO,MAAM,SAAS,uCAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableUtilities.d.ts","sourceRoot":"","sources":["../../src/utilities/DataTableUtilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EACR,aAAa,EACb,WAAW,EAEX,eAAe,EAKhB,MAAM,yCAAyC,CAAC;AAsIjD,eAAO,MAAM,cAAc,aACf,QAAQ,YACR,QAAQ,KACjB,MAMF,CAAC;AAEF,eAAO,MAAM,gBAAgB,oBACV,MAAM,GAAG,SAAS,SAC5B,MAAM;;CAQd,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAW,QAAQ,EAAE,KAAG,OASvD,CAAC;AACF,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,KAAG,OAQ/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBACL,aAAa,KAClC,
|
|
1
|
+
{"version":3,"file":"DataTableUtilities.d.ts","sourceRoot":"","sources":["../../src/utilities/DataTableUtilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EACR,aAAa,EACb,WAAW,EAEX,eAAe,EAKhB,MAAM,yCAAyC,CAAC;AAsIjD,eAAO,MAAM,cAAc,aACf,QAAQ,YACR,QAAQ,KACjB,MAMF,CAAC;AAEF,eAAO,MAAM,gBAAgB,oBACV,MAAM,GAAG,SAAS,SAC5B,MAAM;;CAQd,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAW,QAAQ,EAAE,KAAG,OASvD,CAAC;AACF,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,KAAG,OAQ/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBACL,aAAa,KAClC,aAeF,CAAC;AAEF,eAAO,MAAM,WAAW,UACf,QAAQ,EAAE,YACP,MAAM,eACH,WAAW,iBACT,aAAa,KAC3B,QAAQ,EA8DV,CAAC;AAEF,eAAO,MAAM,yBAAyB,eACxB,MAAM,eACL,MAAM,gBACL,OAAO,KACpB,MAAM,EAmBR,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAC7B,QAAQ,mBACG,eAAe,GAAG,SAAS,sBACxB,OAAO,KAC1B,eAAe,GAAG,SAyCpB,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAC3B,QAAQ,EAAE,mBACA,eAAe,GAAG,SAAS,sBACxB,OAAO,iBACZ,OAAO,YACZ,OAAO,KAChB,eAAe,GAAG,SAwFpB,CAAC;AAEF,eAAO,MAAM,cAAc,oBACR,eAAe,GAAG,SAAS,KAC3C,eAAe,GAAG,SAOpB,CAAC;AAEF,eAAO,MAAM,SAAS,oBACH,eAAe,GAAG,SAAS,KAC3C,eAAe,GAAG,SAOpB,CAAC;AAEF,eAAO,MAAM,mCAAmC,UACvC,QAAQ,EAAE,mBACA,eAAe,GAAG,SAAS,iBAC7B,OAAO,KACrB,OA4BF,CAAC;AAEF,oBAAY,aAAa;IACvB,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=(e,l,t)=>{switch(e){case"Text":default:return l;case"CustomText":return(e=>{let l="";return e.map((e=>l+=`<div class="custom-text" ${e.style?`style="${e.style}"`:""}> ${e.text}</div>`)),l})(l);case"Number":return null!=(n=l)?`<span style="display: flex; justify-content: end;"> ${Number(n)} </span>`:"";case"Image":return`<img style="${(c=l).style||"width: 35px; height: 35px; margin-right: 8px;"}" src="${c.src||"/assets/no-picture.svg"}"/>`;case"Badge":return`<div class="mc-badge mc-badge--${(i=l).theme||"info"}">${i.content}</div>`;case"Link":return`<a class="mc-link" href=${(s=l).href} >${s.text}</a>`;case"FileFormat":return((e,l)=>`<div class="mc-tooltip mc-tooltip--top">\n <span id="tooltipTop" class="mc-tooltip__content" role="tooltip">\n ${e.documentNameTooltip}\n </span>\n <span class="mc-link" id=cell-file-${l} style="${e.style}"> ${e.documentName}</span>\n </div>`)(l,t);case"LinkWithoutRedirect":return((e,l)=>`<a class="mc-link" id=cell-link-${l} href=${e.href} onclick="return false;">${e.text}</a>`)(l,t);case"ProgressBar":return!0===l.branded?(d=l).labelOnLeft?`<div style="float: left;"><span>${d.value}%</span></div> \n <div style="margin-top: 0.4em;margin-left: 2.7em;"><m-progressbar value=${d.value} size='m' branded=${d.branded}></m-progressbar></div>`:`<m-progressbar value=${d.value} displaypercentage=${d.displaypercentage} size='${d.size}' branded=${d.branded}></m-progressbar>`:(e=>e.labelOnLeft?`<div style="float: left;"><span>${e.value}%</span></div> \n <div style="margin-top: 0.4em;margin-left: 2.7em;"><m-progressbar value=${e.value} size='m'></m-progressbar></div>`:`<m-progressbar value=${e.value} displaypercentage=${e.displaypercentage} size='${e.size}'></m-progressbar>`)(l);case"Button":return((e,l)=>{let t=`<m-button\n id=cell-button-${l}\n label="${e.label}"\n theme=${e.theme}\n iconname=${e.iconname}\n iconmode=${e.iconmode}\n size=${e.size} `;return e.bordered&&(t+=`bordered=${e.bordered} `),e.disabled&&(t+=`disabled=${e.disabled}`),t+="></m-button>",t})(l,t);case"InputText":return((e,l)=>{const t=document.createElement("m-textinput");return t.setAttribute("id",`cell-input-${l}`),t.setAttribute("size","s"),t.setAttribute("placeholder",`${e.placeholder}`),t.setAttribute("type",e.type?`${e.type}`:"text"),t.setAttribute("value",e.value?`${e.value}`:""),e.min&&t.setAttribute("min",`${e.min}`),e.max&&t.setAttribute("max",`${e.max}`),e.rightalign&&t.setAttribute("rightalign",`${e.rightalign}`),e.isvalid&&t.setAttribute("isvalid",`${e.isvalid}`),e.isinvalid&&t.setAttribute("isinvalid",`${e.isinvalid}`),e.disabled&&t.setAttribute("disabled",`${e.disabled}`),t.outerHTML})(l,t)}var d,s,i,c,n},l=(l,t)=>{const d=null==t?void 0:t.cells[l.id];return d||0===Number(d)?e(l.cellsFormat,d,t.id):""},t=(e,l)=>e?{[`data-${e||""}`]:l}:{},d=e=>e.filter((e=>!e.disableSelection)).filter((e=>!0===e.selected)).length===e.filter((e=>!e.disableSelection)).length&&e.filter((e=>!e.disableSelection)).length>0,s=e=>{let l=!1;return e.forEach((e=>{"subRow"in e&&(l=!0)})),l},i=e=>{let l;switch(e){case"na":l="desc";break;case"desc":default:l="asc";break;case"asc":l="na"}return l},c=(e,l,t,d)=>{let s;switch(t){default:case"Text":"asc"===d?s=(e,t)=>e.cells[l]>t.cells[l]?1:-1:"desc"===d&&(s=(e,t)=>e.cells[l]>t.cells[l]?-1:1);break;case"Badge":"asc"===d?s=(e,t)=>{var d,s;return((null===(d=e.cells[l])||void 0===d?void 0:d.content)||"0")>((null===(s=t.cells[l])||void 0===s?void 0:s.content)||"0")?1:-1}:"desc"===d&&(s=(e,t)=>{var d,s;return((null===(d=e.cells[l])||void 0===d?void 0:d.content)||"0")>((null===(s=t.cells[l])||void 0===s?void 0:s.content)||"0")?-1:1});break;case"Link":"asc"===d?s=(e,t)=>{var d,s;return((null===(d=e.cells[l])||void 0===d?void 0:d.text)||"0")>((null===(s=t.cells[l])||void 0===s?void 0:s.text)||"0")?1:-1}:"desc"===d&&(s=(e,t)=>{var d,s;return((null===(d=e.cells[l])||void 0===d?void 0:d.text)||"0")>((null===(s=t.cells[l])||void 0===s?void 0:s.text)||"0")?-1:1});break;case"CustomText":"asc"===d?s=(e,t)=>(e.cells[l][0].text||"0")>(t.cells[l][0].text||"0")?1:-1:"desc"===d&&(s=(e,t)=>(e.cells[l][0].text||"0")>(t.cells[l][0].text||"0")?-1:1)}return e.sort(s)},n=(e,l,t)=>{if(e<=10||t)return Array.from({length:e},((e,l)=>l+1));{const t=[1,2,3];t.includes(l-1)||l-1==0||t.push(l-1),t.includes(l)||t.push(l),t.includes(l+1)||l==e||t.push(l+1),t.push(e-2,e-1,e);const d=[...new Set(t)];return d.sort(((e,l)=>e-l)),d}},a=(e,l,t)=>(t&&null!=l&&(l.allSelected?e.selected?(l.excludedIdsFromSelection=[...l.excludedIdsFromSelection,e.id],l.excludedIdsFromSelection.length===l.totalItems&&(l.excludedIdsFromSelection=[],l.allSelected=!1)):l.excludedIdsFromSelection=[...l.excludedIdsFromSelection.filter((l=>l!==e.id))]:e.selected?l.idsSelected=[...l.idsSelected.filter((l=>l!==e.id))]:(l.idsSelected=[...l.idsSelected,e.id],l.idsSelected.length===l.totalItems&&(l.idsSelected=[],l.allSelected=!0))),l),r=(e,l,t,d,s)=>(t&&null!=l&&((null==l?void 0:l.allSelected)?d?(e.filter((e=>!e.disableSelection)).filter((e=>!((null==l?void 0:l.idsSelected)||[]).includes(e.id))).forEach((e=>{null!=l&&(l.idsSelected=[...l.idsSelected,e.id])})),e.filter((e=>!e.disableSelection)).forEach((e=>{if(null!=l){const t=l.excludedIdsFromSelection.indexOf(e.id,0);t>-1&&(l.excludedIdsFromSelection.splice(t,1),l.excludedIdsFromSelection=[...l.excludedIdsFromSelection])}})),l.idsSelected.length===l.totalItems&&(l.allSelected=!0,l.idsSelected=[])):(l.excludedIdsFromSelection=[...l.excludedIdsFromSelection,...e.filter((e=>!e.disableSelection)).map((e=>e.id))],l.excludedIdsFromSelection.length===l.totalItems&&(l.allSelected=!1,l.idsSelected=[],l.excludedIdsFromSelection=[])):s?(e.filter((e=>!e.disableSelection)).filter((e=>!((null==l?void 0:l.idsSelected)||[]).includes(e.id))).forEach((e=>{null!=l&&(l.idsSelected=[...l.idsSelected,e.id])})),l.idsSelected.length===l.totalItems&&(l.allSelected=!0,l.idsSelected=[])):e.filter((e=>!e.disableSelection)).forEach((e=>{null!=l&&(l.idsSelected=[...l.idsSelected.filter((l=>l!==e.id))])}))),l),o=e=>(null!=e&&(e.excludedIdsFromSelection=[],e.idsSelected=[],e.allSelected=!1),e),u=e=>(null!=e&&(e.excludedIdsFromSelection=[],e.idsSelected=[],e.allSelected=!0),e),m=(e,l,t)=>null!=l&&null!=t&&!(!l.allSelected&&e.filter((e=>!e.disableSelection)).map((e=>e.id)).every((e=>((null==l?void 0:l.idsSelected)||[]).includes(e)))||!l.allSelected&&0===l.idsSelected.length||l.allSelected&&!e.map((e=>e.id)).some((e=>((null==l?void 0:l.excludedIdsFromSelection)||[]).includes(e)))||l.allSelected&&0===l.excludedIdsFromSelection.length);var S;!function(e){e.ENTER="Enter"}(S||(S={}));export{d as a,i as b,s as c,r as d,o as e,l as f,t as g,a as h,m as i,n as j,S as k,c as o,u as s};
|
|
2
|
+
//# sourceMappingURL=DataTableUtilities-f652653f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableUtilities-f652653f.js","sources":["../../../src/utilities/DataTableUtilities.ts"],"sourcesContent":[null],"names":["getFormattedCell","headerFormat","cellValue","id","customText","customTextHtml","map","item","style","text","customTextFormatter","number","Number","image","src","badge","theme","content","link","href","file","documentNameTooltip","documentName","fileFormatter","linkWithoutRedirectFormatter","branded","progressBar","labelOnLeft","value","displaypercentage","size","progressBarFormatter","button","buttonText","label","iconname","iconmode","bordered","disabled","buttonFormatterBranded","input","myInput","document","createElement","setAttribute","placeholder","type","min","max","rightalign","isvalid","isinvalid","outerHTML","inputFormatter","getCellContent","headData","bodyData","cells","cellsFormat","getDataAttribute","attributeSuffix","areAllItemsSelected","items","filter","disableSelection","selected","length","checkSubRow","result","forEach","getSortDirection","initialSortDirection","sortDirection","onePageSort","columnId","compareFunction","a","b","_a","_b","sort","getPageSelectOptionsArray","totalPages","currentPage","showAllPages","Array","from","_","i","pagesArray","includes","push","optionsArray","Set","handleCountItemSelection","selectionParams","showSelectionCount","allSelected","excludedIdsFromSelection","totalItems","itemDeselected","idsSelected","idSelected","handleCountAllSelection","indeterminate","allItems","undefined","index","indexOf","splice","clearSelection","selectAll","isHeaderSelectCheckboxIndeterminate","every","some","keyboardsKeys"],"mappings":"AAk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e,IAAIX,SAASnF,OAElDwF,EAAgBE,aACuB,IAAvCF,EAAgBM,YAAYnC,QAC7B6B,EAAgBE,cACdnC,EACExD,KAAKC,GAASA,EAAKJ,KACnB+G,MAAM/G,KACJ4F,aAAe,EAAfA,EAAiBG,2BAA4B,IAAIR,SAASvF,MAEhE4F,EAAgBE,aACqC,IAApDF,EAAgBG,yBAAyBhC,YASrCiD,GAAZ,SAAYA,GACVA,EAAA,MAAA,OACD,CAFD,CAAYA,IAAAA,EAEX,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Accordion from './components/accordion/Accordion.js';
|
|
2
2
|
import Autocomplete from './components/autocomplete/Autocomplete.js';
|
|
3
3
|
import Button from './components/button/Button.js';
|
|
4
|
+
import ButtonSlot from './components/button/ButtonSlot.js';
|
|
4
5
|
import Card from './components/card/Card.js';
|
|
5
6
|
import Breadcrumb from './components/breadcrumb/Breadcrumb.js';
|
|
6
7
|
import Checkbox from './components/checkbox/Checkbox.js';
|
|
@@ -72,6 +73,10 @@ if (!customElements.get('m-button')) {
|
|
|
72
73
|
customElements.define('m-button', Button);
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
if (!customElements.get('m-button-slot')) {
|
|
77
|
+
customElements.define('m-button-slot', ButtonSlot);
|
|
78
|
+
}
|
|
79
|
+
|
|
75
80
|
if (!customElements.get('m-card')) {
|
|
76
81
|
customElements.define('m-card', Card);
|
|
77
82
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as t,i as o,a as e,b as i,f as n,s as r,c as m,e as c,d as l,n as d,h as s,v as b,j as a,K as u,y as h,w as f,x as g,m as p,o as x,p as w,q as _,u as $,g as y,z as v,B as k,C as z,D as j,P as q}from"../../index-9ffad6d0.js";import{c as C}from"../../EventForward-24fc0272.js";import E from"../loader/Loader.nested.js";function L(t){let o,e,n,r;const m=[M,N],l=[];function d(t,o){return t[11]&&"left"===t[10]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),y(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(v(),f(l[r],1,1,(()=>{l[r]=null})),g(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),h(n,1),n.m(o,null))},i(t){r||(h(n),r=!0)},o(t){f(n),r=!1},d(t){t&&x(o),l[e].d()}}}function N(t){let o;return{c(){o=c("slot"),y(o,"name","icon")},m(t,e){i(t,o,e)},p:d,i:d,o:d,d(t){t&&x(o)}}}function M(t){let o,e;return o=new E({props:{size:"s",theme:t[9],text:""}}),{c(){k(o.$$.fragment)},m(t,i){z(o,t,i),e=!0},p(t,e){const i={};512&e&&(i.theme=t[9]),o.$set(i)},i(t){e||(h(o.$$.fragment,t),e=!0)},o(t){f(o.$$.fragment,t),e=!1},d(t){j(o,t)}}}function O(t){let o,e,n,r,m,d=t[11]&&"left"===t[10]&&!t[4]&&S(t),s=t[11]&&"right"===t[10]&&!t[4]&&A(t);return{c(){d&&d.c(),o=l(),e=c("span"),e.innerHTML="<slot></slot>",n=l(),s&&s.c(),r=q(),y(e,"class","mc-button__label")},m(t,c){d&&d.m(t,c),i(t,o,c),i(t,e,c),i(t,n,c),s&&s.m(t,c),i(t,r,c),m=!0},p(t,e){t[11]&&"left"===t[10]&&!t[4]?d?(d.p(t,e),3088&e&&h(d,1)):(d=S(t),d.c(),h(d,1),d.m(o.parentNode,o)):d&&(v(),f(d,1,1,(()=>{d=null})),g()),t[11]&&"right"===t[10]&&!t[4]?s?(s.p(t,e),3088&e&&h(s,1)):(s=A(t),s.c(),h(s,1),s.m(r.parentNode,r)):s&&(v(),f(s,1,1,(()=>{s=null})),g())},i(t){m||(h(d),h(s),m=!0)},o(t){f(d),f(s),m=!1},d(t){d&&d.d(t),t&&x(o),t&&x(e),t&&x(n),s&&s.d(t),t&&x(r)}}}function R(t){let o,e,n,r;const m=[D,B],l=[];function d(t,o){return t[11]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),y(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(v(),f(l[r],1,1,(()=>{l[r]=null})),g(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),h(n,1),n.m(o,null))},i(t){r||(h(n),r=!0)},o(t){f(n),r=!1},d(t){t&&x(o),l[e].d()}}}function S(t){let o,e,n;return e=new E({props:{size:"s",theme:t[9],text:""}}),{c(){o=c("span"),k(e.$$.fragment),y(o,"class","mc-button__icon")},m(t,r){i(t,o,r),z(e,o,null),n=!0},p(t,o){const i={};512&o&&(i.theme=t[9]),e.$set(i)},i(t){n||(h(e.$$.fragment,t),n=!0)},o(t){f(e.$$.fragment,t),n=!1},d(t){t&&x(o),j(e)}}}function A(t){let o,e,n;return e=new E({props:{size:"s",theme:t[9],text:""}}),{c(){o=c("span"),k(e.$$.fragment),y(o,"class","mc-button__icon")},m(t,r){i(t,o,r),z(e,o,null),n=!0},p(t,o){const i={};512&o&&(i.theme=t[9]),e.$set(i)},i(t){n||(h(e.$$.fragment,t),n=!0)},o(t){f(e.$$.fragment,t),n=!1},d(t){t&&x(o),j(e)}}}function B(t){let o;return{c(){o=c("slot"),y(o,"name","icon")},m(t,e){i(t,o,e)},p:d,i:d,o:d,d(t){t&&x(o)}}}function D(t){let o,e;return o=new E({props:{size:"m",theme:t[9],text:""}}),{c(){k(o.$$.fragment)},m(t,i){z(o,t,i),e=!0},p(t,e){const i={};512&e&&(i.theme=t[9]),o.$set(i)},i(t){e||(h(o.$$.fragment,t),e=!0)},o(t){f(o.$$.fragment,t),e=!1},d(t){j(o,t)}}}function F(t){let o,e,n,r;const m=[J,H],l=[];function d(t,o){return t[11]&&"right"===t[10]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),y(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(v(),f(l[r],1,1,(()=>{l[r]=null})),g(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),h(n,1),n.m(o,null))},i(t){r||(h(n),r=!0)},o(t){f(n),r=!1},d(t){t&&x(o),l[e].d()}}}function H(t){let o;return{c(){o=c("slot"),y(o,"name","icon")},m(t,e){i(t,o,e)},p:d,i:d,o:d,d(t){t&&x(o)}}}function J(t){let o,e;return o=new E({props:{size:"s",theme:t[9],text:""}}),{c(){k(o.$$.fragment)},m(t,i){z(o,t,i),e=!0},p(t,e){const i={};512&e&&(i.theme=t[9]),o.$set(i)},i(t){e||(h(o.$$.fragment,t),e=!0)},o(t){f(o.$$.fragment,t),e=!1},d(t){j(o,t)}}}function K(t){let o,e,n,r,w,_,$,y,k,z="left"===t[4]&&L(t);const j=[R,O],q=[];function C(t,o){return"only"===t[4]?0:1}n=C(t),r=q[n]=j[n](t);let E="right"===t[4]&&F(t),N=[{type:t[6]},{class:_=t[13](t[1],t[0],t[2],t[3])+" "+t[8]},{disabled:t[5]},t[7]],M={};for(let t=0;t<N.length;t+=1)M=m(M,N[t]);return{c(){o=c("button"),z&&z.c(),e=l(),r.c(),w=l(),E&&E.c(),this.c=d,s(o,M),b(o,"mc-button--square","only"===t[4])},m(r,m){i(r,o,m),z&&z.m(o,null),a(o,e),q[n].m(o,null),a(o,w),E&&E.m(o,null),o.autofocus&&o.focus(),$=!0,y||(k=u(t[12].call(null,o)),y=!0)},p(t,[i]){"left"===t[4]?z?(z.p(t,i),16&i&&h(z,1)):(z=L(t),z.c(),h(z,1),z.m(o,e)):z&&(v(),f(z,1,1,(()=>{z=null})),g());let m=n;n=C(t),n===m?q[n].p(t,i):(v(),f(q[m],1,1,(()=>{q[m]=null})),g(),r=q[n],r?r.p(t,i):(r=q[n]=j[n](t),r.c()),h(r,1),r.m(o,w)),"right"===t[4]?E?(E.p(t,i),16&i&&h(E,1)):(E=F(t),E.c(),h(E,1),E.m(o,null)):E&&(v(),f(E,1,1,(()=>{E=null})),g()),s(o,M=p(N,[(!$||64&i)&&{type:t[6]},(!$||271&i&&_!==(_=t[13](t[1],t[0],t[2],t[3])+" "+t[8]))&&{class:_},(!$||32&i)&&{disabled:t[5]},128&i&&t[7]])),b(o,"mc-button--square","only"===t[4])},i(t){$||(h(z),h(r),h(E),$=!0)},o(t){f(z),f(r),f(E),$=!1},d(t){t&&x(o),z&&z.d(),q[n].d(),E&&E.d(),y=!1,k()}}}function P(t,o,e){let i,n,r,c,l,d;const s=["bordered","theme","size","full","iconmode","disabled","responsivesize","responsivewidth","type","loader"];let b=w(o,s);var a,u,h;let{bordered:f=!1}=o,{theme:g}=o,{size:p="m"}=o,{full:x=!1}=o,{iconmode:y}=o,{disabled:v=!1}=o,{responsivesize:k}=o,{responsivewidth:z}=o,{type:j="button"}=o,{loader:q}=o;const E=C(_());return t.$$set=t=>{e(22,o=m(m({},o),$(t))),e(21,b=w(o,s)),"bordered"in t&&e(0,f=t.bordered),"theme"in t&&e(1,g=t.theme),"size"in t&&e(2,p=t.size),"full"in t&&e(3,x=t.full),"iconmode"in t&&e(4,y=t.iconmode),"disabled"in t&&e(5,v=t.disabled),"responsivesize"in t&&e(14,k=t.responsivesize),"responsivewidth"in t&&e(15,z=t.responsivewidth),"type"in t&&e(6,j=t.type),"loader"in t&&e(16,q=t.loader)},t.$$.update=()=>{65536&t.$$.dirty&&e(20,i=q?JSON.parse(q):void 0),1179648&t.$$.dirty&&e(11,n=null!==e(17,a=null==i?void 0:i.enabled)&&void 0!==a&&a),1310720&t.$$.dirty&&e(10,r=null!==e(18,u=null==i?void 0:i.position)&&void 0!==u?u:"left"),1572864&t.$$.dirty&&e(9,c=null!==e(19,h=null==i?void 0:i.theme)&&void 0!==h?h:"primary"),e(8,l=o.class),e(7,d=Object.assign({},b)),128&t.$$.dirty&&delete d.class},o=$(o),[f,g,p,x,y,v,j,d,l,c,r,n,E,function(t,o,e,i){const n=["mc-button"],r=function(t,o){if(!o&&!t)return"";const e=o?"bordered":"solid";return t?`mc-button--${e}-${t}`:`mc-button--${e}`}(t,o);return r&&n.push(r),e&&n.push(`mc-button--${e}`),i?n.push("mc-button--full"):n.push("mc-button--fit"),"only"===y&&n.push("mc-button--square"),k&&n.push(`mc-button--${k}`),z&&n.push(`mc-button--${z}`),n.join(" ")},k,z,q,a,u,h,i]}class T extends t{constructor(t){super();const m=document.createElement("style");m.textContent='.mc-button{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;color:#ffffff;background-color:#120949;font-family:"LeroyMerlin", sans-serif;font-weight:600;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;fill:currentColor}.mc-button.is-hover,.mc-button:hover{background-color:#161cb6;color:#ffffff}.mc-button.is-active,.mc-button:active{background-color:#161cb6}.mc-button:disabled,.mc-button.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button .mc-button__icon:first-child,.mc-button .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button.is-focus,.mc-button:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-button--s{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s .mc-button__icon:first-child,.mc-button--s .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m .mc-button__icon:first-child,.mc-button--m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l .mc-button__icon{width:2rem;height:2rem}.mc-button--l .mc-button__icon:first-child,.mc-button--l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:0;padding:0}.mc-button__icon{-ms-flex-negative:0;flex-shrink:0}.mc-button__icon:last-child{margin-left:0.5rem;margin-right:-0.25rem}.mc-button__icon:first-child{margin-right:0.5rem;margin-left:-0.25rem}.mc-button__icon:only-child{margin:0}.mc-button__label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;pointer-events:none}.mc-button--solid-primary-02{background-color:#ff5800}.mc-button--solid-primary-02.is-hover,.mc-button--solid-primary-02:hover{background-color:#b83f00}.mc-button--solid-primary-02.is-active,.mc-button--solid-primary-02:active{background-color:#421700}.mc-button--solid-primary-02:disabled,.mc-button--solid-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-neutral{background-color:#333333}.mc-button--solid-neutral.is-hover,.mc-button--solid-neutral:hover{background-color:#191919}.mc-button--solid-neutral.is-active,.mc-button--solid-neutral:active{background-color:#333333}.mc-button--solid-neutral:disabled,.mc-button--solid-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-danger{background-color:#c61112}.mc-button--solid-danger.is-hover,.mc-button--solid-danger:hover{background-color:#8c0003}.mc-button--solid-danger.is-active,.mc-button--solid-danger:active{background-color:#8c0003}.mc-button--solid-danger:disabled,.mc-button--solid-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered{color:#120949;border-color:#120949;background-color:#ffffff}.mc-button--bordered.is-hover,.mc-button--bordered:hover{background-color:#e5e7fa;color:#161cb6}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#b8bef4;color:#130f7b}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#b8bef4;color:#130f7b}.mc-button--bordered:disabled,.mc-button--bordered.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-primary-02{color:#ff5800;border-color:#ff5800;background-color:#ffffff}.mc-button--bordered-primary-02.is-hover,.mc-button--bordered-primary-02:hover{background-color:#ffe1d1;color:#ff5800}.mc-button--bordered-primary-02.is-active,.mc-button--bordered-primary-02:active{background-color:#ffab80}.mc-button--bordered-primary-02:disabled,.mc-button--bordered-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-neutral{color:#333333;border-color:#333333;background-color:#ffffff}.mc-button--bordered-neutral.is-hover,.mc-button--bordered-neutral:hover{background-color:#e6e6e6;color:#333333}.mc-button--bordered-neutral.is-active,.mc-button--bordered-neutral:active{background-color:#cccccc}.mc-button--bordered-neutral:disabled,.mc-button--bordered-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-danger{color:#c61112;border-color:#c61112;background-color:#ffffff}.mc-button--bordered-danger.is-hover,.mc-button--bordered-danger:hover{background-color:#fdeaea;color:#8c0003}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger:disabled,.mc-button--bordered-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}@media screen and (min-width: 680px){.mc-button--s\\@from-m{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-m .mc-button__icon:first-child,.mc-button--s\\@from-m .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-m .mc-button__icon:first-child,.mc-button--m\\@from-m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-m{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-m .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-m .mc-button__icon:first-child,.mc-button--l\\@from-m .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-m{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-m{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-m{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1024px){.mc-button--s\\@from-l{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-l .mc-button__icon:first-child,.mc-button--s\\@from-l .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-l{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-l .mc-button__icon:first-child,.mc-button--m\\@from-l .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-l .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-l .mc-button__icon:first-child,.mc-button--l\\@from-l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-l{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-l{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-l{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{padding:0}}@media screen and (min-width: 1280px){.mc-button--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xl .mc-button__icon:first-child,.mc-button--s\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl .mc-button__icon:first-child,.mc-button--m\\@from-xl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xl .mc-button__icon:first-child,.mc-button--l\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1920px){.mc-button--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xxl .mc-button__icon:first-child,.mc-button--s\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl .mc-button__icon:first-child,.mc-button--m\\@from-xxl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xxl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xxl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xxl .mc-button__icon:first-child,.mc-button--l\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xxl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xxl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xxl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}.mc-button__icon{pointer-events:none}',this.shadowRoot.appendChild(m),o(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},P,K,r,{bordered:0,theme:1,size:2,full:3,iconmode:4,disabled:5,responsivesize:14,responsivewidth:15,type:6,loader:16},null),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),n()))}static get observedAttributes(){return["bordered","theme","size","full","iconmode","disabled","responsivesize","responsivewidth","type","loader"]}get bordered(){return this.$$.ctx[0]}set bordered(t){this.$$set({bordered:t}),n()}get theme(){return this.$$.ctx[1]}set theme(t){this.$$set({theme:t}),n()}get size(){return this.$$.ctx[2]}set size(t){this.$$set({size:t}),n()}get full(){return this.$$.ctx[3]}set full(t){this.$$set({full:t}),n()}get iconmode(){return this.$$.ctx[4]}set iconmode(t){this.$$set({iconmode:t}),n()}get disabled(){return this.$$.ctx[5]}set disabled(t){this.$$set({disabled:t}),n()}get responsivesize(){return this.$$.ctx[14]}set responsivesize(t){this.$$set({responsivesize:t}),n()}get responsivewidth(){return this.$$.ctx[15]}set responsivewidth(t){this.$$set({responsivewidth:t}),n()}get type(){return this.$$.ctx[6]}set type(t){this.$$set({type:t}),n()}get loader(){return this.$$.ctx[16]}set loader(t){this.$$set({loader:t}),n()}}export{T as default};
|
|
2
|
+
//# sourceMappingURL=ButtonSlot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonSlot.js","sources":["../../../../src/components/button/ButtonSlot.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import { createEventForwarder } from '../../utilities/EventForward';\n import Loader from '../loader/Loader.nested.svelte';\n import type {\n ButtonIconMode,\n ButtonSize,\n ButtonTheme,\n ButtonResponsiveSize,\n ButtonResponsiveWidth,\n ButtonType,\n ButtonLoader,\n } from './button.types';\n\n export let bordered = false;\n export let theme: ButtonTheme | undefined = undefined;\n export let size: ButtonSize = 'm';\n export let full = false;\n export let iconmode: ButtonIconMode | undefined;\n export let disabled = false;\n export let responsivesize: ButtonResponsiveSize = undefined;\n export let responsivewidth: ButtonResponsiveWidth = undefined;\n export let type: ButtonType = 'button';\n export let loader: string;\n\n const forwardEvents = createEventForwarder(get_current_component());\n\n $: loaderOpts = loader ? (JSON.parse(loader) as ButtonLoader) : undefined;\n $: isLoading = loaderOpts?.enabled ?? false;\n $: loaderPosition = loaderOpts?.position ?? 'left';\n $: loaderTheme = loaderOpts?.theme ?? 'primary';\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function getAppearanceClass(theme: ButtonTheme, isBordered: boolean): string {\n if (!isBordered && !theme) {\n return '';\n }\n\n const type = isBordered ? 'bordered' : 'solid';\n\n if (theme) {\n return `mc-button--${type}-${theme}`;\n }\n return `mc-button--${type}`;\n }\n\n function getClasses(\n theme: ButtonTheme,\n isBordered: boolean,\n size: ButtonSize,\n isFull: boolean,\n ): string {\n const classes = ['mc-button'];\n\n const appearanceClass = getAppearanceClass(theme, isBordered);\n if (appearanceClass) {\n classes.push(appearanceClass);\n }\n\n if (size) {\n classes.push(`mc-button--${size}`);\n }\n\n if (isFull) {\n classes.push(`mc-button--full`);\n } else {\n classes.push(`mc-button--fit`);\n }\n\n if (iconmode === 'only') {\n classes.push('mc-button--square');\n }\n\n if (responsivesize) {\n classes.push(`mc-button--${responsivesize}`);\n }\n\n if (responsivewidth) {\n classes.push(`mc-button--${responsivewidth}`);\n }\n\n return classes.join(' ');\n }\n</script>\n\n<button\n use:forwardEvents\n {type}\n class=\"{getClasses(theme, bordered, size, full)} {userClass}\"\n class:mc-button--square={iconmode === 'only'}\n {disabled}\n {...attributes}\n>\n {#if iconmode === 'left'}\n <span class=\"mc-button__icon\">\n {#if isLoading && loaderPosition === 'left'}\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n {:else}\n <slot name=\"icon\" />\n {/if}\n </span>\n {/if}\n\n {#if iconmode === 'only'}\n <span class=\"mc-button__icon\">\n {#if isLoading}\n <Loader size=\"m\" theme={loaderTheme} text=\"\" />\n {:else}\n <slot name=\"icon\" />\n {/if}\n </span>\n {:else}\n {#if isLoading && loaderPosition === 'left' && !iconmode}\n <span class=\"mc-button__icon\">\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n </span>\n {/if}\n <span class=\"mc-button__label\"><slot/></span>\n {#if isLoading && loaderPosition === 'right' && !iconmode}\n <span class=\"mc-button__icon\">\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n </span>\n {/if}\n {/if}\n\n {#if iconmode === 'right'}\n <span class=\"mc-button__icon\">\n {#if isLoading && loaderPosition === 'right'}\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n {:else}\n <slot name=\"icon\" />\n {/if}\n </span>\n {/if}\n</button>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.button';\n\n .mc-button__icon {\n pointer-events: none;\n }\n</style>\n"],"names":["ctx","insert","target","span","anchor","slot","if_block0","create_if_block_5","if_block1","create_if_block_4","create_if_block_6","if_block2","create_if_block","toggle_class","button","class","button_class_value","_a","_b","_c","bordered","$$props","theme","size","full","iconmode","disabled","responsivesize","responsivewidth","type","loader","forwardEvents","createEventForwarder","get_current_component","$$invalidate","loaderOpts","JSON","parse","undefined","isLoading","enabled","loaderPosition","position","loaderTheme","userClass","attributes","Object","assign","$$restProps","isBordered","isFull","classes","appearanceClass","getAppearanceClass","push","join"],"mappings":"0YAmGWA,EAAS,KAAuB,SAAnBA,EAAc,IAAW,+FAD7CC,EAMMC,EAAAC,EAAAC,wSAFFH,EAAmBC,EAAAG,EAAAD,2FAFKJ,EAAW,6FAAXA,EAAW,0HAgBlCM,EAAAN,EAAa,KAAmB,SAAnBA,EAAmB,MAAWA,EAAQ,IAAAO,EAAAP,GAMnDQ,EAAAR,EAAa,KAAmB,UAAnBA,EAAmB,MAAYA,EAAQ,IAAAS,EAAAT,uJADzDC,EAA4CC,EAAAC,EAAAC,8CALvCJ,EAAa,KAAmB,SAAnBA,EAAmB,MAAWA,EAAQ,8GAMnDA,EAAa,KAAmB,UAAnBA,EAAmB,MAAYA,EAA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,OAAcL,EAAA,GAAdjB,EAAiBkB,eAAAA,EAAYK,mBAA7BvB,GAAAA,uBACGiB,EAAA,GAAEO,EAAL,OAAmBP,EAAA,GAAnBhB,EAAsBiB,eAAAA,EAAYO,oBAAlCxB,EAAAA,EAA8C,4BAC3CgB,EAAA,EAAES,EAAL,OAAgBT,EAAA,GAAhBf,EAAmBgB,eAAAA,EAAYb,iBAA/BH,EAAAA,EAAwC,WACnCe,EAAA,EAAAU,EAAYvB,EAAQN,WACpB8B,EAALC,OAAAC,UAAuBC,2BACXH,EAAW9B,yCAeZ,SACPO,EACA2B,EACA1B,EACA2B,GAEM,MAAAC,GAAW,aAEXC,WArBoB9B,EAAoB2B,GACzC,IAAAA,IAAe3B,QACX,GAGH,MAAAO,EAAOoB,EAAa,WAAa,eAEnC3B,EACmB,cAAAO,KAAQP,kBAEVO,IAWGwB,CAAmB/B,EAAO2B,UAC9CG,GACFD,EAAQG,KAAKF,GAGX7B,GACF4B,EAAQG,KAAI,cAAe/B,KAGzB2B,EACFC,EAAQG,KAAI,mBAEZH,EAAQG,KAAI,kBAGG,SAAb7B,GACF0B,EAAQG,KAAK,qBAGX3B,GACFwB,EAAQG,KAAI,cAAe3B,KAGzBC,GACFuB,EAAQG,KAAI,cAAe1B,KAGtBuB,EAAQI,KAAK"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { get_current_component } from 'svelte/internal';
|
|
5
|
+
import { createEventForwarder } from '../../utilities/EventForward';
|
|
6
|
+
import Loader from '../loader/Loader.nested.svelte';
|
|
7
|
+
import type {
|
|
8
|
+
ButtonIconMode,
|
|
9
|
+
ButtonSize,
|
|
10
|
+
ButtonTheme,
|
|
11
|
+
ButtonResponsiveSize,
|
|
12
|
+
ButtonResponsiveWidth,
|
|
13
|
+
ButtonType,
|
|
14
|
+
ButtonLoader,
|
|
15
|
+
} from './button.types';
|
|
16
|
+
|
|
17
|
+
export let bordered = false;
|
|
18
|
+
export let theme: ButtonTheme | undefined = undefined;
|
|
19
|
+
export let size: ButtonSize = 'm';
|
|
20
|
+
export let full = false;
|
|
21
|
+
export let iconmode: ButtonIconMode | undefined;
|
|
22
|
+
export let disabled = false;
|
|
23
|
+
export let responsivesize: ButtonResponsiveSize = undefined;
|
|
24
|
+
export let responsivewidth: ButtonResponsiveWidth = undefined;
|
|
25
|
+
export let type: ButtonType = 'button';
|
|
26
|
+
export let loader: string;
|
|
27
|
+
|
|
28
|
+
const forwardEvents = createEventForwarder(get_current_component());
|
|
29
|
+
|
|
30
|
+
$: loaderOpts = loader ? (JSON.parse(loader) as ButtonLoader) : undefined;
|
|
31
|
+
$: isLoading = loaderOpts?.enabled ?? false;
|
|
32
|
+
$: loaderPosition = loaderOpts?.position ?? 'left';
|
|
33
|
+
$: loaderTheme = loaderOpts?.theme ?? 'primary';
|
|
34
|
+
$: userClass = $$props.class;
|
|
35
|
+
$: attributes = { ...$$restProps };
|
|
36
|
+
$: delete attributes.class;
|
|
37
|
+
|
|
38
|
+
function getAppearanceClass(theme: ButtonTheme, isBordered: boolean): string {
|
|
39
|
+
if (!isBordered && !theme) {
|
|
40
|
+
return '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const type = isBordered ? 'bordered' : 'solid';
|
|
44
|
+
|
|
45
|
+
if (theme) {
|
|
46
|
+
return `mc-button--${type}-${theme}`;
|
|
47
|
+
}
|
|
48
|
+
return `mc-button--${type}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getClasses(
|
|
52
|
+
theme: ButtonTheme,
|
|
53
|
+
isBordered: boolean,
|
|
54
|
+
size: ButtonSize,
|
|
55
|
+
isFull: boolean,
|
|
56
|
+
): string {
|
|
57
|
+
const classes = ['mc-button'];
|
|
58
|
+
|
|
59
|
+
const appearanceClass = getAppearanceClass(theme, isBordered);
|
|
60
|
+
if (appearanceClass) {
|
|
61
|
+
classes.push(appearanceClass);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (size) {
|
|
65
|
+
classes.push(`mc-button--${size}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (isFull) {
|
|
69
|
+
classes.push(`mc-button--full`);
|
|
70
|
+
} else {
|
|
71
|
+
classes.push(`mc-button--fit`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (iconmode === 'only') {
|
|
75
|
+
classes.push('mc-button--square');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (responsivesize) {
|
|
79
|
+
classes.push(`mc-button--${responsivesize}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (responsivewidth) {
|
|
83
|
+
classes.push(`mc-button--${responsivewidth}`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return classes.join(' ');
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<button
|
|
91
|
+
use:forwardEvents
|
|
92
|
+
{type}
|
|
93
|
+
class="{getClasses(theme, bordered, size, full)} {userClass}"
|
|
94
|
+
class:mc-button--square={iconmode === 'only'}
|
|
95
|
+
{disabled}
|
|
96
|
+
{...attributes}
|
|
97
|
+
>
|
|
98
|
+
{#if iconmode === 'left'}
|
|
99
|
+
<span class="mc-button__icon">
|
|
100
|
+
{#if isLoading && loaderPosition === 'left'}
|
|
101
|
+
<Loader size="s" theme={loaderTheme} text="" />
|
|
102
|
+
{:else}
|
|
103
|
+
<slot name="icon" />
|
|
104
|
+
{/if}
|
|
105
|
+
</span>
|
|
106
|
+
{/if}
|
|
107
|
+
|
|
108
|
+
{#if iconmode === 'only'}
|
|
109
|
+
<span class="mc-button__icon">
|
|
110
|
+
{#if isLoading}
|
|
111
|
+
<Loader size="m" theme={loaderTheme} text="" />
|
|
112
|
+
{:else}
|
|
113
|
+
<slot name="icon" />
|
|
114
|
+
{/if}
|
|
115
|
+
</span>
|
|
116
|
+
{:else}
|
|
117
|
+
{#if isLoading && loaderPosition === 'left' && !iconmode}
|
|
118
|
+
<span class="mc-button__icon">
|
|
119
|
+
<Loader size="s" theme={loaderTheme} text="" />
|
|
120
|
+
</span>
|
|
121
|
+
{/if}
|
|
122
|
+
<span class="mc-button__label"><slot/></span>
|
|
123
|
+
{#if isLoading && loaderPosition === 'right' && !iconmode}
|
|
124
|
+
<span class="mc-button__icon">
|
|
125
|
+
<Loader size="s" theme={loaderTheme} text="" />
|
|
126
|
+
</span>
|
|
127
|
+
{/if}
|
|
128
|
+
{/if}
|
|
129
|
+
|
|
130
|
+
{#if iconmode === 'right'}
|
|
131
|
+
<span class="mc-button__icon">
|
|
132
|
+
{#if isLoading && loaderPosition === 'right'}
|
|
133
|
+
<Loader size="s" theme={loaderTheme} text="" />
|
|
134
|
+
{:else}
|
|
135
|
+
<slot name="icon" />
|
|
136
|
+
{/if}
|
|
137
|
+
</span>
|
|
138
|
+
{/if}
|
|
139
|
+
</button>
|
|
140
|
+
|
|
141
|
+
<style lang="scss">
|
|
142
|
+
@import '@mozaic-ds/styles/settings-tools/_all-settings';
|
|
143
|
+
@import '@mozaic-ds/styles/components/c.button';
|
|
144
|
+
|
|
145
|
+
.mc-button__icon {
|
|
146
|
+
pointer-events: none;
|
|
147
|
+
}
|
|
148
|
+
</style>
|