plugin-ui-for-kzt 0.0.8 → 0.0.10

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 (90) hide show
  1. package/README.md +21 -9
  2. package/example/App.vue +355 -0
  3. package/example/index.html +12 -0
  4. package/example/main.ts +8 -0
  5. package/example/shims-vue.d.ts +5 -0
  6. package/package.json +17 -7
  7. package/src/assets/icons/arrow-down.svg +3 -0
  8. package/src/assets/icons/calendar.svg +12 -0
  9. package/src/assets/icons/checkbox-circle.svg +3 -0
  10. package/src/assets/icons/checkbox.svg +3 -0
  11. package/src/assets/icons/email-sms.svg +4 -0
  12. package/src/assets/icons/help.svg +3 -0
  13. package/src/assets/icons/kg.svg +16 -0
  14. package/src/assets/icons/kz.svg +42 -0
  15. package/src/assets/icons/loader.svg +13 -0
  16. package/src/assets/icons/ru.svg +12 -0
  17. package/src/assets/icons/uz.svg +26 -0
  18. package/src/components/BaseBreadCrumbs/BaseBreadCrumbs.vue +142 -0
  19. package/src/components/BaseBreadCrumbs/README.md +49 -0
  20. package/src/components/BaseButton/BaseButton.vue +489 -0
  21. package/src/components/BaseButton/README.md +53 -0
  22. package/src/components/BaseCalendar/BaseCalendar.vue +231 -0
  23. package/src/components/BaseCalendar/README.md +126 -0
  24. package/src/components/BaseCheckbox/BaseCheckbox.vue +252 -0
  25. package/src/components/BaseCheckbox/README.md +110 -0
  26. package/src/components/BaseDropdown/BaseDropdown.vue +160 -0
  27. package/src/components/BaseDropdown/README.md +91 -0
  28. package/src/components/BaseIcon/BaseIcon.vue +47 -0
  29. package/src/components/BaseIcon/README.md +35 -0
  30. package/src/components/BaseInput/BaseInput.vue +300 -0
  31. package/src/components/BaseInput/README.md +85 -0
  32. package/src/components/BaseInputCalendar/BaseInputCalendar.vue +242 -0
  33. package/src/components/BaseInputCalendar/README.md +84 -0
  34. package/src/components/BaseInputCurrency/BaseInputCurrency.vue +198 -0
  35. package/src/components/BaseInputCurrency/README.md +57 -0
  36. package/src/components/BaseInputEmail/BaseInputEmail.vue +89 -0
  37. package/src/components/BaseInputEmail/README.md +71 -0
  38. package/src/components/BaseInputPhone/BaseInputPhone.vue +175 -0
  39. package/src/components/BaseLoader/BaseLoader.vue +45 -0
  40. package/src/components/BaseLoader/README.md +29 -0
  41. package/src/components/BaseOpenedListItem/BaseOpenedListItem.vue +216 -0
  42. package/src/components/BaseOpenedListItem/README.md +67 -0
  43. package/src/components/BaseRadio/BaseRadio.vue +283 -0
  44. package/src/components/BaseRadio/README.md +74 -0
  45. package/src/components/BaseSegmentedButtons/BaseSegmentedButtons.vue +89 -0
  46. package/src/components/BaseSegmentedButtons/README.md +75 -0
  47. package/src/components/BaseSelect/BaseSelect.vue +370 -0
  48. package/src/components/BaseSelect/README.md +95 -0
  49. package/src/components/BaseSiteInput/BaseSiteInput.vue +153 -0
  50. package/src/components/BaseTextarea/BaseTextarea.vue +212 -0
  51. package/src/components/BaseTextarea/README.md +75 -0
  52. package/src/components/BaseToggle/BaseToggle.vue +271 -0
  53. package/src/components/BaseToggle/README.md +76 -0
  54. package/src/components/BaseTooltip/BaseTooltip.vue +318 -0
  55. package/src/components/BaseTooltip/README.md +74 -0
  56. package/src/components/Modal/Modal.vue +21 -23
  57. package/src/components/Spinner/Spinner.vue +2 -1
  58. package/src/composables/kit/color.ts +14 -0
  59. package/src/composables/kit/interactive.ts +53 -0
  60. package/src/composables/kit/size.ts +15 -0
  61. package/src/composables/kit/state.ts +28 -0
  62. package/src/composables/kit/style.ts +18 -0
  63. package/src/composables/kit/utils.ts +7 -0
  64. package/src/icons/index.ts +9 -0
  65. package/src/index.ts +93 -2
  66. package/src/plugins/modalPlugin.ts +22 -9
  67. package/src/shims-context.d.ts +19 -0
  68. package/src/styles/index.scss +2 -1
  69. package/src/styles/root.scss +167 -0
  70. package/src/styles/variables.scss +160 -0
  71. package/src/types/breadcrumbs.d.ts +13 -0
  72. package/src/types/button.d.ts +13 -0
  73. package/src/types/calendar.d.ts +16 -0
  74. package/src/types/checkbox-radio.d.ts +15 -0
  75. package/src/types/dropdown.d.ts +20 -0
  76. package/src/types/icon.d.ts +8 -0
  77. package/src/types/input.d.ts +56 -0
  78. package/src/types/toggle.d.ts +12 -0
  79. package/src/types/tooltip.d.ts +8 -0
  80. package/src/types/utils.d.ts +37 -0
  81. package/src/vue-virtual-scroller.d.ts +9 -0
  82. package/tsconfig.json +6 -3
  83. package/webpack.config.js +90 -35
  84. package/dist/index.js +0 -4922
  85. package/dist/types/components/Toaster/timer.d.ts +0 -12
  86. package/dist/types/index.d.ts +0 -11
  87. package/dist/types/plugins/modalPlugin.d.ts +0 -16
  88. package/dist/types/plugins/toasterPlugin.d.ts +0 -26
  89. package/dist/types/store/modal.d.ts +0 -11
  90. package/dist/types/types/index.d.ts +0 -4
