@privyid/persona 1.1.0 → 1.1.1

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.
@@ -10,7 +10,7 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
10
10
  default: string;
11
11
  };
12
12
  length: {
13
- type: (StringConstructor | NumberConstructor)[];
13
+ type: (NumberConstructor | StringConstructor)[];
14
14
  default: number;
15
15
  };
16
16
  }>, () => import("vue-demi").VNode<import("vue-demi").RendererNode, import("vue-demi").RendererElement, {
@@ -21,7 +21,7 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
21
21
  default: string;
22
22
  };
23
23
  length: {
24
- type: (StringConstructor | NumberConstructor)[];
24
+ type: (NumberConstructor | StringConstructor)[];
25
25
  default: number;
26
26
  };
27
27
  }>> & Readonly<{}>, {
@@ -19,7 +19,7 @@ import type {
19
19
  ChartType,
20
20
  ChartOptions,
21
21
  } from 'chart.js/auto'
22
- import { watchPausable } from '@vueuse/core'
22
+ import { watchIgnorable } from '@vueuse/core'
23
23
  import type { PropType, VNode } from 'vue-demi'
24
24
  import {
25
25
  onMounted,
@@ -119,20 +119,18 @@ async function initChart () {
119
119
  )
120
120
  }
121
121
 
122
- const dataWatcher = watchPausable(data, (newData) => {
122
+ const { ignoreUpdates } = watchIgnorable(data, (newData) => {
123
123
  if (instance.value) {
124
124
  instance.value.data = newData
125
125
  instance.value.update()
126
126
  }
127
127
  })
128
128
 
129
- watch([variant, legend], async () => {
130
- dataWatcher.pause()
131
-
132
- await initChart()
133
- await nextTick()
134
-
135
- dataWatcher.resume()
129
+ watch([variant, legend], () => {
130
+ ignoreUpdates(async () => {
131
+ await initChart()
132
+ await nextTick()
133
+ })
136
134
  }, { flush: 'pre' })
137
135
 
138
136
  onMounted(() => {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <label
3
3
  class="dropzone"
4
- :class="classNames"
4
+ :class="[classNames, containerClass]"
5
5
  data-testid="dropzone"
6
6
  @drop.prevent="onDrop"
7
7
  @dragover.prevent
@@ -43,8 +43,11 @@ import {
43
43
  import { useVModel } from '../input'
44
44
  import { toBase64 } from '../utils/base64'
45
45
  import { useToNumber } from '@vueuse/shared'
46
+ import { watchIgnorable } from '@vueuse/core'
46
47
  import type { ModelModifier, MultipleType } from '.'
47
48
 
49
+ defineOptions({ inheritAttrs: false })
50
+
48
51
  const props = defineProps({
49
52
  modelValue: {
50
53
  type: [
@@ -82,6 +85,14 @@ const props = defineProps({
82
85
  type : Boolean,
83
86
  default: false,
84
87
  },
88
+ containerClass: {
89
+ type: [
90
+ String,
91
+ Array,
92
+ Object,
93
+ ],
94
+ default: undefined,
95
+ },
85
96
  })
86
97
 
87
98
  const emit = defineEmits<{
@@ -116,6 +127,17 @@ const classNames = computed(() => {
116
127
  return result
117
128
  })
118
129
 
130
+ const { ignoreUpdates } = watchIgnorable(() => props.modelValue, (value) => {
131
+ if (value) {
132
+ if (Array.isArray(value))
133
+ rawModel.value = value.filter((item) => item instanceof globalThis.File)
134
+ else {
135
+ if (value instanceof globalThis.File)
136
+ rawModel.value = value
137
+ }
138
+ }
139
+ }, { immediate: true })
140
+
119
141
  function browse () {
120
142
  input.value.value = ''
121
143
  input.value.click()
@@ -181,7 +203,10 @@ async function handleFiles (fileList: globalThis.FileList) {
181
203
  if (props.modelModifiers.base64)
182
204
  value = await filesToBase64(file)
183
205
 
184
- model.value = value
206
+ ignoreUpdates(() => {
207
+ model.value = value
208
+ })
209
+
185
210
  emit('change', value)
186
211
  } else {
187
212
  if (props.clearOnCancel)
@@ -59,8 +59,8 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
59
59
  }>> & Readonly<{
60
60
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
61
61
  }>, {
62
- mode: "date" | "month" | "year";
63
62
  modelValue: Date;
63
+ mode: "date" | "month" | "year";
64
64
  min: Date;
65
65
  max: Date;
66
66
  format: string;
@@ -11,7 +11,7 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
11
11
  default: () => never[];
12
12
  };
13
13
  modelValue: {
14
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
14
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
15
15
  default: undefined;
16
16
  };
17
17
  }>, {
@@ -30,7 +30,7 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
30
30
  default: () => never[];
31
31
  };
32
32
  modelValue: {
33
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
33
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
34
34
  default: undefined;
35
35
  };
36
36
  }>> & Readonly<{
@@ -6,15 +6,15 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
6
6
  required: true;
7
7
  };
8
8
  modelValue: {
9
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
9
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
10
10
  default: boolean;
11
11
  };
12
12
  value: {
13
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
13
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
14
14
  default: boolean;
15
15
  };
16
16
  uncheckedValue: {
17
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
17
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
18
18
  default: boolean;
19
19
  };
20
20
  checked: {
@@ -24,21 +24,21 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
24
24
  }>, {
25
25
  model: import("vue-demi").Ref<boolean, boolean>;
26
26
  toggle: () => void;
27
- }, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{
27
+ }, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{
28
28
  schema: {
29
29
  type: PropType<FilterToggle>;
30
30
  required: true;
31
31
  };
32
32
  modelValue: {
33
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
33
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
34
34
  default: boolean;
35
35
  };
36
36
  value: {
37
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
37
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
38
38
  default: boolean;
39
39
  };
40
40
  uncheckedValue: {
41
- type: (BooleanConstructor | ArrayConstructor | StringConstructor | NumberConstructor | ObjectConstructor | DateConstructor)[];
41
+ type: (BooleanConstructor | ArrayConstructor | NumberConstructor | ObjectConstructor | DateConstructor | StringConstructor)[];
42
42
  default: boolean;
43
43
  };
44
44
  checked: {
@@ -46,11 +46,11 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
46
46
  default: boolean;
47
47
  };
48
48
  }>> & Readonly<{
49
- onChange?: ((...args: any[]) => any) | undefined;
50
49
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
50
+ onChange?: ((...args: any[]) => any) | undefined;
51
51
  }>, {
52
- value: string | number | boolean | Date | Record<string, any> | unknown[];
53
52
  modelValue: string | number | boolean | Date | Record<string, any> | unknown[];
53
+ value: string | number | boolean | Date | Record<string, any> | unknown[];
54
54
  checked: boolean;
55
55
  uncheckedValue: string | number | boolean | Date | Record<string, any> | unknown[];
56
56
  }, {}, {
@@ -3,6 +3,7 @@
3
3
  ref="dropzone"
4
4
  v-model="model"
5
5
  class="input-file"
6
+ data-testid="input-file"
6
7
  :class="classNames"
7
8
  :model-modifiers="modelModifiers"
8
9
  :multiple="multiple"
@@ -29,14 +30,21 @@
29
30
  :clearable="clearable"
30
31
  :model-value="getFileNames(rawModel)"
31
32
  :placeholder="placeholder"
32
- @clear.stop.prevent="clear" />
33
+ @clear.stop.prevent="clear">
34
+ <template
35
+ v-if="$slots.append"
36
+ #append>
37
+ <slot
38
+ name="append" />
39
+ </template>
40
+ </p-input>
33
41
  </p-input-group>
34
42
  </template>
35
43
  </p-dropzone>
36
44
  </template>
37
45
 
38
46
  <script lang="ts" setup>
39
- import type { PropType } from 'vue-demi'
47
+ import type { PropType, VNode } from 'vue-demi'
40
48
  import { computed, ref } from 'vue-demi'
41
49
  import { useVModel } from '../input'
42
50
  import pDropzone from '../dropzone/Dropzone.vue'
@@ -150,6 +158,10 @@ defineExpose({
150
158
  dropzone,
151
159
  clear,
152
160
  })
161
+
162
+ defineSlots<{
163
+ 'append'(): VNode[],
164
+ }>()
153
165
  </script>
154
166
 
155
167
  <style lang="postcss">
@@ -1,63 +1,58 @@
1
1
  {
2
+ "PAvatar": "components/avatar/Avatar.vue",
3
+ "PAvatarGroup": "components/avatar/AvatarGroup.vue",
4
+ "PAvatarTruncate": "components/avatar/AvatarTruncate.vue",
2
5
  "PAccordion": "components/accordion/Accordion.vue",
3
6
  "PAccordionItem": "components/accordion/AccordionItem.vue",
4
7
  "PAccordionItems": "components/accordion/AccordionItems.vue",
5
8
  "PBadge": "components/badge/Badge.vue",
6
- "PAvatar": "components/avatar/Avatar.vue",
7
- "PAvatarGroup": "components/avatar/AvatarGroup.vue",
8
- "PAvatarTruncate": "components/avatar/AvatarTruncate.vue",
9
9
  "PBanner": "components/banner/Banner.vue",
10
- "PButton": "components/button/Button.vue",
11
10
  "PBreadcrumb": "components/breadcrumbs/Breadcrumb.vue",
12
11
  "PBreadcrumbItem": "components/breadcrumbs/BreadcrumbItem.vue",
13
12
  "PBreadcrumbItemDropdown": "components/breadcrumbs/BreadcrumbItemDropdown.vue",
14
- "PCalendar": "components/calendar/Calendar.vue",
13
+ "PButton": "components/button/Button.vue",
15
14
  "PButtonGroup": "components/button-group/ButtonGroup.vue",
16
- "PCaption": "components/caption/Caption.vue",
15
+ "PCalendar": "components/calendar/Calendar.vue",
17
16
  "PCamera": "components/camera/Camera.vue",
18
17
  "PCard": "components/card/Card.vue",
19
18
  "PCardSection": "components/card/CardSection.vue",
19
+ "PCaption": "components/caption/Caption.vue",
20
20
  "PCarousel": "components/carousel/Carousel.vue",
21
21
  "PCarouselBody": "components/carousel/CarouselBody.vue",
22
22
  "PCarouselItem": "components/carousel/CarouselItem.vue",
23
- "PCollapse": "components/collapse/Collapse.vue",
24
- "PCheckbox": "components/checkbox/Checkbox.vue",
25
23
  "PChart": "components/chart/Chart.vue",
26
24
  "PChartSet": "components/chart/ChartSet.vue",
27
25
  "PChartVal": "components/chart/ChartVal.vue",
26
+ "PCheckbox": "components/checkbox/Checkbox.vue",
27
+ "PCollapse": "components/collapse/Collapse.vue",
28
+ "PCropper": "components/cropper/Cropper.vue",
28
29
  "PContextualBar": "components/contextual-bar/ContextualBar.vue",
29
- "PDatepicker": "components/datepicker/Datepicker.vue",
30
30
  "PDialog": "components/dialog/Dialog.vue",
31
31
  "PDialogFooter": "components/dialog/DialogFooter.vue",
32
- "PCropper": "components/cropper/Cropper.vue",
32
+ "PDatepicker": "components/datepicker/Datepicker.vue",
33
33
  "PDivider": "components/divider/Divider.vue",
34
34
  "PDot": "components/dot/Dot.vue",
35
- "PDropdownSubitem": "components/dropdown-subitem/DropdownSubitem.vue",
36
- "PDropzone": "components/dropzone/Dropzone.vue",
37
35
  "PDropdown": "components/dropdown/Dropdown.vue",
38
36
  "PDropdownHeader": "components/dropdown/DropdownHeader.vue",
39
37
  "PDropdownItem": "components/dropdown/DropdownItem.vue",
40
38
  "PDropdownText": "components/dropdown/DropdownText.vue",
41
- "PFilterbar": "components/filterbar/Filterbar.vue",
39
+ "PDropzone": "components/dropzone/Dropzone.vue",
40
+ "PDropdownSubitem": "components/dropdown-subitem/DropdownSubitem.vue",
42
41
  "PFormGroup": "components/form-group/FormGroup.vue",
42
+ "PFilterbar": "components/filterbar/Filterbar.vue",
43
+ "PHeading": "components/heading/Heading.vue",
43
44
  "PInput": "components/input/Input.vue",
44
45
  "PinputColor": "components/input-color/inputColor.vue",
45
- "PHeading": "components/heading/Heading.vue",
46
- "PInputPassword": "components/input-password/InputPassword.vue",
47
46
  "PInputFile": "components/input-file/InputFile.vue",
48
- "PInputPin": "components/input-pin/InputPin.vue",
49
47
  "PInputGroup": "components/input-group/InputGroup.vue",
50
48
  "PInputGroupAddon": "components/input-group/InputGroupAddon.vue",
49
+ "PInputPassword": "components/input-password/InputPassword.vue",
50
+ "PInputPin": "components/input-pin/InputPin.vue",
51
51
  "PInputRange": "components/input-range/InputRange.vue",
52
52
  "PLabel": "components/label/Label.vue",
53
+ "PMain": "components/main/Main.vue",
53
54
  "PListGroup": "components/list-group/ListGroup.vue",
54
55
  "PListGroupItem": "components/list-group/ListGroupItem.vue",
55
- "PMain": "components/main/Main.vue",
56
- "PModal": "components/modal/Modal.vue",
57
- "PNavbar": "components/navbar/Navbar.vue",
58
- "PNavbarBrand": "components/navbar/NavbarBrand.vue",
59
- "PNavbarNav": "components/navbar/NavbarNav.vue",
60
- "PNavbarToggle": "components/navbar/NavbarToggle.vue",
61
56
  "PNav": "components/nav/Nav.vue",
62
57
  "PNavCollapse": "components/nav/NavCollapse.vue",
63
58
  "PNavForm": "components/nav/NavForm.vue",
@@ -65,39 +60,44 @@
65
60
  "PNavItemDropdown": "components/nav/NavItemDropdown.vue",
66
61
  "PNavSubItem": "components/nav/NavSubItem.vue",
67
62
  "PNavText": "components/nav/NavText.vue",
63
+ "PModal": "components/modal/Modal.vue",
64
+ "PNavbar": "components/navbar/Navbar.vue",
65
+ "PNavbarBrand": "components/navbar/NavbarBrand.vue",
66
+ "PNavbarNav": "components/navbar/NavbarNav.vue",
67
+ "PNavbarToggle": "components/navbar/NavbarToggle.vue",
68
68
  "PNavbarNavMenu": "components/navbar-menu/NavbarNavMenu.vue",
69
- "POverlay": "components/overlay/Overlay.vue",
70
- "PPage": "components/page/Page.vue",
71
- "PPagination": "components/pagination/Pagination.vue",
72
69
  "PNotify": "components/notify/Notify.vue",
73
70
  "PNotifyGroup": "components/notify/NotifyGroup.vue",
74
71
  "PNotifyItem": "components/notify/NotifyItem.vue",
72
+ "POverlay": "components/overlay/Overlay.vue",
73
+ "PPage": "components/page/Page.vue",
74
+ "PPagination": "components/pagination/Pagination.vue",
75
+ "PPdfHelipad": "components/pdf-helipad/PdfHelipad.vue",
75
76
  "PPdfObject": "components/pdf-object/PdfObject.vue",
76
77
  "PPdfObjectAddon": "components/pdf-object/PdfObjectAddon.vue",
77
78
  "PPdfObjectDebugger": "components/pdf-object/PdfObjectDebugger.vue",
78
79
  "PPdfObjects": "components/pdf-object/PdfObjects.vue",
79
- "PPdfText": "components/pdf-text/PdfText.vue",
80
- "PPdfHelipad": "components/pdf-helipad/PdfHelipad.vue",
81
80
  "PPdfError": "components/pdf-viewer/PdfError.vue",
82
81
  "PPdfLoading": "components/pdf-viewer/PdfLoading.vue",
83
82
  "PPdfNavigation": "components/pdf-viewer/PdfNavigation.vue",
84
83
  "PPdfViewer": "components/pdf-viewer/PdfViewer.vue",
85
- "PPopup": "components/popup/Popup.vue",
84
+ "PPdfText": "components/pdf-text/PdfText.vue",
86
85
  "PPopover": "components/popover/Popover.vue",
87
- "PProgressIndicator": "components/progress-indicator/ProgressIndicator.vue",
88
- "PProgressbar": "components/progressbar/Progressbar.vue",
86
+ "PPopup": "components/popup/Popup.vue",
89
87
  "PProgress": "components/progress/Progress.vue",
90
88
  "PProgressItem": "components/progress/ProgressItem.vue",
89
+ "PProgressIndicator": "components/progress-indicator/ProgressIndicator.vue",
91
90
  "PPspdfHelipad": "components/pspdfkit/PspdfHelipad.vue",
92
91
  "PPspdfObject": "components/pspdfkit/PspdfObject.vue",
93
92
  "PPspdfObjectAddon": "components/pspdfkit/PspdfObjectAddon.vue",
94
93
  "PPspdfObjects": "components/pspdfkit/PspdfObjects.vue",
95
94
  "PPspdfViewer": "components/pspdfkit/PspdfViewer.vue",
95
+ "PProgressbar": "components/progressbar/Progressbar.vue",
96
+ "PQrcode": "components/qrcode/Qrcode.vue",
97
+ "PRadio": "components/radio/Radio.vue",
96
98
  "PRichtext": "components/richtext/Richtext.vue",
97
99
  "PRichtextToolbarAdvance": "components/richtext/RichtextToolbarAdvance.vue",
98
100
  "PRichtextToolbarSimple": "components/richtext/RichtextToolbarSimple.vue",
99
- "PQrcode": "components/qrcode/Qrcode.vue",
100
- "PRadio": "components/radio/Radio.vue",
101
101
  "PRingbar": "components/ringbar/Ringbar.vue",
102
102
  "PSheet": "components/sheet/Sheet.vue",
103
103
  "PShimmer": "components/shimmer/Shimmer.vue",
@@ -108,42 +108,42 @@
108
108
  "PSidebarBrand": "components/sidebar/SidebarBrand.vue",
109
109
  "PSidebarContent": "components/sidebar/SidebarContent.vue",
110
110
  "PSidebarNav": "components/sidebar/SidebarNav.vue",
111
- "PSidebarMenu": "components/sidebar-menu/SidebarMenu.vue",
112
- "PSidebarMenuItem": "components/sidebar-menu/SidebarMenuItem.vue",
113
111
  "PSignatureDraw": "components/signature-draw/SignatureDraw.vue",
114
112
  "PSignatureDrawDesktop": "components/signature-draw/SignatureDrawDesktop.vue",
115
113
  "PSignatureDrawMobile": "components/signature-draw/SignatureDrawMobile.vue",
114
+ "PSidebarMenu": "components/sidebar-menu/SidebarMenu.vue",
115
+ "PSidebarMenuItem": "components/sidebar-menu/SidebarMenuItem.vue",
116
+ "PSignatureText": "components/signature-text/SignatureText.vue",
116
117
  "PSpinner": "components/spinner/Spinner.vue",
117
118
  "PSpinnerRing": "components/spinner/SpinnerRing.vue",
118
119
  "PSpinnerRinggo": "components/spinner/SpinnerRinggo.vue",
119
- "PSignatureText": "components/signature-text/SignatureText.vue",
120
120
  "PStep": "components/steps/Step.vue",
121
121
  "PStepSlider": "components/steps/StepSlider.vue",
122
122
  "PSteps": "components/steps/Steps.vue",
123
- "PSpread": "components/spread/Spread.vue",
124
123
  "PStrengthbar": "components/strengthbar/Strengthbar.vue",
125
- "PTable": "components/table/Table.vue",
124
+ "PSpread": "components/spread/Spread.vue",
126
125
  "PSubheading": "components/subheading/Subheading.vue",
126
+ "PTable": "components/table/Table.vue",
127
127
  "PTableFlex": "components/table-flex/TableFlex.vue",
128
- "PText": "components/text/Text.vue",
129
128
  "PTableStatic": "components/table-static/TableStatic.vue",
130
129
  "PTableStaticRoot": "components/table-static/TableStaticRoot.vue",
131
130
  "PTableStaticSort": "components/table-static/TableStaticSort.vue",
132
131
  "PTab": "components/tabs/Tab.vue",
133
132
  "PTabContent": "components/tabs/TabContent.vue",
134
133
  "PTabs": "components/tabs/Tabs.vue",
134
+ "PText": "components/text/Text.vue",
135
135
  "PTextarea": "components/textarea/Textarea.vue",
136
136
  "PTime": "components/time/Time.vue",
137
137
  "PTimeItem": "components/time/TimeItem.vue",
138
- "PToast": "components/toast/Toast.vue",
139
138
  "PTimepicker": "components/timepicker/Timepicker.vue",
139
+ "PToast": "components/toast/Toast.vue",
140
140
  "PToggle": "components/toggle/Toggle.vue",
141
- "PTour": "components/tour/Tour.vue",
142
- "PTourDialog": "components/tour/TourDialog.vue",
143
- "PTourHighlight": "components/tour/TourHighlight.vue",
144
141
  "PTooltip": "components/tooltip/Tooltip.vue",
145
142
  "PTooltipContainer": "components/tooltip/TooltipContainer.vue",
146
143
  "PTruncate": "components/truncate/Truncate.vue",
144
+ "PTour": "components/tour/Tour.vue",
145
+ "PTourDialog": "components/tour/TourDialog.vue",
146
+ "PTourHighlight": "components/tour/TourHighlight.vue",
147
147
  "PWizard": "components/wizard/Wizard.vue",
148
148
  "PWizardBody": "components/wizard/WizardBody.vue",
149
149
  "PWizardHeader": "components/wizard/WizardHeader.vue",
@@ -154,9 +154,6 @@
154
154
  "PPinnedMultiselect": "components/filterbar/pinned/PinnedMultiselect.vue",
155
155
  "PPinnedSelect": "components/filterbar/pinned/PinnedSelect.vue",
156
156
  "PPinnedToggle": "components/filterbar/pinned/PinnedToggle.vue",
157
- "PRichtextPopupImageEdit": "components/richtext/popup/RichtextPopupImageEdit.vue",
158
- "PRichtextPopupLinkDetail": "components/richtext/popup/RichtextPopupLinkDetail.vue",
159
- "PRichtextPopupLinkEdit": "components/richtext/popup/RichtextPopupLinkEdit.vue",
160
157
  "PRichtextControlFontFamily": "components/richtext/control/RichtextControlFontFamily.vue",
161
158
  "PRichtextControlFontSize": "components/richtext/control/RichtextControlFontSize.vue",
162
159
  "PRichtextControlHighlight": "components/richtext/control/RichtextControlHighlight.vue",
@@ -167,5 +164,8 @@
167
164
  "PRichtextControlTable": "components/richtext/control/RichtextControlTable.vue",
168
165
  "PRichtextControlTextAlign": "components/richtext/control/RichtextControlTextAlign.vue",
169
166
  "PRichtextControlTextFormat": "components/richtext/control/RichtextControlTextFormat.vue",
170
- "PRichtextControlTextHeading": "components/richtext/control/RichtextControlTextHeading.vue"
167
+ "PRichtextControlTextHeading": "components/richtext/control/RichtextControlTextHeading.vue",
168
+ "PRichtextPopupImageEdit": "components/richtext/popup/RichtextPopupImageEdit.vue",
169
+ "PRichtextPopupLinkDetail": "components/richtext/popup/RichtextPopupLinkDetail.vue",
170
+ "PRichtextPopupLinkEdit": "components/richtext/popup/RichtextPopupLinkEdit.vue"
171
171
  }
@@ -26,8 +26,8 @@ export function usePagination(props) {
26
26
  return getPageRange(1, totalPageCount.value);
27
27
  return getPageItems(page.value, totalPageCount.value, displayLimit.value);
28
28
  });
29
- const canNext = computed(() => page.value !== totalPageCount.value);
30
- const canPrev = computed(() => page.value !== 1);
29
+ const canNext = computed(() => page.value < totalPageCount.value);
30
+ const canPrev = computed(() => page.value > 1);
31
31
  return {
32
32
  pageItems,
33
33
  rowRange,
@@ -175,22 +175,22 @@ import type {
175
175
  import {
176
176
  computed,
177
177
  ref,
178
- nextTick,
179
178
  watch,
180
179
  } from 'vue-demi'
181
180
  import type { SelectItem } from '.'
182
181
  import {
183
182
  findSelected,
184
183
  filterSelected,
184
+ mergeUniq,
185
185
  } from '.'
186
186
  import type { Adapter, AdapterContext } from './adapter/adapter'
187
187
  import BasicAdapter from './adapter/basic-adapter'
188
188
  import useLoading from '../overlay/utils/use-loading'
189
189
  import { isEqual } from '../utils/value'
190
- import { onStartTyping, watchPausable } from '@vueuse/core'
190
+ import { onStartTyping, watchIgnorable } from '@vueuse/core'
191
191
  import type { SizeVariant } from '../button'
192
192
  import type { MenuSizeVariant } from '../dropdown/'
193
- import { isNil, uniqBy } from 'lodash-es'
193
+ import { isNil } from 'lodash-es'
194
194
 
195
195
  defineOptions({
196
196
  models: {
@@ -369,7 +369,7 @@ const hasValue = computed(() => {
369
369
  : !isNil((localModel.value as SelectItem)?.value)
370
370
  })
371
371
 
372
- const modelWatcher = watchPausable(() => props.modelValue, (value) => {
372
+ const { ignoreUpdates } = watchIgnorable(() => props.modelValue, (value) => {
373
373
  localModel.value = props.multiple
374
374
  ? filterSelected(items.value, value as unknown[])
375
375
  : findSelected(items.value, value)
@@ -377,51 +377,51 @@ const modelWatcher = watchPausable(() => props.modelValue, (value) => {
377
377
 
378
378
  watch(items, (options) => {
379
379
  if (props.modelValue && options.length > 0) {
380
- const value = props.multiple
381
- ? filterSelected(options, props.modelValue as unknown[])
382
- : findSelected(options, props.modelValue)
380
+ if (props.multiple) {
381
+ const selected = filterSelected(options, props.modelValue)
383
382
 
384
- localModel.value = props.multiple
385
- ? uniqBy([...localModel.value as SelectItem[], ...value as SelectItem[]], 'value')
386
- : ((value as SelectItem).value === undefined ? localModel.value as SelectItem : value as SelectItem)
383
+ if (selected.length > 0)
384
+ localModel.value = mergeUniq(localModel.value as SelectItem[], selected)
385
+ } else {
386
+ const selected = findSelected(options, props.modelValue)
387
+
388
+ if (!isNil(selected.value))
389
+ localModel.value = selected
390
+ }
387
391
  }
388
392
  })
389
393
 
390
394
  function setValue (item?: SelectItem) {
391
- // define default item value
392
- let value: SelectItem | SelectItem[] = props.multiple
393
- ? []
394
- : { text: '', value: undefined }
395
-
396
- if (props.multiple && item && Array.isArray(localModel.value)) {
397
- value = localModel.value.some((val) => isEqual(val.value, item.value))
398
- ? localModel.value.filter((val) => !isEqual(val.value, item.value))
399
- : [...localModel.value, item]
395
+ let value = props.multiple
396
+ ? [] as SelectItem[]
397
+ : { text: '', value: undefined } as SelectItem
398
+
399
+ if (item) {
400
+ if (props.multiple && Array.isArray(localModel.value)) {
401
+ value = localModel.value.some((val) => isEqual(val.value, item.value))
402
+ ? localModel.value.filter((val) => !isEqual(val.value, item.value))
403
+ : [...localModel.value, item]
404
+ } else
405
+ value = item
400
406
  }
401
- if (!props.multiple && item)
402
- value = item
403
-
404
- modelWatcher.pause()
405
407
 
406
- localModel.value = value
408
+ ignoreUpdates(() => {
409
+ localModel.value = value
407
410
 
408
- emit('change', value)
409
- emit('update:selected', value)
410
- emit('update:modelValue',
411
- props.multiple
412
- ? (value as SelectItem[]).map((i) => i.value)
413
- : (value as SelectItem)?.value,
414
- )
411
+ emit('change', value)
412
+ emit('update:selected', value)
413
+ emit('update:modelValue',
414
+ props.multiple
415
+ ? (value as SelectItem[]).map((i) => i.value)
416
+ : (value as SelectItem)?.value,
417
+ )
418
+ })
415
419
 
416
420
  if (isOpen.value)
417
421
  emit('userInput', value)
418
422
 
419
423
  if (!props.noCloseAfterSelect)
420
424
  isOpen.value = false
421
-
422
- nextTick(() => {
423
- modelWatcher.resume()
424
- })
425
425
  }
426
426
 
427
427
  function onFocus () {
@@ -484,6 +484,7 @@ defineSlots<{
484
484
  isSelected: boolean,
485
485
  }): VNode[],
486
486
  'loading'(): VNode[],
487
+ 'caret'(): VNode[],
487
488
  }>()
488
489
  </script>
489
490
 
@@ -12,3 +12,4 @@ export interface SelectProps {
12
12
  export declare function defineOptions(options: SelectItem[]): SelectItem[];
13
13
  export declare function findSelected(items: SelectItem[], value: unknown): SelectItem;
14
14
  export declare function filterSelected(items: SelectItem[], value: unknown[]): SelectItem[];
15
+ export declare function mergeUniq(...arrays: SelectItem[][]): SelectItem[];
@@ -8,3 +8,13 @@ export function findSelected(items, value) {
8
8
  export function filterSelected(items, value) {
9
9
  return Array.isArray(value) ? items.filter((item) => valueIn(value, item.value)) : [];
10
10
  }
11
+ export function mergeUniq(...arrays) {
12
+ const result = [];
13
+ for (const items of arrays) {
14
+ for (const item of items) {
15
+ if (!result.some((last) => isEqual(item, last)))
16
+ result.push(item);
17
+ }
18
+ }
19
+ return result;
20
+ }
@@ -1,6 +1,6 @@
1
1
  declare const _default: import("vue-demi").DefineComponent<import("vue-demi").ExtractPropTypes<{
2
2
  active: {
3
- type: (StringConstructor | NumberConstructor)[];
3
+ type: (NumberConstructor | StringConstructor)[];
4
4
  required: true;
5
5
  };
6
6
  keepAlive: {
@@ -15,7 +15,7 @@ declare const _default: import("vue-demi").DefineComponent<import("vue-demi").Ex
15
15
  [key: string]: any;
16
16
  }>, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{
17
17
  active: {
18
- type: (StringConstructor | NumberConstructor)[];
18
+ type: (NumberConstructor | StringConstructor)[];
19
19
  required: true;
20
20
  };
21
21
  keepAlive: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@privyid/persona",
3
3
  "description": "Persona core package",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "url": "https://github.com/privy-open-source/design-system.git",
@@ -58,13 +58,13 @@
58
58
  "dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground"
59
59
  },
60
60
  "dependencies": {
61
- "@floating-ui/dom": "1.6.12",
62
- "@jill64/universal-sanitizer": "1.3.6",
61
+ "@floating-ui/dom": "1.6.13",
62
+ "@jill64/universal-sanitizer": "1.4.1",
63
63
  "@juggle/resize-observer": "3.4.0",
64
- "@nuxt/kit": "3.15.1",
64
+ "@nuxt/kit": "3.15.4",
65
65
  "@splidejs/splide": "4.1.4",
66
66
  "@testing-library/dom": "10.4.0",
67
- "@testing-library/user-event": "14.5.2",
67
+ "@testing-library/user-event": "14.6.1",
68
68
  "@tiptap/extension-font-family": "^2.5.9",
69
69
  "@tiptap/extension-highlight": "^2.5.9",
70
70
  "@tiptap/extension-image": "^2.6.4",
@@ -89,11 +89,11 @@
89
89
  "date-fns": "4.1.0",
90
90
  "defu": "6.1.4",
91
91
  "fast-equals": "5.2.2",
92
- "fuse.js": "7.0.0",
92
+ "fuse.js": "7.1.0",
93
93
  "html-escaper": "^3.0.3",
94
94
  "interactjs": "1.10.27",
95
95
  "lodash-es": "4.17.21",
96
- "marked": "15.0.5",
96
+ "marked": "15.0.7",
97
97
  "nanodelay": "2.0.2",
98
98
  "pathe": "^2.0.0",
99
99
  "pdfjs-dist": "4.10.38",
@@ -112,8 +112,8 @@
112
112
  "extends @privyid/browserslist-config"
113
113
  ],
114
114
  "peerDependencies": {
115
- "@privyid/browserslist-config": "^1.1.0",
116
- "@privyid/tailwind-preset": "^1.1.0",
115
+ "@privyid/browserslist-config": "^1.1.1",
116
+ "@privyid/tailwind-preset": "^1.1.1",
117
117
  "postcss-custom-properties": "^12.1.11 || ^13.0.0 || ^14.0.0",
118
118
  "postcss-hexrgba": "^2.1.0",
119
119
  "postcss-lighten-darken": "^0.9.0",
@@ -122,13 +122,13 @@
122
122
  },
123
123
  "devDependencies": {
124
124
  "@nuxt/module-builder": "0.8.4",
125
- "@nuxt/schema": "3.15.1",
126
- "@nuxtjs/tailwindcss": "6.12.2",
127
- "@privyid/browserslist-config": "^1.1.0",
128
- "@privyid/tailwind-preset": "^1.1.0",
125
+ "@nuxt/schema": "3.15.4",
126
+ "@nuxtjs/tailwindcss": "6.13.2",
127
+ "@privyid/browserslist-config": "^1.1.1",
128
+ "@privyid/tailwind-preset": "^1.1.1",
129
129
  "@types/sanitize-html": "2.13.0",
130
130
  "browserslist-to-esbuild": "2.1.1",
131
- "nuxt": "3.15.1",
131
+ "nuxt": "3.15.4",
132
132
  "postcss-custom-properties": "14.0.4",
133
133
  "postcss-hexrgba": "2.1.0",
134
134
  "postcss-lighten-darken": "0.9.0",