plugin-ui-for-kzt 0.0.18 → 0.0.20

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.
Files changed (35) hide show
  1. package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +9 -1
  2. package/dist/components/BaseField/BaseField.vue.d.ts +98 -0
  3. package/dist/components/BaseInput/BaseInput.vue.d.ts +16 -14
  4. package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +13 -15
  5. package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +7 -9
  6. package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +7 -12
  7. package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +7 -12
  8. package/dist/components/BaseSiteInput/BaseSiteInput.vue.d.ts +11 -7
  9. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +7 -12
  10. package/dist/components/BaseTooltip/BaseTooltip.vue.d.ts +1 -1
  11. package/dist/composables/kit/state.d.ts +1 -1
  12. package/dist/index.d.ts +2 -1
  13. package/dist/index.js +1 -1
  14. package/example/App.vue +172 -133
  15. package/package.json +1 -1
  16. package/src/components/BaseField/BaseField.vue +184 -0
  17. package/src/components/BaseField/README.md +85 -0
  18. package/src/components/BaseInput/BaseInput.vue +161 -210
  19. package/src/components/BaseInputCalendar/BaseInputCalendar.vue +10 -7
  20. package/src/components/BaseInputCurrency/BaseInputCurrency.vue +56 -54
  21. package/src/components/BaseInputEmail/BaseInputEmail.vue +2 -4
  22. package/src/components/BaseInputPhone/BaseInputPhone.vue +29 -48
  23. package/src/components/BaseSelect/BaseSelect.vue +9 -52
  24. package/src/components/BaseSiteInput/BaseSiteInput.vue +10 -20
  25. package/src/components/BaseTextarea/BaseTextarea.vue +3 -30
  26. package/src/components/BaseUpload/BaseUpload.vue +1 -1
  27. package/src/composables/kit/state.ts +1 -1
  28. package/src/index.ts +5 -2
  29. package/src/styles/index.scss +87 -2
  30. package/src/styles/root.scss +1 -0
  31. package/src/styles/variables.scss +2 -1
  32. package/src/types/calendar.d.ts +2 -0
  33. package/src/types/field.d.ts +12 -0
  34. package/src/types/input.d.ts +26 -8
  35. package/webpack.config.js +1 -1
@@ -8,7 +8,7 @@ export function useKitState(props: ICoreState) {
8
8
  '--is-selected': props.selected,
9
9
  '--is-active': props.active,
10
10
  '--is-required': props.required,
11
- '--is-error': props.error,
11
+ '--is-error': Boolean(props.error || (typeof props.error === 'string' ? props.error.length > 0 : false)),
12
12
  '--is-loading': props.loading,
13
13
  '--is-disabled': props.disabled,
14
14
  },
package/src/index.ts CHANGED
@@ -35,6 +35,7 @@ import BaseUpload from "./components/BaseUpload/BaseUpload.vue";
35
35
  import BaseBadge from "./components/BaseBadge/BaseBadge.vue";
36
36
  import BaseTag from "./components/BaseTag/BaseTag.vue";
37
37
  import BaseBadgeGroup from "./components/BaseBadge/BaseBadgeGroup.vue";
38
+ import BaseField from "./components/BaseField/BaseField.vue";
38
39
 
