@finsweet/webflow-apps-utils 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/providers/GlobalProvider.mdx +322 -0
- package/dist/providers/GlobalProvider.svelte +58 -0
- package/dist/providers/GlobalProvider.svelte.d.ts +4 -0
- package/dist/providers/configuratorUtils.d.ts +37 -0
- package/dist/providers/configuratorUtils.js +219 -0
- package/dist/providers/globalContext.svelte.d.ts +18 -0
- package/dist/providers/globalContext.svelte.js +439 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.js +7 -0
- package/dist/providers/types.d.ts +103 -0
- package/dist/providers/types.js +6 -0
- package/dist/router/README.md +2 -2
- package/dist/stores/index.d.ts +0 -1
- package/dist/stores/index.js +0 -1
- package/dist/types/webflow.d.ts +31 -47
- package/dist/ui/components/LoadingScreen.svelte +2 -1
- package/dist/ui/components/button/Button.svelte +1 -1
- package/dist/ui/components/button-group/ButtonGroup.stories.js +112 -0
- package/dist/ui/components/{ButtonGroup.svelte → button-group/ButtonGroup.svelte} +20 -33
- package/dist/ui/components/button-group/ButtonGroup.svelte.d.ts +13 -0
- package/dist/ui/components/button-group/index.d.ts +2 -0
- package/dist/ui/components/button-group/index.js +1 -0
- package/dist/ui/components/button-group/types.d.ts +32 -0
- package/dist/ui/components/checkbox/Checkbox.stories.d.ts +55 -0
- package/dist/ui/components/checkbox/Checkbox.stories.js +162 -0
- package/dist/ui/components/checkbox/Checkbox.svelte +141 -0
- package/dist/ui/components/checkbox/Checkbox.svelte.d.ts +4 -0
- package/dist/ui/components/checkbox/index.d.ts +2 -0
- package/dist/ui/components/checkbox/index.js +1 -0
- package/dist/ui/components/checkbox/types.d.ts +32 -0
- package/dist/ui/components/controlled-buttons/ControlledButtons.stories.d.ts +32 -0
- package/dist/ui/components/controlled-buttons/ControlledButtons.stories.js +152 -0
- package/dist/ui/components/{buttons/FooterButton.svelte → controlled-buttons/ControlledButtons.svelte} +18 -67
- package/dist/ui/components/controlled-buttons/ControlledButtons.svelte.d.ts +4 -0
- package/dist/ui/components/controlled-buttons/index.d.ts +2 -0
- package/dist/ui/components/controlled-buttons/index.js +1 -0
- package/dist/ui/components/{buttons → controlled-buttons}/types.d.ts +11 -4
- package/dist/ui/components/divider/Divider.stories.svelte +134 -0
- package/dist/ui/components/{clickable/Clickable.stories.svelte.d.ts → divider/Divider.stories.svelte.d.ts} +4 -4
- package/dist/ui/components/divider/Divider.svelte +30 -0
- package/dist/ui/components/divider/Divider.svelte.d.ts +4 -0
- package/dist/ui/components/divider/index.d.ts +2 -0
- package/dist/ui/components/divider/index.js +1 -0
- package/dist/ui/components/divider/types.d.ts +23 -0
- package/dist/ui/components/divider/types.js +1 -0
- package/dist/ui/components/iframe/Iframe.stories.svelte +122 -0
- package/dist/ui/components/{ToggleItem.svelte.d.ts → iframe/Iframe.stories.svelte.d.ts} +7 -8
- package/dist/ui/components/iframe/Iframe.svelte +75 -0
- package/dist/ui/components/iframe/Iframe.svelte.d.ts +4 -0
- package/dist/ui/components/iframe/index.d.ts +2 -0
- package/dist/ui/components/iframe/index.js +1 -0
- package/dist/ui/components/iframe/types.d.ts +38 -0
- package/dist/ui/components/iframe/types.js +1 -0
- package/dist/ui/components/index.d.ts +12 -39
- package/dist/ui/components/index.js +12 -39
- package/dist/ui/components/input/Input.stories.d.ts +24 -0
- package/dist/ui/components/input/Input.stories.js +98 -0
- package/dist/ui/components/input/Input.svelte +321 -80
- package/dist/ui/components/input/types.d.ts +27 -1
- package/dist/ui/components/layout/Layout.stories.svelte +3 -3
- package/dist/ui/components/layout/Layout.svelte +3 -5
- package/dist/ui/components/layout/common/EditModeMessage.svelte +24 -12
- package/dist/ui/components/layout/{ExampleLayout.svelte → examples/ExampleLayout.svelte} +34 -22
- package/dist/ui/components/layout/examples/Wrapper.svelte +9 -0
- package/dist/ui/components/{NoSettingsNeeded.svelte.d.ts → layout/examples/Wrapper.svelte.d.ts} +3 -3
- package/dist/ui/components/layout/examples/index.d.ts +2 -0
- package/dist/ui/components/layout/examples/index.js +2 -0
- package/dist/ui/components/layout/index.d.ts +2 -1
- package/dist/ui/components/layout/index.js +2 -1
- package/dist/ui/components/modal/Example.svelte +320 -0
- package/dist/ui/components/modal/Example.svelte.d.ts +3 -0
- package/dist/ui/components/modal/Modal.stories.svelte +18 -0
- package/dist/ui/components/modal/Modal.stories.svelte.d.ts +26 -0
- package/dist/ui/components/modal/Modal.svelte +490 -0
- package/dist/ui/components/modal/Modal.svelte.d.ts +130 -0
- package/dist/ui/components/modal/index.d.ts +2 -0
- package/dist/ui/components/modal/index.js +1 -0
- package/dist/ui/components/modal/types.d.ts +75 -0
- package/dist/ui/components/modal/types.js +1 -0
- package/dist/ui/components/notification/Notification.stories.svelte +228 -0
- package/dist/ui/components/{ToggleList.svelte.d.ts → notification/Notification.stories.svelte.d.ts} +9 -21
- package/dist/ui/components/notification/Notification.svelte +289 -0
- package/dist/ui/components/notification/Notification.svelte.d.ts +67 -0
- package/dist/ui/components/notification/index.d.ts +2 -0
- package/dist/ui/components/notification/index.js +1 -0
- package/dist/ui/components/notification/types.d.ts +68 -0
- package/dist/ui/components/notification/types.js +1 -0
- package/dist/ui/components/section/Section.stories.svelte +263 -0
- package/dist/ui/components/section/Section.stories.svelte.d.ts +27 -0
- package/dist/ui/components/section/Section.svelte +324 -0
- package/dist/ui/components/section/Section.svelte.d.ts +5 -0
- package/dist/ui/components/section/index.d.ts +2 -0
- package/dist/ui/components/section/index.js +1 -0
- package/dist/ui/components/section/types.d.ts +106 -0
- package/dist/ui/components/section/types.js +1 -0
- package/dist/ui/components/{ImageUpload.svelte → shared/ImageUpload.svelte} +3 -3
- package/dist/ui/components/{SelectBodyOrDivBlock.svelte → shared/SelectBodyOrDivBlock.svelte} +1 -1
- package/dist/ui/components/shared/index.d.ts +2 -0
- package/dist/ui/components/shared/index.js +2 -0
- package/dist/ui/index.css +33 -5
- package/dist/utils/api/checkIfAppModeIsDesign.d.ts +1 -2
- package/dist/utils/api/checkIfAppModeIsDesign.js +1 -2
- package/dist/utils/api/clipboard/handlePaste.d.ts +6 -37
- package/dist/utils/api/clipboard/handlePaste.js +2 -6
- package/dist/utils/api/getAllAssets.d.ts +1 -2
- package/dist/utils/api/getAllAssets.js +1 -2
- package/dist/utils/api/getFinsweetComponentsEnvironment.d.ts +1 -2
- package/dist/utils/api/getFinsweetComponentsEnvironment.js +3 -6
- package/dist/utils/api/index.d.ts +0 -1
- package/dist/utils/api/index.js +0 -1
- package/dist/utils/api/insertWithXSCP.d.ts +1 -2
- package/dist/utils/api/insertWithXSCP.js +1 -2
- package/dist/utils/auth/crossWindowLogin.d.ts +3 -0
- package/dist/utils/auth/crossWindowLogin.js +3 -0
- package/dist/utils/auth/index.d.ts +9 -25
- package/dist/utils/auth/index.js +9 -25
- package/dist/utils/browser-storage/localStorage.d.ts +4 -12
- package/dist/utils/browser-storage/localStorage.js +4 -12
- package/dist/utils/browser-storage/sessionStorage.d.ts +4 -12
- package/dist/utils/browser-storage/sessionStorage.js +4 -12
- package/dist/utils/custom-code/api.d.ts +3 -7
- package/dist/utils/custom-code/api.js +3 -7
- package/dist/utils/helpers/cleanupTooltipMessage.d.ts +1 -2
- package/dist/utils/helpers/cleanupTooltipMessage.js +1 -2
- package/dist/utils/helpers/goto.d.ts +1 -4
- package/dist/utils/helpers/goto.js +2 -7
- package/dist/utils/helpers/index.d.ts +1 -0
- package/dist/utils/helpers/index.js +1 -0
- package/dist/utils/helpers/noop.d.ts +1 -1
- package/dist/utils/helpers/noop.js +1 -1
- package/dist/utils/helpers/numbers.d.ts +4 -14
- package/dist/utils/helpers/numbers.js +4 -14
- package/dist/utils/helpers/objectsToModuleExports.d.ts +1 -3
- package/dist/utils/helpers/objectsToModuleExports.js +1 -3
- package/dist/utils/helpers/trimText.d.ts +1 -8
- package/dist/utils/helpers/trimText.js +1 -8
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/logger/index.d.ts +0 -2
- package/dist/utils/logger/index.js +0 -2
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.d.ts +1 -3
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.js +1 -3
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.d.ts +1 -5
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.js +1 -5
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.d.ts +1 -4
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.js +1 -4
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.d.ts +1 -3
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.js +1 -3
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.d.ts +1 -4
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.js +1 -4
- package/dist/utils/webflow-canvas/attributes/setStyles.d.ts +1 -3
- package/dist/utils/webflow-canvas/attributes/setStyles.js +1 -3
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.d.ts +1 -8
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.js +1 -13
- package/dist/utils/webflow-canvas/findInstanceElement.d.ts +0 -6
- package/dist/utils/webflow-canvas/findInstanceElement.js +1 -7
- package/dist/utils/webflow-canvas/getAllPages.d.ts +3 -10
- package/dist/utils/webflow-canvas/getAllPages.js +3 -10
- package/dist/utils/webflow-canvas/getSiteStagingUrl.d.ts +1 -4
- package/dist/utils/webflow-canvas/getSiteStagingUrl.js +1 -4
- package/dist/utils/webflow-canvas/index.d.ts +1 -0
- package/dist/utils/webflow-canvas/index.js +1 -0
- package/package.json +9 -2
- package/dist/stores/globalStore.d.ts +0 -10
- package/dist/stores/globalStore.js +0 -10
- package/dist/ui/components/ButtonGroup.svelte.d.ts +0 -28
- package/dist/ui/components/Checkbox.svelte +0 -94
- package/dist/ui/components/Checkbox.svelte.d.ts +0 -36
- package/dist/ui/components/Copy.svelte +0 -329
- package/dist/ui/components/Copy.svelte.d.ts +0 -35
- package/dist/ui/components/CustomModal.svelte +0 -192
- package/dist/ui/components/CustomModal.svelte.d.ts +0 -45
- package/dist/ui/components/DisableInEditMode.svelte +0 -66
- package/dist/ui/components/DisableInEditMode.svelte.d.ts +0 -33
- package/dist/ui/components/Divider.svelte +0 -31
- package/dist/ui/components/Divider.svelte.d.ts +0 -31
- package/dist/ui/components/Header.svelte +0 -30
- package/dist/ui/components/Header.svelte.d.ts +0 -20
- package/dist/ui/components/Iframe.svelte +0 -89
- package/dist/ui/components/Iframe.svelte.d.ts +0 -40
- package/dist/ui/components/InjectComponent.svelte +0 -297
- package/dist/ui/components/InjectComponent.svelte.d.ts +0 -27
- package/dist/ui/components/Modal.svelte +0 -139
- package/dist/ui/components/Modal.svelte.d.ts +0 -42
- package/dist/ui/components/Navbar.svelte +0 -132
- package/dist/ui/components/Navbar.svelte.d.ts +0 -29
- package/dist/ui/components/NoSettingsNeeded.svelte +0 -31
- package/dist/ui/components/Notification.svelte +0 -193
- package/dist/ui/components/Notification.svelte.d.ts +0 -64
- package/dist/ui/components/PlusMinusButton.svelte +0 -91
- package/dist/ui/components/PlusMinusButton.svelte.d.ts +0 -22
- package/dist/ui/components/PreviewBar.svelte +0 -40
- package/dist/ui/components/PreviewBar.svelte.d.ts +0 -20
- package/dist/ui/components/ScrollableContent.svelte +0 -18
- package/dist/ui/components/ScrollableContent.svelte.d.ts +0 -31
- package/dist/ui/components/Section.svelte +0 -97
- package/dist/ui/components/Section.svelte.d.ts +0 -50
- package/dist/ui/components/Spacer.svelte +0 -9
- package/dist/ui/components/Spacer.svelte.d.ts +0 -22
- package/dist/ui/components/SpinnerPlusMinus.svelte +0 -75
- package/dist/ui/components/SpinnerPlusMinus.svelte.d.ts +0 -23
- package/dist/ui/components/SpinnerUpDown.svelte +0 -194
- package/dist/ui/components/SpinnerUpDown.svelte.d.ts +0 -31
- package/dist/ui/components/Tabs.svelte +0 -71
- package/dist/ui/components/Tabs.svelte.d.ts +0 -26
- package/dist/ui/components/ToggleItem.svelte +0 -29
- package/dist/ui/components/ToggleList.svelte +0 -57
- package/dist/ui/components/buttons/FooterButton.svelte.d.ts +0 -10
- package/dist/ui/components/buttons/index.d.ts +0 -5
- package/dist/ui/components/buttons/index.js +0 -5
- package/dist/ui/components/clickable/Clickable.stories.svelte +0 -213
- package/dist/ui/components/clickable/Clickable.svelte +0 -93
- package/dist/ui/components/clickable/Clickable.svelte.d.ts +0 -4
- package/dist/ui/components/clickable/index.d.ts +0 -2
- package/dist/ui/components/clickable/index.js +0 -1
- package/dist/ui/components/clickable/types.d.ts +0 -17
- package/dist/utils/api/copyPaste/index.d.ts +0 -18
- /package/dist/ui/components/{buttons → button-group}/types.js +0 -0
- /package/dist/ui/components/{clickable → checkbox}/types.js +0 -0
- /package/dist/{utils/api/copyPaste/index.js → ui/components/controlled-buttons/types.js} +0 -0
- /package/dist/ui/components/layout/{ExampleLayout.svelte.d.ts → examples/ExampleLayout.svelte.d.ts} +0 -0
- /package/dist/ui/components/{ImageUpload.svelte.d.ts → shared/ImageUpload.svelte.d.ts} +0 -0
- /package/dist/ui/components/{SelectBodyOrDivBlock.svelte.d.ts → shared/SelectBodyOrDivBlock.svelte.d.ts} +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
//TODO
|
|
3
|
-
// - add min/max values
|
|
4
|
-
|
|
5
|
-
import { createEventDispatcher } from 'svelte';
|
|
6
|
-
|
|
7
|
-
import PlusMinusButton from './PlusMinusButton.svelte';
|
|
8
|
-
|
|
9
|
-
export let label = 'label';
|
|
10
|
-
export let counter = 0;
|
|
11
|
-
|
|
12
|
-
const dispatch = createEventDispatcher<{
|
|
13
|
-
counterChange: number;
|
|
14
|
-
}>();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class="flex-vertical align-center">
|
|
18
|
-
<div class="input_grid">
|
|
19
|
-
<PlusMinusButton
|
|
20
|
-
on:click={(e) => {
|
|
21
|
-
counter = counter + e.detail; //e.detail is -1
|
|
22
|
-
dispatch('counterChange', counter);
|
|
23
|
-
}}
|
|
24
|
-
delta={-1}
|
|
25
|
-
/>
|
|
26
|
-
<input
|
|
27
|
-
type="number"
|
|
28
|
-
min="0"
|
|
29
|
-
class="input_field"
|
|
30
|
-
bind:value={counter}
|
|
31
|
-
on:input={() => {
|
|
32
|
-
dispatch('counterChange', counter);
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
<PlusMinusButton
|
|
36
|
-
on:click={(e) => {
|
|
37
|
-
counter = counter + e.detail; //e.detail is +1
|
|
38
|
-
dispatch('counterChange', counter);
|
|
39
|
-
}}
|
|
40
|
-
delta={1}
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
<div class="tiny-label">{label}</div>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<style>
|
|
47
|
-
.input_grid {
|
|
48
|
-
position: relative;
|
|
49
|
-
flex-basis: 100%;
|
|
50
|
-
display: grid;
|
|
51
|
-
grid-auto-flow: column;
|
|
52
|
-
grid-auto-columns: 1fr;
|
|
53
|
-
column-gap: 1px;
|
|
54
|
-
background: var(--border2);
|
|
55
|
-
border-radius: 4px;
|
|
56
|
-
box-shadow: var(--border2) 0px 0px 0px 1px inset;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.input_field {
|
|
60
|
-
-webkit-box-align: center;
|
|
61
|
-
align-items: center;
|
|
62
|
-
color: var(--text1);
|
|
63
|
-
font-size: var(--font-size-small);
|
|
64
|
-
max-width: 1.5rem;
|
|
65
|
-
background-color: var(--background5);
|
|
66
|
-
border-top: 1px solid var(--border2);
|
|
67
|
-
border-bottom: 1px solid var(--border2);
|
|
68
|
-
display: flex;
|
|
69
|
-
-webkit-box-pack: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
height: 24px;
|
|
72
|
-
opacity: 1;
|
|
73
|
-
text-align: center;
|
|
74
|
-
}
|
|
75
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const SpinnerPlusMinus: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
label?: string;
|
|
16
|
-
counter?: number;
|
|
17
|
-
}, {
|
|
18
|
-
counterChange: CustomEvent<number>;
|
|
19
|
-
} & {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
}, {}, {}, string>;
|
|
22
|
-
type SpinnerPlusMinus = InstanceType<typeof SpinnerPlusMinus>;
|
|
23
|
-
export default SpinnerPlusMinus;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { parseNumericAttribute } from '../../utils';
|
|
3
|
-
|
|
4
|
-
export let value: number = 0;
|
|
5
|
-
export let displayedValue = ''; // Will hold the display value as a string
|
|
6
|
-
export let min = 0;
|
|
7
|
-
export let max = 9999;
|
|
8
|
-
export let step = 1;
|
|
9
|
-
export let id = '';
|
|
10
|
-
export let placeholder = '0';
|
|
11
|
-
export let width = '100%';
|
|
12
|
-
export let disabled = false;
|
|
13
|
-
|
|
14
|
-
import { createEventDispatcher } from 'svelte';
|
|
15
|
-
const dispatch = createEventDispatcher<{
|
|
16
|
-
spinnerChange: number;
|
|
17
|
-
blur: number;
|
|
18
|
-
}>();
|
|
19
|
-
|
|
20
|
-
// This will update the displayedValue when 'value' is externally modified
|
|
21
|
-
$: displayedValue = value !== undefined ? value.toString() : '';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Increment the value by the step amount
|
|
25
|
-
*/
|
|
26
|
-
const increment = () => {
|
|
27
|
-
if (value < max) {
|
|
28
|
-
value = Math.min(max, value + step);
|
|
29
|
-
|
|
30
|
-
dispatch('spinnerChange', value);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Decrement the value by the step amount
|
|
35
|
-
*/
|
|
36
|
-
const decrement = () => {
|
|
37
|
-
if (value > min) {
|
|
38
|
-
value = Math.max(min, value - step);
|
|
39
|
-
dispatch('spinnerChange', value);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Manually update the value when the input is changed
|
|
45
|
-
* @param event
|
|
46
|
-
*/
|
|
47
|
-
const manualUpdate = (event: Event) => {
|
|
48
|
-
const inputElem = event.target as HTMLInputElement;
|
|
49
|
-
let newValue = inputElem.value;
|
|
50
|
-
|
|
51
|
-
if (newValue !== '0') {
|
|
52
|
-
newValue = newValue.replace(/^0+/, ''); // Remove leading zeros
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If newValue is empty, don't update the value
|
|
56
|
-
if (newValue === '') {
|
|
57
|
-
displayedValue = '';
|
|
58
|
-
inputElem.value = '';
|
|
59
|
-
|
|
60
|
-
dispatch('spinnerChange', value);
|
|
61
|
-
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const numValue = parseNumericAttribute(newValue, 0);
|
|
66
|
-
// Check for NaN and ensure the value is within the min and max bounds
|
|
67
|
-
if (!isNaN(numValue)) {
|
|
68
|
-
value = Math.max(min, Math.min(max, numValue));
|
|
69
|
-
// If value exceeds max, update the displayed value to match max
|
|
70
|
-
if (numValue > max) {
|
|
71
|
-
displayedValue = max.toString();
|
|
72
|
-
inputElem.value = max.toString();
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
// If parsed value is NaN, reset to min
|
|
76
|
-
value = min;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
dispatch('spinnerChange', value);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const blurEvent = (e: Event) => {
|
|
83
|
-
dispatch('blur', value);
|
|
84
|
-
};
|
|
85
|
-
</script>
|
|
86
|
-
|
|
87
|
-
<div class="spinner-container" class:disabled style="width: {width};">
|
|
88
|
-
<input
|
|
89
|
-
{disabled}
|
|
90
|
-
{id}
|
|
91
|
-
type="number"
|
|
92
|
-
{min}
|
|
93
|
-
{max}
|
|
94
|
-
{step}
|
|
95
|
-
bind:value={displayedValue}
|
|
96
|
-
on:input={manualUpdate}
|
|
97
|
-
on:blur={blurEvent}
|
|
98
|
-
{placeholder}
|
|
99
|
-
/>
|
|
100
|
-
<div class="buttons-container">
|
|
101
|
-
<button on:blur={blurEvent} {disabled} class:disabled on:click={increment} class="increment-btn"
|
|
102
|
-
>⌃</button
|
|
103
|
-
>
|
|
104
|
-
<button on:blur={blurEvent} {disabled} class:disabled on:click={decrement} class="decrement-btn"
|
|
105
|
-
>⌃</button
|
|
106
|
-
>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<style>
|
|
111
|
-
input::placeholder {
|
|
112
|
-
color: var(--text2) !important;
|
|
113
|
-
opacity: 1; /* Firefox */
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
input::-ms-input-placeholder {
|
|
117
|
-
/* Edge 12 -18 */
|
|
118
|
-
color: var(--text2) !important;
|
|
119
|
-
}
|
|
120
|
-
.spinner-container {
|
|
121
|
-
display: flex;
|
|
122
|
-
height: 1.5rem;
|
|
123
|
-
overflow: hidden;
|
|
124
|
-
border-radius: var(--border-radius);
|
|
125
|
-
border: 1px solid var(--border1, #212121);
|
|
126
|
-
background: var(--background1, #2b2b2b);
|
|
127
|
-
/* input-inner-shadow */
|
|
128
|
-
box-shadow:
|
|
129
|
-
0px 1px 1px -1px rgba(0, 0, 0, 0.13) inset,
|
|
130
|
-
0px 3px 3px -3px rgba(0, 0, 0, 0.17) inset,
|
|
131
|
-
0px 4px 4px -4px rgba(0, 0, 0, 0.17) inset,
|
|
132
|
-
0px 8px 8px -8px rgba(0, 0, 0, 0.17) inset,
|
|
133
|
-
0px 12px 12px -12px rgba(0, 0, 0, 0.13) inset,
|
|
134
|
-
0px 16px 16px -16px rgba(0, 0, 0, 0.13) inset;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.spinner-container:focus-within {
|
|
138
|
-
/* Styles for the buttons container when input is focused */
|
|
139
|
-
border: 1px solid var(--blueBorder);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.disabled {
|
|
143
|
-
opacity: 0.75;
|
|
144
|
-
pointer-events: none;
|
|
145
|
-
cursor: not-allowed;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.buttons-container {
|
|
149
|
-
display: flex;
|
|
150
|
-
flex-direction: column;
|
|
151
|
-
justify-content: center;
|
|
152
|
-
gap: 1px;
|
|
153
|
-
background-color: var(--border1);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.increment-btn {
|
|
157
|
-
border-radius: 0 1px 0 0;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.decrement-btn {
|
|
161
|
-
transform: rotate(180deg);
|
|
162
|
-
border-radius: 1px 0 0 0;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
input[type='number'] {
|
|
166
|
-
width: 100%;
|
|
167
|
-
height: 100%;
|
|
168
|
-
color: var(--actionPrimaryText);
|
|
169
|
-
text-align: left;
|
|
170
|
-
border: 0;
|
|
171
|
-
padding-left: var(--padding-small);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
input[type='number']:focus {
|
|
175
|
-
outline: none;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
button {
|
|
179
|
-
border: none;
|
|
180
|
-
width: 1rem;
|
|
181
|
-
background-color: var(--actionSecondaryBackground);
|
|
182
|
-
color: var(--text2);
|
|
183
|
-
font-size: 0.8em;
|
|
184
|
-
line-height: 1;
|
|
185
|
-
height: 48%;
|
|
186
|
-
display: grid;
|
|
187
|
-
place-items: center;
|
|
188
|
-
padding: 2px 0;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
button:hover {
|
|
192
|
-
background-color: var(--hoverColor);
|
|
193
|
-
}
|
|
194
|
-
</style>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const SpinnerUpDown: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
value?: number;
|
|
16
|
-
displayedValue?: string;
|
|
17
|
-
min?: number;
|
|
18
|
-
max?: number;
|
|
19
|
-
step?: number;
|
|
20
|
-
id?: string;
|
|
21
|
-
placeholder?: string;
|
|
22
|
-
width?: string;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
}, {
|
|
25
|
-
spinnerChange: CustomEvent<number>;
|
|
26
|
-
blur: CustomEvent<number>;
|
|
27
|
-
} & {
|
|
28
|
-
[evt: string]: CustomEvent<any>;
|
|
29
|
-
}, {}, {}, string>;
|
|
30
|
-
type SpinnerUpDown = InstanceType<typeof SpinnerUpDown>;
|
|
31
|
-
export default SpinnerUpDown;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Component } from 'svelte';
|
|
3
|
-
|
|
4
|
-
export let items: {
|
|
5
|
-
value: number;
|
|
6
|
-
label: string;
|
|
7
|
-
component: Component;
|
|
8
|
-
}[] = [];
|
|
9
|
-
export let activeTabValue = 1;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Handles the click event for the tab.
|
|
13
|
-
* @param tabValue
|
|
14
|
-
*/
|
|
15
|
-
const handleClick = (tabValue: number) => () => {
|
|
16
|
-
activeTabValue = tabValue;
|
|
17
|
-
};
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<ul>
|
|
21
|
-
{#each items as item (item.value)}
|
|
22
|
-
<li class={activeTabValue === item.value ? 'active' : ''}>
|
|
23
|
-
<button on:click={handleClick(item.value)}>{item.label}</button>
|
|
24
|
-
</li>
|
|
25
|
-
{/each}
|
|
26
|
-
</ul>
|
|
27
|
-
{#each items as item (item.value)}
|
|
28
|
-
{#if activeTabValue === item.value}
|
|
29
|
-
<div class="box">
|
|
30
|
-
<svelte:component this={item.component} />
|
|
31
|
-
</div>
|
|
32
|
-
{/if}
|
|
33
|
-
{/each}
|
|
34
|
-
|
|
35
|
-
<style>
|
|
36
|
-
.box {
|
|
37
|
-
padding-top: 12px;
|
|
38
|
-
border-radius: 0 0 0.5rem 0.5rem;
|
|
39
|
-
border-top: 0;
|
|
40
|
-
}
|
|
41
|
-
ul {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-wrap: wrap;
|
|
44
|
-
padding-left: 0;
|
|
45
|
-
margin-bottom: 0;
|
|
46
|
-
list-style: none;
|
|
47
|
-
border-bottom: 1px solid #dee2e6;
|
|
48
|
-
}
|
|
49
|
-
li {
|
|
50
|
-
margin-bottom: -1px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
button {
|
|
54
|
-
border: 1px solid transparent;
|
|
55
|
-
border-top-left-radius: 0.25rem;
|
|
56
|
-
border-top-right-radius: 0.25rem;
|
|
57
|
-
display: block;
|
|
58
|
-
padding: 0.5rem 1rem;
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
button:hover {
|
|
63
|
-
border-color: #e9ecef #e9ecef #dee2e6;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
li.active > button {
|
|
67
|
-
color: #495057;
|
|
68
|
-
background-color: #fff;
|
|
69
|
-
border-color: #dee2e6 #dee2e6 #fff;
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Component } from 'svelte';
|
|
2
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
-
$$bindings?: Bindings;
|
|
5
|
-
} & Exports;
|
|
6
|
-
(internal: unknown, props: Props & {
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const Tabs: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
items?: {
|
|
17
|
-
value: number;
|
|
18
|
-
label: string;
|
|
19
|
-
component: Component;
|
|
20
|
-
}[];
|
|
21
|
-
activeTabValue?: number;
|
|
22
|
-
}, {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
}, {}, {}, string>;
|
|
25
|
-
type Tabs = InstanceType<typeof Tabs>;
|
|
26
|
-
export default Tabs;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { BoxAddIcon, CheckCircleIcon } from '../icons';
|
|
3
|
-
export let title = 'Toggle Item Title';
|
|
4
|
-
export let isActive = false;
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<div class="toggle-item_title-row">
|
|
8
|
-
<BoxAddIcon />
|
|
9
|
-
{title}
|
|
10
|
-
{#if isActive}
|
|
11
|
-
<CheckCircleIcon />
|
|
12
|
-
{/if}
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<style>
|
|
16
|
-
.toggle-item_title-row {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: start;
|
|
21
|
-
background-color: var(--background3);
|
|
22
|
-
border-bottom: 1px solid var(--background5);
|
|
23
|
-
color: var(--text1);
|
|
24
|
-
padding: 6px 10px;
|
|
25
|
-
gap: 8px;
|
|
26
|
-
font-size: var(--font-size-small);
|
|
27
|
-
font-weight: 400;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { TriangleDownIconToggle } from '../icons';
|
|
3
|
-
|
|
4
|
-
let display = true;
|
|
5
|
-
/**
|
|
6
|
-
* Toggles the display of the list.
|
|
7
|
-
*/
|
|
8
|
-
const handleClick = () => {
|
|
9
|
-
display = !display;
|
|
10
|
-
};
|
|
11
|
-
export let title = 'Toggle List Title';
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div class="toggle-list_wrapper">
|
|
15
|
-
<button class="toggle-list_title-row" on:click={handleClick}>
|
|
16
|
-
<TriangleDownIconToggle rotate={!display} />
|
|
17
|
-
{title}
|
|
18
|
-
</button>
|
|
19
|
-
|
|
20
|
-
{#if display}
|
|
21
|
-
<slot />
|
|
22
|
-
{/if}
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<style>
|
|
26
|
-
button {
|
|
27
|
-
appearance: none;
|
|
28
|
-
background: none;
|
|
29
|
-
border: none;
|
|
30
|
-
margin: 0;
|
|
31
|
-
padding: 0;
|
|
32
|
-
font: inherit;
|
|
33
|
-
color: inherit;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
outline: none;
|
|
36
|
-
text-align: inherit;
|
|
37
|
-
/* other styles as needed */
|
|
38
|
-
}
|
|
39
|
-
.toggle-list_wrapper {
|
|
40
|
-
border-top: 1px solid var(--background5);
|
|
41
|
-
border-right: 1px solid var(--background5);
|
|
42
|
-
border-left: 1px solid var(--background5);
|
|
43
|
-
}
|
|
44
|
-
.toggle-list_title-row {
|
|
45
|
-
width: 100%;
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-direction: row;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: start;
|
|
50
|
-
background-color: var(--background4);
|
|
51
|
-
border-bottom: 1px solid var(--background5);
|
|
52
|
-
color: var(--text1);
|
|
53
|
-
padding: 6px 10px;
|
|
54
|
-
gap: 8px;
|
|
55
|
-
font-size: var(--font-size-large);
|
|
56
|
-
}
|
|
57
|
-
</style>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'svelte';
|
|
2
|
-
import type { ButtonItem } from './types';
|
|
3
|
-
type $$ComponentProps = {
|
|
4
|
-
buttons: ButtonItem[];
|
|
5
|
-
editMode: boolean;
|
|
6
|
-
formKey: string;
|
|
7
|
-
};
|
|
8
|
-
declare const FooterButton: Component<$$ComponentProps, {}, "">;
|
|
9
|
-
type FooterButton = ReturnType<typeof FooterButton>;
|
|
10
|
-
export default FooterButton;
|