@@ -0,0 +1,56 @@
1
+ import type { Nullable } from './utils';
2
+ import type { ITooltipProps } from './tooltip';
3
+ import type { ICorePlaceholder, ICoreSize, ICoreState, ICoreStyle } from './utils';
4
+
5
+ export interface InputProps {
6
+ modelValue: string
7
+ id: string
8
+ mask?: string
9
+ type?: string
10
+ placeholder?: string
11
+ error?: string | boolean
12
+ readonly?: boolean
13
+ hint?: string
14
+ label?: string
15
+ tooltipOptions?: ITooltipProps
16
+ validationText?: string
17
+ }
18
+
19
+ interface IPropsBaseSiteInput extends InputProps {}
20
+
21
+ type TTextareaProps = Omit<InputProps, 'type'>;
22
+
23
+ export type ICorePropsBaseSiteInput = Omit<IPropsBaseSiteInput, 'id'> & ICoreSize;
24
+
25
+ export type ICoreInputProps = InputProps & ICoreSize & ICoreState;
26
+
27
+ export type ICoreTextareaProps = ICoreState & TTextareaProps & ICoreSize;
28
+
29
+ export type TSelectValue = Nullable<string | number | boolean>;
30
+
31
+ export interface ICoreSelectOption {
32
+ id: TSelectValue
33
+ name: string
34
+ disabled?: boolean
35
+ icon?: string
36
+ style?: [key: string]
37
+
38
+ [key: string]: string
39
+ }
40
+
41
+ export interface ICoreSelectBaseProps {
42
+ id: string
43
+ icon?: string
44
+ name?: string
45
+ readonly?: boolean
46
+ disabled?: boolean
47
+ options?: ICoreSelectOption[]
48
+ parentWidth?: boolean
49
+ multiple?: boolean
50
+ style?: [key: string]
51
+ transitionName?: string
52
+ label?: string
53
+ hint?: string
54
+ }
55
+
56
+ export type ICoreSelectProps = ICoreSelectBaseProps & ICoreSize & ICoreState & ICoreStyle & ICorePlaceholder;
@@ -0,0 +1,12 @@
1
+ import type { ICoreSize, ICoreState } from './utils';
2
+
3
+ interface ICoreToggleBaseProps {
4
+ id: string
5
+ modelValue: boolean
6
+ readonly?: boolean
7
+ label?: string
8
+ subLabel?: string
9
+ labelPosition?: 'left' | 'right'
10
+ }
11
+
12
+ export type ICoreToggleProps = ICoreToggleBaseProps & ICoreSize & ICoreState;
@@ -0,0 +1,8 @@
1
+ export interface ITooltipProps {
2
+ title: string
3
+ content?: string
4
+ arrow?: boolean
5
+ theme?: 'dark' | 'light'
6
+ position?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'left' | 'right'
7
+ trigger?: 'hover' | 'click'
8
+ }
@@ -0,0 +1,37 @@
1
+ export type Nullable<T> = T | null;
2
+
3
+ export type TCoreSize = 'large' | 'medium' | 'small' | 'extra-small' | 'custom';
4
+
5
+ export type TCoreColor = string | 'primary' | 'secondary' | 'tertiary-gray' | 'tertiary-blue' | 'quaternary-gray' | 'quaternary-blue' | 'link-blue' | 'link-critical' | 'link-gray' | 'custom';
6
+ export type TCoreInteractiveTag = 'link' | 'button' | 'span' | 'div' | 'a';
7
+
8
+ export interface ICoreSize {
9
+ size?: TCoreSize
10
+ }
11
+
12
+ export interface ICoreColor {
13
+ color?: TCoreColor
14
+ }
15
+
16
+ export interface ICoreInteractive {
17
+ tag?: TCoreInteractiveTag
18
+ }
19
+
20
+ export interface ICorePlaceholder {
21
+ placeholder?: string
22
+ }
23
+
24
+ export interface ICoreState {
25
+ selected?: boolean
26
+ active?: boolean
27
+ disabled?: boolean
28
+ required?: boolean
29
+ error?: Nullable<string | number | boolean> | undefined
30
+ loading?: boolean
31
+ }
32
+
33
+ export interface ICoreStyle {
34
+ outline?: boolean
35
+ rounded?: boolean
36
+ underline?: boolean
37
+ }
@@ -0,0 +1,9 @@
1
+ declare module 'vue-virtual-scroller' {
2
+
3
+ import type { DefineComponent } from 'vue';
4
+
5
+ export const DynamicScroller: DefineComponent;
6
+
7
+ export const DynamicScrollerItem: DefineComponent;
8
+
9
+ }
package/tsconfig.json CHANGED
@@ -2,11 +2,14 @@
2
2
  "compilerOptions": {
3
3
  "target": "ESNext",
4
4
  "module": "ESNext",
5
+ "types": ["node"],
5
6
  "moduleResolution": "Node",
6
7
  "strict": true,
7
8
  "esModuleInterop": true,
8
9
  "skipLibCheck": true,
9
10
  "jsx": "preserve",
11
+ "declaration": true,
12
+ "declarationDir": "./dist",
10
13
  "lib": [
11
14
  "dom",
12
15
  "esnext"
@@ -18,14 +21,14 @@
18
21
  }
19
22
  },
