@ironsource/shared-ui 2.0.2-rc.4 → 2.1.0-rc.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.
@@ -0,0 +1 @@
1
+ .form-row[data-v-8daca9c2]{display:flex;height:auto;gap:1.5rem;align-items:center}.form-row .label-container[data-v-8daca9c2]{display:flex;min-height:1.75rem;height:100%;width:12.875rem;align-items:center;gap:.25rem;flex-shrink:0}.form-row .label-container .mandatory[data-v-8daca9c2]{color:var(--error-main);padding-top:.1875rem}.form-row .content[data-v-8daca9c2]{display:flex;flex-direction:column;align-items:stretch;gap:.25rem;width:100%}
@@ -0,0 +1,9 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, {
2
+ default?(_: {}): any;
3
+ }>;
4
+ export default _default;
5
+ type __VLS_WithTemplateSlots<T, S> = T & {
6
+ new (): {
7
+ $slots: S;
8
+ };
9
+ };
@@ -0,0 +1,24 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
+ validationPath: string;
3
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ validationPath: string;
5
+ }>>>, {}>, {
6
+ default?(_: {
7
+ validationPath: string;
8
+ }): any;
9
+ }>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToRuntimeProps<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
20
+ type __VLS_WithTemplateSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,73 @@
1
+ import FormField from './FormField.vue';
2
+ import { useFormValidation } from './validation/utils/useFormValidation';
3
+ export type * from './validation/utils/types';
4
+ declare const FormFieldTypes: () => (({
5
+ new (...args: any[]): {
6
+ $: import("vue").ComponentInternalInstance;
7
+ $data: {};
8
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
9
+ validationPath: {
10
+ type: import("vue").PropType<string>;
11
+ required: true;
12
+ };
13
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
14
+ $attrs: {
15
+ [x: string]: unknown;
16
+ };
17
+ $refs: {
18
+ [x: string]: unknown;
19
+ };
20
+ $slots: Readonly<{
21
+ [name: string]: import("vue").Slot;
22
+ }>;
23
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
24
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
25
+ $emit: (event: string, ...args: any[]) => void;
26
+ $el: any;
27
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
28
+ validationPath: {
29
+ type: import("vue").PropType<string>;
30
+ required: true;
31
+ };
32
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & {
33
+ beforeCreate?: (() => void) | (() => void)[];
34
+ created?: (() => void) | (() => void)[];
35
+ beforeMount?: (() => void) | (() => void)[];
36
+ mounted?: (() => void) | (() => void)[];
37
+ beforeUpdate?: (() => void) | (() => void)[];
38
+ updated?: (() => void) | (() => void)[];
39
+ activated?: (() => void) | (() => void)[];
40
+ deactivated?: (() => void) | (() => void)[];
41
+ beforeDestroy?: (() => void) | (() => void)[];
42
+ beforeUnmount?: (() => void) | (() => void)[];
43
+ destroyed?: (() => void) | (() => void)[];
44
+ unmounted?: (() => void) | (() => void)[];
45
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
46
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
47
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void)[];
48
+ };
49
+ $forceUpdate: () => void;
50
+ $nextTick: typeof import("vue").nextTick;
51
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
52
+ } & Readonly<import("vue").ExtractPropTypes<{
53
+ validationPath: {
54
+ type: import("vue").PropType<string>;
55
+ required: true;
56
+ };
57
+ }>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
58
+ __isFragment?: never;
59
+ __isTeleport?: never;
60
+ __isSuspense?: never;
61
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
62
+ validationPath: {
63
+ type: import("vue").PropType<string>;
64
+ required: true;
65
+ };
66
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
67
+ $slots: {
68
+ default?(_: {
69
+ validationPath: string;
70
+ }): any;
71
+ };
72
+ })) | (<T_1 extends object>({ formState, formValidationSchema, }: import("./validation/utils/types").UseFormValidationType<T_1>) => import("./validation/utils/types").UseFormValidationReponseType<T_1>))[];
73
+ export { FormField, useFormValidation, FormFieldTypes };
@@ -0,0 +1,3 @@
1
+ import { ValidationErrorsType } from './types';
2
+ export declare const scrollToElementByClass: (elementClass: string, index?: number) => void;
3
+ export declare const scrollToFirstInvalidElement: <T>(validationErrors: Partial<Record<keyof T, string>>) => void;
@@ -0,0 +1,25 @@
1
+ import { Ref } from 'vue';
2
+ import * as yup from 'yup';
3
+ export type ValidationErrorsType<T> = Partial<Record<keyof T, string>>;
4
+ export type ValidationStateType<T> = {
5
+ isValid: boolean;
6
+ errors: ValidationErrorsType<T>;
7
+ };
8
+ export declare enum ScrollToAttributes {
9
+ ID = "id",
10
+ CLASS = "class",
11
+ DATA_TESTID = "data-testid"
12
+ }
13
+ type ScrollToElementsSchemaRecordType = Partial<Record<ScrollToAttributes, string>>;
14
+ export type FormValidationScrollElementsSchemaType<T> = Partial<Record<keyof T, ScrollToElementsSchemaRecordType>>;
15
+ export type FormValidationSchemaYupType<T> = Record<keyof T, yup.AnySchema<any, any, any, any>>;
16
+ export type UseFormValidationType<T> = {
17
+ formState: T;
18
+ formValidationSchema: FormValidationSchemaYupType<T>;
19
+ };
20
+ export type UseFormValidationReponseType<T> = {
21
+ validationErrors: ValidationErrorsType<T>;
22
+ isValid: Ref<boolean>;
23
+ validate: (formRef?: Ref<HTMLElement>) => void;
24
+ };
25
+ export {};
@@ -0,0 +1 @@
1
+ export declare const convertFlatToNested: (flatObject: any) => {};
@@ -0,0 +1,3 @@
1
+ import { FormValidationSchemaYupType, ValidationStateType, UseFormValidationType, UseFormValidationReponseType } from './types';
2
+ export declare const yupValidation: <T>(schema: FormValidationSchemaYupType<T>, formState: T) => ValidationStateType<T>;
3
+ export declare const useFormValidation: <T extends object>({ formState, formValidationSchema, }: UseFormValidationType<T>) => UseFormValidationReponseType<T>;
@@ -19,7 +19,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
19
19
  mandatory: boolean;
