@medyll/idae-slotui-svelte 0.35.0 → 0.37.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/dist/base/icon/Icon.svelte +1 -0
- package/dist/controls/button/Button.svelte +31 -52
- package/dist/controls/button/ButtonAction.svelte +30 -50
- package/dist/controls/button/IconButton.svelte +5 -3
- package/dist/controls/button/button.scss +29 -26
- package/dist/controls/confirm/Confirm.demo.svelte +17 -7
- package/dist/controls/confirm/Confirm.svelte +35 -21
- package/dist/controls/confirm/Confirm.svelte.d.ts +4 -0
- package/dist/controls/confirm/confirm.scss +1 -1
- package/dist/controls/confirm/types.d.ts +19 -13
- package/dist/controls/confirm/types.js +31 -21
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/slotui-css/button.css +30 -45
- package/dist/slotui-css/button.min.css +30 -45
- package/dist/slotui-css/confirm.css +1 -1
- package/dist/slotui-css/confirm.min.css +1 -1
- package/dist/slotui-css/slotui-combined.css +198 -213
- package/package.json +6 -6
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
}: ButtonProps = $props();
|
|
36
36
|
|
|
37
37
|
let startRef: HTMLDivElement | undefined = $state<HTMLDivElement | undefined>(undefined);
|
|
38
|
-
|
|
39
|
-
$inspect(startRef?.clientWidth)
|
|
38
|
+
|
|
40
39
|
</script>
|
|
41
40
|
|
|
42
41
|
<button
|
|
@@ -140,9 +139,30 @@
|
|
|
140
139
|
transition: all 0.2s ease-in-out;
|
|
141
140
|
overflow: hidden;
|
|
142
141
|
cursor: pointer;
|
|
143
|
-
align-content:
|
|
144
|
-
align-items:
|
|
142
|
+
align-content: center;
|
|
143
|
+
align-items: center;
|
|
145
144
|
background: var(--sld-button-background);
|
|
145
|
+
/* :focus {
|
|
146
|
+
outline: 1px solid var(--sld-button-focus-border-color);
|
|
147
|
+
outline-offset: 2px;
|
|
148
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
149
|
+
}
|
|
150
|
+
:focus-visible {
|
|
151
|
+
outline: 1px solid var(--sld-button-focus-border-color);
|
|
152
|
+
outline-offset: -2px;
|
|
153
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
154
|
+
}
|
|
155
|
+
:hover {
|
|
156
|
+
background-color: var(--sld-button-hover-background);
|
|
157
|
+
box-shadow: var(--sld-button-hover-shadow);
|
|
158
|
+
}
|
|
159
|
+
:active {
|
|
160
|
+
transform: translateY(1px);
|
|
161
|
+
box-shadow: var(--sld-button-active-shadow);
|
|
162
|
+
}
|
|
163
|
+
:focus:not(:focus-visible) {
|
|
164
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
165
|
+
} */
|
|
146
166
|
--preset-width: var(--sld-width-small);
|
|
147
167
|
width: var(--preset-width-small);
|
|
148
168
|
}
|
|
@@ -424,52 +444,6 @@
|
|
|
424
444
|
box-shadow: var(--sld-elevation-5);
|
|
425
445
|
}
|
|
426
446
|
|
|
427
|
-
:global(button) :focus,
|
|
428
|
-
:global(.button) :focus,
|
|
429
|
-
:global(button.button) :focus,
|
|
430
|
-
:global(input[type="button"]) :focus,
|
|
431
|
-
:global(input[type="submit"]) :focus {
|
|
432
|
-
outline: 1px solid var(--sld-button-focus-border-color);
|
|
433
|
-
outline-offset: 2px;
|
|
434
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
:global(button) :focus-visible,
|
|
438
|
-
:global(.button) :focus-visible,
|
|
439
|
-
:global(button.button) :focus-visible,
|
|
440
|
-
:global(input[type="button"]) :focus-visible,
|
|
441
|
-
:global(input[type="submit"]) :focus-visible {
|
|
442
|
-
outline: 1px solid var(--sld-button-focus-border-color);
|
|
443
|
-
outline-offset: -2px;
|
|
444
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
:global(button) :hover,
|
|
448
|
-
:global(.button) :hover,
|
|
449
|
-
:global(button.button) :hover,
|
|
450
|
-
:global(input[type="button"]) :hover,
|
|
451
|
-
:global(input[type="submit"]) :hover {
|
|
452
|
-
background-color: var(--sld-button-hover-background);
|
|
453
|
-
box-shadow: var(--sld-button-hover-shadow);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
:global(button) :active,
|
|
457
|
-
:global(.button) :active,
|
|
458
|
-
:global(button.button) :active,
|
|
459
|
-
:global(input[type="button"]) :active,
|
|
460
|
-
:global(input[type="submit"]) :active {
|
|
461
|
-
transform: translateY(1px);
|
|
462
|
-
box-shadow: var(--sld-button-active-shadow);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
:global(button) :focus:not(:focus-visible),
|
|
466
|
-
:global(.button) :focus:not(:focus-visible),
|
|
467
|
-
:global(button.button) :focus:not(:focus-visible),
|
|
468
|
-
:global(input[type="button"]) :focus:not(:focus-visible),
|
|
469
|
-
:global(input[type="submit"]) :focus:not(:focus-visible) {
|
|
470
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
447
|
:global(button) .button-start,
|
|
474
448
|
:global(.button) .button-start,
|
|
475
449
|
:global(button.button) .button-start,
|
|
@@ -481,7 +455,7 @@
|
|
|
481
455
|
max-height: 100%;
|
|
482
456
|
align-items: center;
|
|
483
457
|
align-content: center;
|
|
484
|
-
padding: 0 0.
|
|
458
|
+
padding: 0 0.5rem;
|
|
485
459
|
display: block;
|
|
486
460
|
}
|
|
487
461
|
|
|
@@ -499,13 +473,18 @@
|
|
|
499
473
|
:global(input[type="button"]) .button-central,
|
|
500
474
|
:global(input[type="submit"]) .button-central {
|
|
501
475
|
--preset-ellipsis-line: 1;
|
|
476
|
+
display: block;
|
|
502
477
|
max-width: 100%;
|
|
503
478
|
max-height: 100%;
|
|
504
479
|
flex: 1;
|
|
505
480
|
align-items: center;
|
|
506
481
|
align-content: center;
|
|
507
|
-
|
|
482
|
+
justify-content: center;
|
|
483
|
+
justify-items: center;
|
|
484
|
+
padding-left: 0.25rem;
|
|
485
|
+
padding-right: 0.25rem;
|
|
508
486
|
text-align: var(--sld-button-text-align, center);
|
|
487
|
+
overflow: hidden;
|
|
509
488
|
}
|
|
510
489
|
|
|
511
490
|
:global(button) .button-central[ellipsis], :global(button) .button-central.ellipsis,
|
|
@@ -99,9 +99,30 @@
|
|
|
99
99
|
transition: all 0.2s ease-in-out;
|
|
100
100
|
overflow: hidden;
|
|
101
101
|
cursor: pointer;
|
|
102
|
-
align-content:
|
|
103
|
-
align-items:
|
|
102
|
+
align-content: center;
|
|
103
|
+
align-items: center;
|
|
104
104
|
background: var(--sld-button-background);
|
|
105
|
+
/* :focus {
|
|
106
|
+
outline: 1px solid var(--sld-button-focus-border-color);
|
|
107
|
+
outline-offset: 2px;
|
|
108
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
109
|
+
}
|
|
110
|
+
:focus-visible {
|
|
111
|
+
outline: 1px solid var(--sld-button-focus-border-color);
|
|
112
|
+
outline-offset: -2px;
|
|
113
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
114
|
+
}
|
|
115
|
+
:hover {
|
|
116
|
+
background-color: var(--sld-button-hover-background);
|
|
117
|
+
box-shadow: var(--sld-button-hover-shadow);
|
|
118
|
+
}
|
|
119
|
+
:active {
|
|
120
|
+
transform: translateY(1px);
|
|
121
|
+
box-shadow: var(--sld-button-active-shadow);
|
|
122
|
+
}
|
|
123
|
+
:focus:not(:focus-visible) {
|
|
124
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
125
|
+
} */
|
|
105
126
|
--preset-width: var(--sld-width-small);
|
|
106
127
|
width: var(--preset-width-small);
|
|
107
128
|
}
|
|
@@ -383,52 +404,6 @@
|
|
|
383
404
|
box-shadow: var(--sld-elevation-5);
|
|
384
405
|
}
|
|
385
406
|
|
|
386
|
-
:global(button) :focus,
|
|
387
|
-
:global(.button) :focus,
|
|
388
|
-
:global(button.button) :focus,
|
|
389
|
-
:global(input[type="button"]) :focus,
|
|
390
|
-
:global(input[type="submit"]) :focus {
|
|
391
|
-
outline: 1px solid var(--sld-button-focus-border-color);
|
|
392
|
-
outline-offset: 2px;
|
|
393
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
:global(button) :focus-visible,
|
|
397
|
-
:global(.button) :focus-visible,
|
|
398
|
-
:global(button.button) :focus-visible,
|
|
399
|
-
:global(input[type="button"]) :focus-visible,
|
|
400
|
-
:global(input[type="submit"]) :focus-visible {
|
|
401
|
-
outline: 1px solid var(--sld-button-focus-border-color);
|
|
402
|
-
outline-offset: -2px;
|
|
403
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
:global(button) :hover,
|
|
407
|
-
:global(.button) :hover,
|
|
408
|
-
:global(button.button) :hover,
|
|
409
|
-
:global(input[type="button"]) :hover,
|
|
410
|
-
:global(input[type="submit"]) :hover {
|
|
411
|
-
background-color: var(--sld-button-hover-background);
|
|
412
|
-
box-shadow: var(--sld-button-hover-shadow);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
:global(button) :active,
|
|
416
|
-
:global(.button) :active,
|
|
417
|
-
:global(button.button) :active,
|
|
418
|
-
:global(input[type="button"]) :active,
|
|
419
|
-
:global(input[type="submit"]) :active {
|
|
420
|
-
transform: translateY(1px);
|
|
421
|
-
box-shadow: var(--sld-button-active-shadow);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
:global(button) :focus:not(:focus-visible),
|
|
425
|
-
:global(.button) :focus:not(:focus-visible),
|
|
426
|
-
:global(button.button) :focus:not(:focus-visible),
|
|
427
|
-
:global(input[type="button"]) :focus:not(:focus-visible),
|
|
428
|
-
:global(input[type="submit"]) :focus:not(:focus-visible) {
|
|
429
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
407
|
:global(button) .button-start,
|
|
433
408
|
:global(.button) .button-start,
|
|
434
409
|
:global(button.button) .button-start,
|
|
@@ -440,7 +415,7 @@
|
|
|
440
415
|
max-height: 100%;
|
|
441
416
|
align-items: center;
|
|
442
417
|
align-content: center;
|
|
443
|
-
padding: 0 0.
|
|
418
|
+
padding: 0 0.5rem;
|
|
444
419
|
display: block;
|
|
445
420
|
}
|
|
446
421
|
|
|
@@ -458,13 +433,18 @@
|
|
|
458
433
|
:global(input[type="button"]) .button-central,
|
|
459
434
|
:global(input[type="submit"]) .button-central {
|
|
460
435
|
--preset-ellipsis-line: 1;
|
|
436
|
+
display: block;
|
|
461
437
|
max-width: 100%;
|
|
462
438
|
max-height: 100%;
|
|
463
439
|
flex: 1;
|
|
464
440
|
align-items: center;
|
|
465
441
|
align-content: center;
|
|
466
|
-
|
|
442
|
+
justify-content: center;
|
|
443
|
+
justify-items: center;
|
|
444
|
+
padding-left: 0.25rem;
|
|
445
|
+
padding-right: 0.25rem;
|
|
467
446
|
text-align: var(--sld-button-text-align, center);
|
|
447
|
+
overflow: hidden;
|
|
468
448
|
}
|
|
469
449
|
|
|
470
450
|
:global(button) .button-central[ellipsis], :global(button) .button-central.ellipsis,
|
|
@@ -36,8 +36,10 @@
|
|
|
36
36
|
children,
|
|
37
37
|
...rest
|
|
38
38
|
}: IconButtonProps = $props();
|
|
39
|
+
|
|
40
|
+
let finalIcon = $derived(typeof icon === 'object' ? {...icon,iconSize:iconFontSize} : {icon,iconSize:iconFontSize});
|
|
39
41
|
</script>
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
<Icon style="display:
|
|
43
|
-
</Button>
|
|
43
|
+
<Button variant="square" bind:element width={size} tall="unset" {ratio} {...rest}>
|
|
44
|
+
<Icon style="display:inline; " {rotation} icon={finalIcon} />
|
|
45
|
+
</Button>
|
|
@@ -55,34 +55,32 @@
|
|
|
55
55
|
overflow: hidden;
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
|
|
58
|
-
align-content:
|
|
59
|
-
align-items:
|
|
58
|
+
align-content: center;
|
|
59
|
+
align-items: center;
|
|
60
60
|
|
|
61
61
|
background: var(--sld-button-background);
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
:focus
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
:focus-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
:hover
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
:
|
|
79
|
-
|
|
80
|
-
box-shadow: var(--sld-button-active-shadow);
|
|
81
|
-
}
|
|
82
|
-
:focus:not(:focus-visible) {
|
|
83
|
-
box-shadow: var(--sld-button-focus-shadow);
|
|
84
|
-
}
|
|
63
|
+
/* :focus {
|
|
64
|
+
outline: 1px solid var(--sld-button-focus-border-color);
|
|
65
|
+
outline-offset: 2px;
|
|
66
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
67
|
+
}
|
|
68
|
+
:focus-visible {
|
|
69
|
+
outline: 1px solid var(--sld-button-focus-border-color);
|
|
70
|
+
outline-offset: -2px;
|
|
71
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
72
|
+
}
|
|
73
|
+
:hover {
|
|
74
|
+
background-color: var(--sld-button-hover-background);
|
|
75
|
+
box-shadow: var(--sld-button-hover-shadow);
|
|
76
|
+
}
|
|
77
|
+
:active {
|
|
78
|
+
transform: translateY(1px);
|
|
79
|
+
box-shadow: var(--sld-button-active-shadow);
|
|
85
80
|
}
|
|
81
|
+
:focus:not(:focus-visible) {
|
|
82
|
+
box-shadow: var(--sld-button-focus-shadow);
|
|
83
|
+
} */
|
|
86
84
|
|
|
87
85
|
.button-start {
|
|
88
86
|
position: relative;
|
|
@@ -91,7 +89,7 @@
|
|
|
91
89
|
max-height: 100%;
|
|
92
90
|
align-items: center;
|
|
93
91
|
align-content: center;
|
|
94
|
-
padding: 0 0.
|
|
92
|
+
padding: 0 0.5rem;
|
|
95
93
|
display: block;
|
|
96
94
|
&:empty {
|
|
97
95
|
display: none;
|
|
@@ -100,13 +98,18 @@
|
|
|
100
98
|
|
|
101
99
|
.button-central {
|
|
102
100
|
@include ui-ellipsises-presets;
|
|
101
|
+
display: block;
|
|
103
102
|
max-width: 100%;
|
|
104
103
|
max-height: 100%;
|
|
105
104
|
flex: 1;
|
|
106
105
|
align-items: center;
|
|
107
106
|
align-content: center;
|
|
108
|
-
|
|
107
|
+
justify-content: center;
|
|
108
|
+
justify-items: center;
|
|
109
|
+
padding-left: 0.25rem; //calc(var(--content-padding, 0.25rem) / 2);
|
|
110
|
+
padding-right: 0.25rem; //calc(var(--content-padding, 0.25rem) / 2);
|
|
109
111
|
text-align: var(--sld-button-text-align, center);
|
|
112
|
+
overflow: hidden;
|
|
110
113
|
&:empty {
|
|
111
114
|
display: none;
|
|
112
115
|
}
|
|
@@ -16,8 +16,15 @@
|
|
|
16
16
|
</Confirm>`;
|
|
17
17
|
|
|
18
18
|
let codeProps = `
|
|
19
|
-
<Confirm
|
|
20
|
-
|
|
19
|
+
<Confirm
|
|
20
|
+
buttonInitial={{
|
|
21
|
+
icon: {icon:'fa-solid:question', size:'auto',color:'green'},
|
|
22
|
+
value: 'Would you please click me once ?',
|
|
23
|
+
ellipsis: true
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<Button type="submit" icon="fa-solid:check" >confirm</Button>
|
|
27
|
+
</Confirm>`;
|
|
21
28
|
</script>
|
|
22
29
|
|
|
23
30
|
<ComponentDemo
|
|
@@ -30,11 +37,14 @@ V.Hugo 1850"
|
|
|
30
37
|
<DemoPage component="Chipper" code={codeSlot}>
|
|
31
38
|
<Demoer {parameters} {componentArgs}>
|
|
32
39
|
{#snippet children({ activeParams })}
|
|
33
|
-
<Confirm {...activeParams}
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
<Confirm {...activeParams}
|
|
41
|
+
buttonInitial={{
|
|
42
|
+
icon: {icon:'fa-solid:question', size:'auto',color:'green'},
|
|
43
|
+
value: 'Would you please click me once ?',
|
|
44
|
+
ellipsis: true
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<Button type="submit" icon="fa-solid:check" >confirm</Button>
|
|
38
48
|
</Confirm>
|
|
39
49
|
{/snippet}
|
|
40
50
|
</Demoer>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script lang="ts" generics="T=any">
|
|
2
2
|
import { fade } from 'svelte/transition';
|
|
3
3
|
import Button from '../button/Button.svelte';
|
|
4
|
-
import IconButton from '../button/IconButton.svelte';
|
|
5
4
|
import { onDestroy } from 'svelte';
|
|
6
5
|
import Slotted from '../../utils/slotted/Slotted.svelte';
|
|
7
6
|
import type { ConfirmProps } from './types.js';
|
|
8
7
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
9
8
|
|
|
10
|
-
let step: string = $state('initial');
|
|
9
|
+
let step: string = $state('initial');
|
|
11
10
|
|
|
12
11
|
let {
|
|
13
12
|
class: className = '',
|
|
@@ -26,7 +25,11 @@
|
|
|
26
25
|
loading,
|
|
27
26
|
data,
|
|
28
27
|
action = () => {},
|
|
29
|
-
iconCancel = { icon: '
|
|
28
|
+
iconCancel = { icon: 'mdi:cancel-bold', color: 'red',iconSize:'large' },
|
|
29
|
+
variant,
|
|
30
|
+
buttonInitial,
|
|
31
|
+
buttonConfirm,
|
|
32
|
+
buttonCancel,
|
|
30
33
|
children,
|
|
31
34
|
confirmInitial,
|
|
32
35
|
...rest
|
|
@@ -87,8 +90,7 @@
|
|
|
87
90
|
});
|
|
88
91
|
</script>
|
|
89
92
|
|
|
90
|
-
<!-- #todo <Content>somecontent</Content> -->
|
|
91
|
-
|
|
93
|
+
<!-- #todo <Content>somecontent</Content> -->
|
|
92
94
|
<div {...rost} class="confirm {className}">
|
|
93
95
|
{#if step === 'initial'}
|
|
94
96
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
@@ -101,48 +103,60 @@
|
|
|
101
103
|
title={tooltipInitial}
|
|
102
104
|
>
|
|
103
105
|
<Slotted child={confirmInitial} slotArgs={{ step }}>
|
|
106
|
+
{#if buttonInitial}
|
|
107
|
+
<Button {tall} {variant} {...buttonInitial} />
|
|
108
|
+
{:else}
|
|
104
109
|
<Button
|
|
105
110
|
{tall}
|
|
106
|
-
variant=
|
|
111
|
+
variant= {variant}
|
|
107
112
|
width="full"
|
|
108
113
|
icon={{ icon: iconInitial, color: iconColorInitial }}
|
|
109
114
|
title={tooltipInitial}
|
|
110
115
|
>
|
|
111
|
-
{primaryInitial}
|
|
116
|
+
{primaryInitial}
|
|
112
117
|
</Button>
|
|
118
|
+
{/if}
|
|
113
119
|
</Slotted>
|
|
114
120
|
</div>
|
|
115
121
|
{/if}
|
|
116
122
|
{#if step === 'confirm'}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
{#if buttonCancel}
|
|
124
|
+
<Button {tall} {...buttonCancel} onclick={(event:any)=>{handleClickCancel(event);buttonCancel?.onclick?.(event)}} />
|
|
125
|
+
{:else}
|
|
126
|
+
<Button
|
|
127
|
+
onclick={handleClickCancel}
|
|
128
|
+
variant= {'naked'}
|
|
129
|
+
icon={iconCancel}
|
|
130
|
+
{tall}
|
|
131
|
+
title="cancel"
|
|
132
|
+
value="cancel"
|
|
133
|
+
width="auto"
|
|
134
|
+
/>
|
|
135
|
+
{/if}
|
|
136
|
+
<div class={className + ' confirm-validate'} in:fade|global bind:this={contentRef}>
|
|
127
137
|
<Slotted child={children} slotArgs={{ step }}>
|
|
128
|
-
|
|
138
|
+
{#if buttonConfirm}
|
|
139
|
+
<Button {tall} {variant} {...buttonConfirm} onclick={(event:any)=>{handleAction(event);buttonConfirm?.onclick?.(event)}} />
|
|
140
|
+
{:else}
|
|
141
|
+
<Button
|
|
129
142
|
title="confirm"
|
|
130
143
|
loading={loadingState}
|
|
131
144
|
{tall}
|
|
132
145
|
onclick={handleAction}
|
|
133
|
-
{icon}
|
|
134
|
-
|
|
146
|
+
{icon}
|
|
147
|
+
variant= {variant}
|
|
135
148
|
value={primaryConfirm}
|
|
136
149
|
/>
|
|
150
|
+
{/if}
|
|
137
151
|
</Slotted>
|
|
138
152
|
</div>
|
|
139
153
|
{/if}
|
|
140
154
|
</div>
|
|
141
155
|
|
|
142
156
|
<style>.confirm {
|
|
143
|
-
display: contents;
|
|
144
157
|
display: flex;
|
|
145
158
|
align-items: center;
|
|
159
|
+
gap: 0.5rem;
|
|
146
160
|
}
|
|
147
161
|
.confirm-validate {
|
|
148
162
|
display: flex;
|
|
@@ -11,6 +11,7 @@ declare class __sveltets_Render<T = any> {
|
|
|
11
11
|
primary?: string;
|
|
12
12
|
icon?: import("../../types/index.js").ElementProps["icon"];
|
|
13
13
|
tall?: import("../../types/index.js").ElementProps["tall"];
|
|
14
|
+
variant: import("../../types/index.js").ElementProps["buttonVariant"];
|
|
14
15
|
iconColor?: string;
|
|
15
16
|
iconSize?: string;
|
|
16
17
|
autoClose?: boolean;
|
|
@@ -18,6 +19,9 @@ declare class __sveltets_Render<T = any> {
|
|
|
18
19
|
iconLoading?: import("../../types/index.js").ElementProps["icon"];
|
|
19
20
|
action?: Promise<T> | ((data?: T | undefined) => void) | undefined;
|
|
20
21
|
iconCancel?: import("../../types/index.js").ElementProps["icon"];
|
|
22
|
+
buttonInitial?: import("../button/types.js").ButtonProps;
|
|
23
|
+
buttonConfirm?: import("../button/types.js").ButtonProps;
|
|
24
|
+
buttonCancel?: import("../button/types.js").ButtonProps;
|
|
21
25
|
children?: import("svelte").Snippet;
|
|
22
26
|
confirmInitial?: import("svelte").Snippet;
|
|
23
27
|
} & Partial<Omit<HTMLDivElement, "style">>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { DemoerStoryProps } from
|
|
2
|
-
import { type CommonProps, type ElementProps } from
|
|
3
|
-
import type { Snippet } from
|
|
1
|
+
import type { DemoerStoryProps } from "../../base/demoer/types.js";
|
|
2
|
+
import { type CommonProps, type ElementProps } from "../../types/index.js";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { ButtonProps } from "../button/types.js";
|
|
4
5
|
export type ConfirmProps<T = any> = CommonProps & {
|
|
5
6
|
/** element data sent on confirm */
|
|
6
7
|
data?: T;
|
|
@@ -8,22 +9,24 @@ export type ConfirmProps<T = any> = CommonProps & {
|
|
|
8
9
|
initialRef?: HTMLElement | null;
|
|
9
10
|
/** element confirm HTMLDivElement props */
|
|
10
11
|
contentRef?: HTMLElement | null;
|
|
11
|
-
/** text displayed on initial button */
|
|
12
|
+
/** @deprecated text displayed on initial button */
|
|
12
13
|
tooltipInitial?: string | null;
|
|
13
|
-
/** text displayed on initial button */
|
|
14
|
+
/** @deprecated text displayed on initial button */
|
|
14
15
|
primaryInitial: string;
|
|
15
|
-
/** text displayed on the confirm phase */
|
|
16
|
+
/** @deprecated text displayed on the confirm phase */
|
|
16
17
|
primaryConfirm: string;
|
|
17
|
-
/** icon displayed on the initial button */
|
|
18
|
+
/** @deprecated icon displayed on the initial button */
|
|
18
19
|
iconInitial?: string;
|
|
19
|
-
/** color of the icon displayed on the initial button */
|
|
20
|
+
/** @deprecated color of the icon displayed on the initial button */
|
|
20
21
|
iconColorInitial?: string;
|
|
21
22
|
/** text displayed on confirm button */
|
|
22
23
|
primary?: string;
|
|
23
24
|
/** icon displayed on the confirm button */
|
|
24
|
-
icon?: ElementProps[
|
|
25
|
+
icon?: ElementProps["icon"];
|
|
25
26
|
/** button height */
|
|
26
|
-
tall?: ElementProps[
|
|
27
|
+
tall?: ElementProps["tall"];
|
|
28
|
+
/** variant for buttons */
|
|
29
|
+
variant: ElementProps["buttonVariant"];
|
|
27
30
|
/** color of the icon displayed on the confirm button
|
|
28
31
|
* @type string
|
|
29
32
|
*/
|
|
@@ -32,11 +35,14 @@ export type ConfirmProps<T = any> = CommonProps & {
|
|
|
32
35
|
autoClose?: boolean;
|
|
33
36
|
/** loading state on validate */
|
|
34
37
|
loading?: boolean;
|
|
35
|
-
iconLoading?: ElementProps[
|
|
38
|
+
iconLoading?: ElementProps["icon"];
|
|
36
39
|
/** action initiated on confirmation */
|
|
37
40
|
action?: Promise<T> | ((data?: T) => void);
|
|
38
|
-
/** icon to display for back action */
|
|
39
|
-
iconCancel?: ElementProps[
|
|
41
|
+
/** @deprecated icon to display for back action */
|
|
42
|
+
iconCancel?: ElementProps["icon"];
|
|
43
|
+
buttonInitial?: ButtonProps;
|
|
44
|
+
buttonConfirm?: ButtonProps;
|
|
45
|
+
buttonCancel?: ButtonProps;
|
|
40
46
|
children?: Snippet;
|
|
41
47
|
confirmInitial?: Snippet;
|
|
42
48
|
};
|
|
@@ -1,39 +1,49 @@
|
|
|
1
|
-
import { demoerArgs } from
|
|
2
|
-
import { iconSize } from
|
|
1
|
+
import { demoerArgs } from "../../base/demoer/demoer.utils.js";
|
|
2
|
+
import { buttonVariant, iconSize, tallPreset, } from "../../types/index.js";
|
|
3
3
|
export const ConfirmDemoValues = {
|
|
4
4
|
primaryInitial: {
|
|
5
|
-
type:
|
|
6
|
-
values: [
|
|
7
|
-
private: true
|
|
5
|
+
type: "string",
|
|
6
|
+
values: ["Would you please click once ?"],
|
|
7
|
+
private: true,
|
|
8
8
|
},
|
|
9
9
|
tooltipInitial: {
|
|
10
|
-
type:
|
|
11
|
-
values: [
|
|
12
|
-
private: true
|
|
10
|
+
type: "string",
|
|
11
|
+
values: ["Would you please click once ?"],
|
|
12
|
+
private: true,
|
|
13
13
|
},
|
|
14
14
|
iconInitial: {
|
|
15
|
-
type:
|
|
16
|
-
values: [
|
|
15
|
+
type: "icon",
|
|
16
|
+
values: ["fa-solid:question"],
|
|
17
17
|
},
|
|
18
18
|
iconColorInitial: {
|
|
19
|
-
type:
|
|
20
|
-
values: [
|
|
19
|
+
type: "color",
|
|
20
|
+
values: ["green", "blue", undefined],
|
|
21
21
|
},
|
|
22
22
|
primary: {
|
|
23
|
-
type:
|
|
24
|
-
values: [
|
|
23
|
+
type: "icon",
|
|
24
|
+
values: ["Confirm deletion"],
|
|
25
25
|
},
|
|
26
26
|
icon: {
|
|
27
|
-
type:
|
|
28
|
-
values: [
|
|
27
|
+
type: "icon",
|
|
28
|
+
values: ["mdi:close", undefined],
|
|
29
29
|
},
|
|
30
30
|
iconColor: {
|
|
31
|
-
type:
|
|
32
|
-
values: [
|
|
31
|
+
type: "color",
|
|
32
|
+
values: ["red", "orange", undefined],
|
|
33
33
|
},
|
|
34
34
|
iconSize: {
|
|
35
|
-
type:
|
|
36
|
-
default: iconSize.medium
|
|
37
|
-
}
|
|
35
|
+
type: "iconSize",
|
|
36
|
+
default: iconSize.medium,
|
|
37
|
+
},
|
|
38
|
+
tall: {
|
|
39
|
+
type: "tall",
|
|
40
|
+
values: Object.values(tallPreset),
|
|
41
|
+
default: tallPreset.default,
|
|
42
|
+
},
|
|
43
|
+
variant: {
|
|
44
|
+
type: "buttonVariant",
|
|
45
|
+
values: Object.values(buttonVariant),
|
|
46
|
+
default: buttonVariant.contained,
|
|
47
|
+
},
|
|
38
48
|
};
|
|
39
49
|
export let { parameters, componentArgs } = demoerArgs(ConfirmDemoValues);
|