39
40
  const components = {
40
41
  BaseModal,
@@ -67,7 +68,8 @@ const components = {
67
68
  BaseSegmentedButtons,
68
69
  BaseChips,
69
70
  BaseSwiper,
70
- BaseUpload
71
+ BaseUpload,
72
+ BaseField
71
73
  };
72
74
 
73
75
  // Функция для загрузки sprite.svg
@@ -153,5 +155,6 @@ export {
153
155
  BaseSegmentedButtons,
154
156
  BaseChips,
155
157
  BaseSwiper,
156
- BaseUpload
158
+ BaseUpload,
159
+ BaseField
157
160
  };
@@ -1,4 +1,89 @@
1
- body {
2
- font-family: 'Roboto Condensed', 'Helvetica Neue', sans-serif;
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ margin: 0;
5
+ padding: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ html {
3
10
  font-size: 100%;
11
+ line-height: 1.15;
12
+ -webkit-text-size-adjust: 100%;
13
+ }
14
+
15
+ body {
16
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
17
+ line-height: 1.5;
18
+ }
19
+
20
+ ul,
21
+ ol {
22
+ list-style: none;
23
+ }
24
+
25
+ a {
26
+ color: inherit;
27
+ text-decoration: none;
28
+ }
29
+
30
+ img,
31
+ svg {
32
+ display: block;
33
+ max-width: 100%;
34
+ height: auto;
35
+ }
36
+
37
+ button,
38
+ input,
39
+ select,
40
+ textarea {
41
+ font-family: inherit;
42
+ font-size: inherit;
43
+ line-height: inherit;
44
+ color: inherit;
45
+ background: none;
46
+ border: none;
47
+ outline: none;
48
+ appearance: none;
49
+ }
50
+
51
+ form {
52
+ margin: 0;
53
+ }
54
+
55
+ table {
56
+ border-collapse: collapse;
57
+ border-spacing: 0;
58
+ }
59
+
60
+ h1,
61
+ h2,
62
+ h3,
63
+ h4,
64
+ h5,
65
+ h6 {
66
+ font-size: inherit;
67
+ font-weight: inherit;
68
+ }
69
+
70
+ blockquote,
71
+ q {
72
+ quotes: none;
73
+ }
74
+
75
+ hr {
76
+ border: 0;
77
+ height: 1px;
78
+ background: var(--primary-black-300, #ccc);
79
+ }
80
+
81
+ fieldset {
82
+ border: 0;
83
+ margin: 0;
84
+ padding: 0;
85
+ }
86
+
87
+ legend {
88
+ padding: 0;
4
89
  }
@@ -1,3 +1,4 @@
1
+ @import "./index.scss";
1
2
  :root {
2
3
  /* Primary colors */
3
4
  --primary-blue-deep: #0085BE;
@@ -33,7 +33,8 @@ $retina: '(min-resolution: 1.5dppx), (min-resolution: 144dpi)';
33
33
 
34
34
  @mixin focused {
35
35
  &:focus,
36
- &:focus-visible {
36
+ &:focus-visible,
37
+ &:focus-within {
37
38
  @content;
38
39
  }
39
40
  }
@@ -5,10 +5,12 @@ import type { InputProps } from './input';
5
5
  export type DateRange = [Date, Date] | Date | string | null;
6
6
 
7
7
  export interface IBaseCalendarProps {
8
+ id: string
8
9
  modelValue?: DateRange
9
10
  range?: boolean | RangeConfig | undefined
10
11
  minDate?: Date | null
11
12
  readonly?: boolean
13
+ error?: string | boolean
12
14
  }
13
15
 
14
16
  export type TCoreCalendarProps = IBaseCalendarProps & ICoreSize;
@@ -0,0 +1,12 @@
1
+ import type { ICoreSize, ICoreState } from './utils';
2
+
3
+ interface IFieldProps {
4
+ id: string
5
+ label: string
6
+ hint?: string
7
+ error?: string | boolean
8
+ focusable?: boolean
9
+ tabIndex?: number
10
+ }
11
+
12
+ export type TFieldProps = IFieldProps & ICoreSize & ICoreState;
@@ -8,19 +8,16 @@ export interface InputProps {
8
8
  mask?: string
9
9
  type?: string
10
10
  placeholder?: string
11
- error?: string | boolean
11
+ error?: string | boolean;
12
12
  readonly?: boolean
13
- hint?: string
14
- label?: string
15
13
  tooltipOptions?: ITooltipProps
16
14
  validationText?: string
15
+ focusable?: boolean
17
16
  }
18
17
 
19
- interface IPropsBaseSiteInput extends InputProps {}
20
-
21
18
  type TTextareaProps = Omit<InputProps, 'type'>;
22
19
 
23
- export type ICorePropsBaseSiteInput = Omit<IPropsBaseSiteInput, 'id'> & ICoreSize;
20
+ export type ICorePropsBaseSiteInput = InputProps & ICoreSize;
24
21
 
25
22
  export type ICoreInputProps = InputProps & ICoreSize & ICoreState;
26
23
 
@@ -28,14 +25,29 @@ export type ICoreTextareaProps = ICoreState & TTextareaProps & ICoreSize;
28
25
 
29
26
  export type TSelectValue = Nullable<string | number | boolean>;
30
27
 
28
+ type TOptionPhoneCountry = 'KZ' | 'RU' | 'KG' | 'UZ';
29
+ type TOptionCurrency = 'KZT' | 'RUB' | 'KGS' | 'UZS';
30
+ export interface IOptionsSelect<T extends string> {
31
+ id: string;
32
+ name: string;
33
+ value: T;
34
+ mask: string;
35
+ }
36
+
37
+ export interface IOptionsPhone extends IOptionsSelect<TOptionPhoneCountry> {
38
+ icon: TOptionPhoneCountry;
39
+ }
40
+
41
+ export interface IOptionsCurrency extends IOptionsSelect<TOptionCurrency> {
42
+ symbol: string;
43
+ }
44
+
31
45
  export interface ICoreSelectOption {
32
46
  id: TSelectValue
33
47
  name: string
34
48
  disabled?: boolean
35
49
  icon?: string
36
50
  style?: Record<string, string>
37
-
38
-
39
51
  }
40
52
 
41
53
  export interface ICoreSelectBaseProps {
@@ -53,4 +65,10 @@ export interface ICoreSelectBaseProps {
53
65
  hint?: string
54
66
  }
55
67
 
68
+ export interface ISelectSlotProps {
69
+ item: ICoreSelectBaseProps;
70
+ index: number;
71
+ active: boolean;
72
+ }
73
+
56
74
  export type ICoreSelectProps = ICoreSelectBaseProps & ICoreSize & ICoreState & ICoreStyle & ICorePlaceholder;
package/webpack.config.js CHANGED
@@ -97,7 +97,7 @@ module.exports = (env, argv) => {
97
97
  devServer: {
98
98
  static: path.join(__dirname, "example"),
99
99
  compress: true,
100
- port: 9000,
100
+ port: 9001,
101
101
  hot: false,
102
102
  liveReload: true,
103
103
  open: true,