20
20
  testId: string;
21
21
  }>, {
22
- content?(_: {}): any;
22
+ default?(_: {}): any;
23
23
  }>;
24
24
  export default _default;
25
25
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,7 +1,7 @@
1
1
  import o from "./FormRow.vue2.js";
2
2
  /* empty css */import _ from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../FormRow.vue_vue_type_style_index_0_scoped_54a11bf8_lang.css"; //*');
4
- const p = /* @__PURE__ */ _(o, [["__scopeId", "data-v-54a11bf8"]]);
3
+ // import "../../FormRow.vue_vue_type_style_index_0_scoped_8daca9c2_lang.css"; //*');
4
+ const t = /* @__PURE__ */ _(o, [["__scopeId", "data-v-8daca9c2"]]);
5
5
  export {
6
- p as default
6
+ t as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import "../../FormRow.vue_vue_type_style_index_0_scoped_54a11bf8_lang.css"; import { defineComponent as c, openBlock as t, createElementBlock as i, createElementVNode as a, createVNode as m, unref as o, withCtx as n, createTextVNode as l, toDisplayString as u, createBlock as f, createCommentVNode as r, renderSlot as y } from "vue";
2
- import d from "../typography/v4/Typography.vue.js";
1
+ import "../../FormRow.vue_vue_type_style_index_0_scoped_8daca9c2_lang.css"; import { defineComponent as c, openBlock as t, createElementBlock as i, createElementVNode as a, createVNode as m, unref as o, withCtx as l, createTextVNode as d, toDisplayString as u, createBlock as f, createCommentVNode as r, renderSlot as y } from "vue";
2
+ import n from "../typography/v4/Typography.vue.js";
3
3
  const p = {
4
4
  key: 0,
5
5
  class: "form-row"
@@ -16,24 +16,24 @@ const p = {
16
16
  "data-testid": e.testId,
17
17
  class: "label-container"
18
18
  }, [
19
- m(o(d), { variant: "inputLabel" }, {
20
- default: n(() => [
21
- l(u(e.label), 1)
19
+ m(o(n), { variant: "inputLabel" }, {
20
+ default: l(() => [
21
+ d(u(e.label), 1)
22
22
  ]),
23
23
  _: 1
24
24
  }),
25
- e.mandatory ? (t(), f(o(d), {
25
+ e.mandatory ? (t(), f(o(n), {
26
26
  key: 0,
27
27
  class: "mandatory"
28
28
  }, {
29
- default: n(() => [
30
- l("*")
29
+ default: l(() => [
30
+ d("*")
31
31
  ]),
32
32
  _: 1
33
33
  })) : r("", !0)
34
34
  ], 8, _),
35
35
  a("div", h, [
36
- y(s.$slots, "content", {}, void 0, !0)
36
+ y(s.$slots, "default", {}, void 0, !0)
37
37
  ])
38
38
  ])) : r("", !0);
39
39
  }
@@ -514,7 +514,7 @@ declare const FormCardTypes: () => (({
514
514
  testId: string;
515
515
  }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
516
516
  $slots: {
517
- content?(_: {}): any;
517
+ default?(_: {}): any;
518
518
  };
519
519
  })))[];
520
520
  export { FormRow, FormCard, CardPanel, FoldableSection, FormCardTypes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.0.2-rc.4",
3
+ "version": "2.1.0-rc.0",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -60,7 +60,8 @@
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0",
62
62
  "vue": "^3.2.31",
63
- "vuedraggable": "^4.1.0"
63
+ "vuedraggable": "^4.1.0",
64
+ "yup": "^1.3.3"
64
65
  },
65
66
  "peerDependencies": {
66
67
  "@vueuse/core": "^8.7.5",
@@ -217,7 +218,8 @@
217
218
  "./typography": "./components/typography/v4/index.js",
218
219
  "./themeWrapper": "./components/ThemeWrapper/index.js",
219
220
  "./inlineCopy": "./components/inlineCopy/index.js",
220
- "./appHeader": "./components/appHeader/index.js"
221
+ "./appHeader": "./components/appHeader/index.js",
222
+ "./forms": "./components/forms/index.js"
221
223
  },
222
224
  "typesVersions": {
223
225
  "*": {
@@ -424,6 +426,9 @@
424
426
  ],
425
427
  "appHeader": [
426
428
  "./components/appHeader/index.d.ts"
429
+ ],
430
+ "forms": [
431
+ "./components/forms/index.d.ts"
427
432
  ]
428
433
  }
429
434
  },
@@ -1 +0,0 @@
1
- .form-row[data-v-54a11bf8]{display:flex;height:auto;gap:1.5rem;align-items:center}.form-row .label-container[data-v-54a11bf8]{display:flex;min-height:1.75rem;height:100%;width:12.875rem;align-items:center;gap:.25rem;flex-shrink:0}.form-row .label-container .mandatory[data-v-54a11bf8]{color:var(--error-main);padding-top:.1875rem}.form-row .content[data-v-54a11bf8]{display:flex;flex-direction:column;align-items:stretch;gap:.25rem;width:100%}