@signal24/vue-foundation 4.25.7 → 4.26.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.
@@ -6,15 +6,21 @@
6
6
  </select>
7
7
 
8
8
  <DemoVfSmartSelect v-if="selectedDemo === 'VfSmartSelect'" />
9
+ <DemoVfAlertModal v-else-if="selectedDemo === 'VfAlertModal'" />
10
+
11
+ <OverlayContainer />
9
12
  </div>
10
13
  </template>
11
14
 
12
15
  <script lang="ts" setup>
13
16
  import { ref } from 'vue';
14
17
 
18
+ import { OverlayContainer } from '@/components';
19
+
20
+ import DemoVfAlertModal from './demo-vf-alert-modal.vue';
15
21
  import DemoVfSmartSelect from './demo-vf-smart-select.vue';
16
22
 
17
- const demos = ['VfSmartSelect'] as const;
23
+ const demos = ['VfSmartSelect', 'VfAlertModal'] as const;
18
24
  const selectedDemo = ref<(typeof demos)[number] | null>();
19
25
  </script>
20
26
 
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div id="demo-vf-alert-modal">
3
+ <button @click="showAlertDemo">Show Alert Modal</button>
4
+ <button @click="showWaitDemo">Show Wait Modal</button>
5
+ <button @click="showMutableWaitDemo">Show Mutable Wait Modal</button>
6
+ </div>
7
+ </template>
8
+
9
+ <script lang="ts" setup>
10
+ import { showAlert, showMutableWait, showWait } from '@/components';
11
+ import { sleepSecs } from '@/helpers';
12
+
13
+ async function showAlertDemo() {
14
+ await showAlert({
15
+ title: 'Alert Modal',
16
+ message: 'This is a simple alert modal.'
17
+ });
18
+ console.log('Alert modal closed');
19
+ }
20
+
21
+ async function showWaitDemo() {
22
+ const dismiss = showWait('Wait Demo', 'Waiting 1 second...');
23
+ await sleepSecs(1);
24
+ dismiss();
25
+ }
26
+
27
+ async function showMutableWaitDemo() {
28
+ const wait = showMutableWait({
29
+ message: 'Waiting 1 second...'
30
+ });
31
+ await sleepSecs(1);
32
+ wait.update('Another second...');
33
+ await sleepSecs(1);
34
+ wait.dismiss();
35
+ }
36
+ </script>
@@ -68,6 +68,24 @@
68
68
 
69
69
  Selected value: {{ selectedCreateOption ?? '-' }}
70
70
  </div>
71
+
72
+ <div>
73
+ <VfSmartSelect v-model="selectedLoadedOption" :load-options="loadOptions" :formatter="o => o.label" :value-extractor="o => o.value" />
74
+
75
+ Selected value: {{ selectedLoadedOption ?? '-' }}
76
+ </div>
77
+
78
+ <div>
79
+ <VfSmartSelect v-model="selectedLoadedOption2" :load-options="loadOptions" :formatter="o => o.label" :value-extractor="o => o.value" />
80
+
81
+ Selected value: {{ selectedLoadedOption2 ?? '-' }}
82
+ </div>
83
+
84
+ <div>
85
+ <VfSmartSelect v-model="selectedLoadedOption3" :load-options="loadOptions" :formatter="o => o.label" />
86
+
87
+ Selected value: {{ selectedLoadedOption3 ?? '-' }}
88
+ </div>
71
89
  </div>
72
90
  </template>
73
91
 
@@ -76,6 +94,7 @@ import { cloneDeep, compact } from 'lodash';
76
94
  import { computed, onMounted, ref } from 'vue';
77
95
 
78
96
  import VfSmartSelect from '@/components/vf-smart-select.vue';
97
+ import { sleepSecs } from '@/helpers';
79
98
 
80
99
  interface IOption {
81
100
  label: string;
@@ -104,6 +123,9 @@ const selectedDelayedOption1 = ref<IOption | null>(options[1]);
104
123
  const selectedDelayedOption2 = ref<string | null>('2');
105
124
  const selectedDelayedOption3 = ref<string | null>('19'); // intentionally invalid value
106
125
  const selectedCreateOption = ref<string | null>(null);
126
+ const selectedLoadedOption = ref<string | null>(null);
127
+ const selectedLoadedOption2 = ref<string | null>('5');
128
+ const selectedLoadedOption3 = ref<IOption | null>({ value: '5', label: 'Option 5', group: 'Set 1' });
107
129
 
108
130
  const createdOptionTitle = ref<string>();
109
131
  const createOptions = computed(() =>
@@ -114,6 +136,11 @@ function setDelayedOptions() {
114
136
  delayedOptions.value = cloneDeep(options);
115
137
  }
116
138
 
139
+ async function loadOptions() {
140
+ await sleepSecs(0.25);
141
+ return [...options];
142
+ }
143
+
117
144
  function createOption(name: string) {
118
145
  createdOptionTitle.value = name;
119
146
  selectedCreateOption.value = 'new';
package/demo/index.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import { createApp } from 'vue';
2
2
 
3
3
  import { configureVf } from '@/config';
4
+ import { installVf } from '@/index';
4
5
 
5
6
  import DemoRoot from './components/demo-root.vue';
6
7
 
7
8
  const app = createApp(DemoRoot);
9
+ installVf(app);
8
10
  configureVf({});
9
11
 
10
12
  app.mount(document.body);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -16,4 +16,11 @@ export declare function showConfirmDestroy(options: IAlertOptions): Promise<bool
16
16
  export declare function showWait(title: string, message: string): () => void;
17
17
  export declare function showWait(message: string): () => void;
18
18
  export declare function showWait(options: IAlertOptions): () => void;
19
+ interface IMutableWait {
20
+ update: (message: string) => void;
21
+ dismiss: () => void;
22
+ }
23
+ export declare function showMutableWait(title: string, message: string): IMutableWait;
24
+ export declare function showMutableWait(message: string): IMutableWait;
25
+ export declare function showMutableWait(options: IAlertOptions): IMutableWait;
19
26
  export {};
@@ -49,4 +49,5 @@ export declare function dismissOverlayInjectionByVnode(vnode: VNode): boolean;
49
49
  export declare function dismissOverlayInjectionById(id: string): boolean;
50
50
  export declare function removeOverlayInjection(injection: OverlayInjection<any, any>): void;
51
51
  export declare function presentOverlay<C extends OverlayComponent, R extends ComponentReturn<C>>(component: C, props: Omit<OverlayComponentProps<C>, 'callback'>, options?: OverlayOptions<C, R>): Promise<R | undefined>;
52
+ export declare function updateOverlayProps<C extends OverlayComponent>(injection: OverlayInjection<C, any>, props: Partial<Omit<OverlayComponentProps<C>, 'callback'>>): Promise<void>;
52
53
  export {};