20
23
  "include": [
21
-
22
24
  "src/**/*",
23
25
  "src/**/*.ts",
24
26
  "src/**/*.vue",
25
- "shims-vue.d.ts"
27
+ "shims-vue.d.ts",
28
+ "shims-context.d.ts"
26
29
  ],
27
30
  "exclude": [
28
31
  "node_modules",
29
32
  "dist"
30
33
  ]
31
- }
34
+ }
package/webpack.config.js CHANGED
@@ -1,15 +1,20 @@
1
- const path = require('path');
2
- const {VueLoaderPlugin} = require('vue-loader');
1
+ const path = require("path");
2
+ const { VueLoaderPlugin } = require("vue-loader");
3
+ const SpriteLoaderPlugin = require("svg-sprite-loader/plugin");
3
4
 
4
- module.exports = {
5
- entry: './src/index.ts',
6
- mode: "none",
5
+ module.exports = (env, argv) => {
6
+ const isProduction = argv.mode === "production";
7
+
8
+ return {
9
+ mode: isProduction ? "production" : "development",
10
+ entry: isProduction ? "./src/index.ts" : "./example/main.ts",
7
11
  output: {
8
- path: __dirname + "/dist",
9
- filename: "index.js",
10
- libraryTarget: "umd", // Universal Module Definition
11
- library: "ModalPluginNikitas",
12
- globalObject: "this"
12
+ path: path.resolve(__dirname, "dist"),
13
+ filename: "index.js",
14
+ publicPath: "/",
15
+ libraryTarget: isProduction ? "umd" : undefined,
16
+ library: isProduction ? "plugin-ui-for-kzt" : undefined,
17
+ globalObject: "this",
13
18
  },
14
19
  // output: {
15
20
  // filename: 'index.js',
@@ -19,38 +24,88 @@ module.exports = {
19
24
  // umdNamedDefine: true,
20
25
  // },
21
26
  resolve: {
22
- extensions: ['.js', '.ts', '.vue', '.json'],
23
- alias: {
24
- '@': path.resolve(__dirname, 'src'),
25
- vue: 'vue/dist/vue.runtime.esm-bundler.js',
26
- },
27
+ extensions: [".js", ".ts", ".vue", ".json"],
28
+ alias: {
29
+ "@": path.resolve(__dirname, "src"),
30
+ vue: "vue/dist/vue.runtime.esm-bundler.js",
31
+ },
27
32
  },
28
33
 
29
34
  module: {
30
- rules: [
31
- {
32
- test: /\.ts$/,
33
- loader: 'ts-loader',
34
- options: {
35
- appendTsSuffixTo: [/\.vue$/],
36
- },
37
- },
35
+ rules: [
36
+ {
37
+ test: /\.ts$/,
38
+ loader: "ts-loader",
39
+ options: {
40
+ appendTsSuffixTo: [/\.vue$/],
41
+ },
42
+ },
43
+ {
44
+ test: /\.vue$/,
45
+ loader: "vue-loader",
46
+ },
47
+ {
48
+ test: /\.scss$/,
49
+ use: ["style-loader", "css-loader", "sass-loader"],
50
+ },
51
+ {
52
+ test: /\.css$/i,
53
+ use: ["style-loader", "css-loader"],
54
+ },
55
+ {
56
+ test: /\.svg$/,
57
+ use: [
38
58
  {
39
- test: /\.vue$/,
40
- loader: 'vue-loader',
59
+ loader: "svg-sprite-loader",
60
+ options: {
61
+ extract: true,
62
+ spriteFilename: "sprite.svg",
63
+ publicPath: "/",
64
+ },
41
65
  },
42
66
  {
43
- test: /\.scss$/,
44
- use: ['vue-style-loader', 'css-loader', 'sass-loader'],
67
+ loader: "svgo-loader",
68
+ options: {
69
+ plugins: [
70
+ {
71
+ name: "removeTitle",
72
+ active: true,
73
+ },
74
+ {
75
+ name: "convertColors",
76
+ params: {
77
+ shorthex: true,
78
+ },
79
+ },
80
+ {
81
+ name: "removeComments",
82
+ active: true,
83
+ },
84
+ ],
85
+ },
45
86
  },
46
- {
47
- test: /\.svg$/,
48
- use: ["file-loader"],
49
- }
50
- ],
87
+ ],
88
+ },
89
+ ],
51
90
  },
52
- plugins: [new VueLoaderPlugin()],
53
- externals: {
54
- vue: 'vue', // Vue will not be bundled; it’s an external dependency
91
+ plugins: [new VueLoaderPlugin(), new SpriteLoaderPlugin()],
92
+ externals: isProduction
93
+ ? {
94
+ vue: "vue", // Vue will not be bundled; it’s an external dependency
95
+ }
96
+ : {},
97
+ devServer: {
98
+ static: path.join(__dirname, "example"),
99
+ compress: true,
100
+ port: 9000,
101
+ hot: false,
102
+ liveReload: true,
103
+ open: true,
104
+ historyApiFallback: true,
105
+ devMiddleware: {
106
+ publicPath: "/",
107
+ },
55
108
  },
109
+ devtool: isProduction ? false : "source-map",
110
+ };
56
111
  };