@ldmjs/ui 1.0.0 → 1.0.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.
@@ -0,0 +1,171 @@
1
+ .small-input {
2
+ .v-text-field__prefix {
3
+ min-height: var(--input-height);
4
+ padding: 0 0 0 8px;
5
+
6
+ .v-text-field__prefix__text {
7
+ margin: 0;
8
+ }
9
+
10
+ & + input.v-field__input {
11
+ padding-left: 0px !important;
12
+ }
13
+ }
14
+
15
+ &.v-field {
16
+ background-color: var(--white);
17
+ }
18
+
19
+ & .v-field__input {
20
+ min-height: var(--input-height);
21
+ }
22
+
23
+ &.password {
24
+ .v-field__input {
25
+ font-size: var(--title-font-size) !important;
26
+ }
27
+ }
28
+
29
+ &:not(.v-combobox):not(.v-select) {
30
+ .v-field__input {
31
+ height: var(--input-height);
32
+ }
33
+ }
34
+
35
+ .v-field-label:not(.v-field-label--floating) {
36
+ transform: unset !important;
37
+ }
38
+ }
39
+
40
+ body {
41
+ .v-field {
42
+ font-size: var(--font-size) !important;
43
+ background-color: var(--white);
44
+ }
45
+ .v-label.v-field-label {
46
+ color: var(--grey);
47
+ top: unset !important;
48
+ &:not(.v-field-label--floating) {
49
+ height: 100%;
50
+ font-size: inherit !important;
51
+ }
52
+ }
53
+ .v-field.v-field--disabled {
54
+ opacity: 1;
55
+ }
56
+ .v-field-label--floating {
57
+ color: var(--grey);
58
+ font-size: var(--body-0-font-size) !important;
59
+ }
60
+ .v-field--variant-outlined {
61
+ .v-field__outline__start,
62
+ .v-field__outline__end {
63
+ border-color: var(--grey-l-5);
64
+ opacity: 1;
65
+ }
66
+ }
67
+ .v-label.v-label--clickable {
68
+ font-size: var(--font-size);
69
+ color: var(--text);
70
+ opacity: 1;
71
+ letter-spacing: 0;
72
+ }
73
+ .v-input {
74
+ &.v-textarea {
75
+ .v-field {
76
+ padding-right: 0px;
77
+ }
78
+ .v-field__input {
79
+ padding: 7px 6px;
80
+ }
81
+ }
82
+ &:not(.v-textarea) {
83
+ .v-field__input {
84
+ min-height: var(--input-height) !important;
85
+ padding: 4px 6px;
86
+ }
87
+ &.v-text-field--plain-underlined {
88
+ .v-field__input {
89
+ padding: 0;
90
+ }
91
+ }
92
+ }
93
+ &:not(.v-textarea):not(.v-select):not(.v-combobox) {
94
+ max-height: var(--input-max-height);
95
+ }
96
+ &:not(.v-select) .v-field__input {
97
+ input {
98
+ height: 100%;
99
+ }
100
+ }
101
+ &.v-text-field input {
102
+ margin-top: 0;
103
+ margin-bottom: 0;
104
+ }
105
+ &.v-input--disabled {
106
+ .v-field {
107
+ background-color: var(--grey-l-6);
108
+ color: var(--grey-l-3);
109
+ }
110
+ }
111
+ }
112
+ .v-field__input {
113
+ display: flex;
114
+ align-items: center;
115
+ font-size: inherit !important;
116
+ opacity: 1;
117
+ }
118
+ .v-input__details {
119
+ padding: 0 !important;
120
+ margin: 0 !important;
121
+ z-index: 1;
122
+ height: 20px;
123
+ .v-messages {
124
+ font-size: calc(var(--font-size) - 1px) !important;
125
+ }
126
+ }
127
+ .v-field--variant-outlined.v-field--focused .v-field__outline {
128
+ .v-field__outline__start {
129
+ border-top-width: 1px !important;
130
+ border-bottom-width: 1px !important;
131
+ border-inline-start-width: 1px !important;
132
+ border-color: var(--grey-l-4) !important;
133
+ }
134
+ .v-field__outline__end {
135
+ border-top-width: 1px !important;
136
+ border-bottom-width: 1px !important;
137
+ border-inline-end-width: 1px !important;
138
+ border-color: var(--grey-l-4) !important;
139
+ }
140
+ }
141
+ .v-select {
142
+ .v-select__selection {
143
+ margin: 0;
144
+ .v-select__selection-text {
145
+ display: inline-flex;
146
+ align-items: center;
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+ input.disabled {
153
+ background-color: var(--grey-l-6);
154
+ color: var(--grey-l-3);
155
+ }
156
+
157
+ input:-webkit-autofill,
158
+ input:-webkit-autofill:hover,
159
+ input:-webkit-autofill:focus textarea:-webkit-autofill,
160
+ textarea:-webkit-autofill:hover textarea:-webkit-autofill:focus,
161
+ select:-webkit-autofill,
162
+ select:-webkit-autofill:hover,
163
+ select:-webkit-autofill:focus {
164
+ -webkit-background-clip: text;
165
+ background-clip: text;
166
+ }
167
+
168
+ ::-webkit-input-placeholder {color: var(--grey-l-2)}
169
+ ::-moz-placeholder {color: var(--grey-l-2)}
170
+ input:-moz-placeholder {color: var(--grey-l-2)}
171
+ input:-ms-input-placeholder {color: var(--grey-l-2)}
@@ -0,0 +1,164 @@
1
+ :root {
2
+ --multiselect-height: calc(var(--input-height) - 2px);
3
+ }
4
+
5
+ .multiselect {
6
+ position: relative;
7
+ min-height: var(--multiselect-height);
8
+ flex-basis: 100%;
9
+ width: 100%;
10
+ font-family: 'Roboto';
11
+ font-size: var(--font-size);
12
+
13
+ &--with-right-button {
14
+ .multiselect__tags {
15
+ border-top-right-radius: 0 !important;
16
+ border-bottom-right-radius: 0 !important;
17
+ }
18
+ & + .v-btn {
19
+ border-top-left-radius: 0 !important;
20
+ border-bottom-left-radius: 0 !important;
21
+ border-left: none;
22
+ }
23
+ }
24
+
25
+ & .multiselect__single {
26
+ margin-left: 12px;
27
+ }
28
+
29
+ &__placeholder {
30
+ display: flex;
31
+ align-items: center;
32
+ height: var(--multiselect-height);
33
+ padding-left: 4px;
34
+ }
35
+
36
+ &--active {
37
+ & .multiselect__tags {
38
+ border-color: var(--grey-l-4) !important;
39
+ }
40
+ }
41
+
42
+ & .multiselect__tags {
43
+ min-height: var(--multiselect-height);
44
+ border: 1px solid var(--grey-l-5);
45
+ border-radius: var(--border-radius);
46
+
47
+ .multiselect__strong {
48
+ font-size: var(--font-size);
49
+ color: var(--grey);
50
+ }
51
+
52
+ &-wrap {
53
+ display: flex;
54
+ flex-wrap: wrap;
55
+ min-height: var(--multiselect-height);
56
+ padding-top: 3px;
57
+
58
+ .v-chip {
59
+ margin-left: 8px !important;
60
+ max-width: 228px;
61
+ }
62
+ }
63
+
64
+ & > span:not(.multiselect__placeholder) {
65
+ padding-top: 5px;
66
+ }
67
+ }
68
+
69
+ & input {
70
+ height: var(--multiselect-height);
71
+ padding-left: 8px;
72
+
73
+ &:focus {
74
+ outline: none;
75
+ }
76
+ }
77
+
78
+ &--list-empty {
79
+ .multiselect__content-wrapper {
80
+ border: none !important;
81
+ }
82
+ }
83
+
84
+ &__content-wrapper {
85
+ z-index: 99;
86
+ width: 100%;
87
+ display: block;
88
+ background-color: var(--white);
89
+ border-radius: var(--border-radius);
90
+ box-shadow: var(--shadow-1);
91
+ overflow: auto;
92
+ padding: 0;
93
+ border: 1px solid var(--grey-l-5);
94
+ border-top: none;
95
+ border-bottom-left-radius: 5px;
96
+ border-bottom-right-radius: 5px;
97
+
98
+ & ul {
99
+ width: 100%;
100
+ padding: 0;
101
+ }
102
+
103
+ & li {
104
+ min-height: var(--multiselect-height);
105
+ display: flex;
106
+ align-items: center;
107
+ cursor: pointer;
108
+ width: 100%;
109
+ font-size: var(--font-size);
110
+
111
+ & .multiselect__option {
112
+ width: 100%;
113
+ padding-left: 10px;
114
+ display: flex;
115
+ align-items: center;
116
+ text-decoration: none;
117
+ text-transform: none;
118
+ position: relative;
119
+ cursor: pointer;
120
+ }
121
+
122
+ & .multiselect__option--highlight {
123
+ background-color: var(--grey-l-4);
124
+ }
125
+ }
126
+ }
127
+
128
+ &.multiselect--arrow {
129
+ &.mobile {
130
+ height: 25px !important;
131
+ }
132
+ .multiselect__select {
133
+ position: absolute;
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ width: 40px;
138
+ height: var(--input-height);
139
+ right: 1px;
140
+ top: 1px;
141
+ &:before {
142
+ position: relative;
143
+ color: var(--grey);
144
+ border-style: solid;
145
+ border-width: 5px 5px 0;
146
+ border-color: var(--grey) transparent transparent;
147
+ content: '';
148
+ }
149
+ }
150
+ &.multiselect--active {
151
+ .multiselect__select {
152
+ &:before {
153
+ transform: rotate(180deg);
154
+ }
155
+ }
156
+ }
157
+ }
158
+
159
+ &--disabled {
160
+ .multiselect__tags {
161
+ background-color: var(--grey-l-6);
162
+ }
163
+ }
164
+ }
@@ -0,0 +1,16 @@
1
+ .v-toolbar {
2
+ &:not(.v-app-bar) {
3
+ .v-toolbar__content {
4
+ padding-top: 4px;
5
+ padding-bottom: 4px;
6
+ }
7
+ }
8
+
9
+ .v-toolbar__content > .v-btn:first-child {
10
+ margin-inline-start: 0;
11
+ }
12
+
13
+ .v-toolbar__content > .v-btn:last-child {
14
+ margin-inline-end: 0;
15
+ }
16
+ }
@@ -0,0 +1,25 @@
1
+ $font-size: 12px !default; // основной шрифт приложения
2
+ $input-height: 28px !default; // высота атомарного элемента ui (button, input)
3
+ $border-radius: 4px !default; // радиус скругления атомарного элемента ui
4
+ $chip-height: 20px !default; // высота элемента chip
5
+
6
+ $ld-tab-height: $input-height + 10px; // высота элемента ld-tab
7
+
8
+ $shadow-1: 0px 3px 4px 0px rgba(0, 0, 0, 0.14);
9
+ $shadow-2: 0px 3px 4px 0px rgba(0, 0, 0, 0.20);
10
+ $shadow-3: 0px 5px 6px 0px rgba(0, 0, 0, 0.30);
11
+ $shadow-4: 0px 16px 20px 0px rgba(0, 0, 0, 0.20);
12
+
13
+ :root {
14
+ --font-size--1: #{calc(var(--font-size) - 1px)};
15
+ --font-size: #{$font-size};
16
+ --font-size-2: #{calc(var(--font-size) + 2px)};
17
+ --input-height: #{$input-height};
18
+ --border-radius: #{$border-radius};
19
+ --chip-height: #{$chip-height};
20
+ --ld-tab-height: #{$ld-tab-height};
21
+ --shadow-1: #{$shadow-1};
22
+ --shadow-2: #{$shadow-2};
23
+ --shadow-3: #{$shadow-3};
24
+ --shadow-4: #{$shadow-4};
25
+ }
@@ -0,0 +1,10 @@
1
+ @import 'fonts';
2
+ @import 'colors';
3
+ @import 'variables';
4
+ @import 'buttons';
5
+ @import 'chip';
6
+ @import 'breadcrumbs';
7
+ @import 'inputs';
8
+ @import 'calendar';
9
+ @import 'toolbar';
10
+ @import 'multiselect';
@@ -0,0 +1,22 @@
1
+ export interface IDictionary<TValue> {
2
+ [index: string]: TValue;
3
+ }
4
+
5
+ export interface IRoute {
6
+ path?: string;
7
+ name?: string;
8
+ hash?: string;
9
+ query?: IDictionary<string | Array<string>>;
10
+ params?: RouteParams;
11
+ fullPath?: string;
12
+ redirectedFrom?: string;
13
+ meta?: { transition?: symbol; state?: symbol };
14
+ }
15
+
16
+ export interface IBreadcrumbsItem {
17
+ text?: string;
18
+ remark?: string;
19
+ route: IRoute;
20
+ disabled?: boolean;
21
+ data?: unknown;
22
+ }
@@ -0,0 +1,47 @@
1
+ export interface ldmuiOptions {
2
+ aliases?: {
3
+ 'ld-button'?: string;
4
+ 'ld-icon'?: string;
5
+ 'ld-splitter'?: string;
6
+ 'ld-loader'?: string;
7
+ 'ld-toggle-buttons'?: string;
8
+ 'ld-breadcrumbs'?: string;
9
+ 'ld-edit-text'?: string;
10
+ 'ld-datepicker'?: string;
11
+ 'ld-tab'?: string;
12
+ 'ld-tabs'?: string;
13
+ 'ld-page-toolbar'?: string;
14
+ 'ld-select-list-box'?: string;
15
+ 'ld-checkbox'?: string;
16
+ 'ld-radiobutton'?: string;
17
+ 'ld-radiogroup'?: string;
18
+ 'ld-textarea'?: string;
19
+ 'ld-select'?: string;
20
+ 'ld-combobox'?: string;
21
+ 'ld-timepicker'?: string;
22
+ 'ld-text-viewer'?: string;
23
+ 'ld-edit-masked-text'?: string;
24
+ 'ld-text-markup'?: string;
25
+ },
26
+ viewport?: {
27
+ isMobile: string;
28
+ isTablet: string;
29
+ isDesktop: string;
30
+ },
31
+ language?: 'ru',
32
+ LdIcon?: {
33
+ path: string;
34
+ map: {
35
+ icons: Array<[string, string]>;
36
+ }
37
+ },
38
+ LdBreadcrumbs?: {
39
+ home: {
40
+ name: string;
41
+ path: string;
42
+ }
43
+ },
44
+ LdTabs?: {
45
+ header: string;
46
+ }
47
+ }
@@ -0,0 +1,16 @@
1
+ export type ValidateFunction = (v: unknown) => boolean | string;
2
+
3
+ export interface IInput {
4
+ uid: number;
5
+ validate: ValidateFunction;
6
+ reset: () => void;
7
+ resetValidation: () => void;
8
+ // eslint-disable-next-line @typescript-eslint/naming-convention
9
+ __cardSection: string | number;
10
+ }
11
+
12
+ export interface IWatcher {
13
+ uid: number;
14
+ valid: () => void;
15
+ shouldValidate: () => void;
16
+ }
package/package.json CHANGED
@@ -1,23 +1,99 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ldm ui",
5
- "main": "dist/main.js",
5
+ "main": "dist/index.js",
6
+ "engines": {
7
+ "node": ">=16",
8
+ "npm": ">=8"
9
+ },
6
10
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
11
+ "dev": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.dev.js --progress --profile --stats-error-details",
12
+ "build": "cross-env NODE_ENV=production webpack --config config/webpack.config.build.js --stats-error-details",
13
+ "serve": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.serve.js --progress --profile",
14
+ "test": "jest --runInBand --no-cache",
15
+ "pub": "node config/publish.js && npm publish --access=public"
8
16
  },
9
17
  "repository": {
10
18
  "type": "git",
11
- "url": "git+https://github.com/ldmjs/ui.git"
19
+ "url": "https://github.com/ldmjs/ui.git"
12
20
  },
13
21
  "keywords": [
14
22
  "ldm",
15
23
  "ui"
16
24
  ],
17
25
  "author": "ldmjs <nevezhin@lanit.ru>",
18
- "license": "ISC",
26
+ "license": "MIT",
19
27
  "bugs": {
20
28
  "url": "https://github.com/ldmjs/ui/issues"
21
29
  },
22
- "homepage": "https://github.com/ldmjs/ui#readme"
30
+ "homepage": "https://github.com/ldmjs/ui#readme",
31
+ "files": [
32
+ "dist/"
33
+ ],
34
+ "devDependencies": {
35
+ "@babel/core": "7.23.6",
36
+ "@babel/plugin-proposal-decorators": "7.23.6",
37
+ "@babel/plugin-proposal-export-default-from": "7.23.3",
38
+ "@babel/plugin-transform-class-properties": "7.23.3",
39
+ "@babel/plugin-transform-export-namespace-from": "7.23.4",
40
+ "@babel/plugin-transform-runtime": "7.23.6",
41
+ "@babel/plugin-transform-typescript": "7.23.6",
42
+ "@babel/preset-env": "7.23.6",
43
+ "@babel/preset-typescript": "7.23.3",
44
+ "@floating-ui/dom": "^1.6.3",
45
+ "@ldmjs/datatable": "^1.0.3",
46
+ "@popperjs/core": "^2.11.8",
47
+ "@types/babel__core": "^7",
48
+ "@types/babel__plugin-transform-runtime": "^7",
49
+ "@types/babel__preset-env": "^7",
50
+ "@types/eslint": "^8",
51
+ "@types/jest": "^29.5.12",
52
+ "@types/lodash-es": "^4",
53
+ "@typescript-eslint/eslint-plugin": "5.41.0",
54
+ "@typescript-eslint/parser": "5.41.0",
55
+ "@vue/test-utils": "2.4.3",
56
+ "@vue/vue3-jest": "29.2.6",
57
+ "@vuelidate/core": "2.0.2",
58
+ "@vuelidate/validators": "2.0.2",
59
+ "babel-jest": "29.5.0",
60
+ "babel-plugin-const-enum": "1.2.0",
61
+ "copy-webpack-plugin": "^12.0.2",
62
+ "cross-env": "^7.0.3",
63
+ "css-loader": "6.8.1",
64
+ "eslint": "8.56.0",
65
+ "html-webpack-plugin": "5.6.0",
66
+ "jest": "29.2.2",
67
+ "jest-environment-jsdom": "29.2.2",
68
+ "jest-transform-stub": "2.0.0",
69
+ "lodash-es": "4.17.21",
70
+ "material-design-icons-iconfont": "^6.7.0",
71
+ "md-editor-v3": "4.15.6",
72
+ "mini-css-extract-plugin": "2.8.0",
73
+ "node-sass": "9.0.0",
74
+ "postcss-loader": "7.3.3",
75
+ "sass": "1.69.5",
76
+ "sass-loader": "13.3.2",
77
+ "style-loader": "3.3.3",
78
+ "terser-webpack-plugin": "5.3.10",
79
+ "ts-jest": "29.0.3",
80
+ "ts-loader": "9.5.1",
81
+ "typescript": "4.9.5",
82
+ "v-calendar": "3.1.2",
83
+ "vue": "3.4.21",
84
+ "vue-class-component": "8.0.0-rc.1",
85
+ "vue-eslint-parser": "9.4.2",
86
+ "vue-imask": "6.6.1",
87
+ "vue-loader": "17.3.1",
88
+ "vue-property-decorator": "10.0.0-rc.3",
89
+ "vue-screen-utils": "1.0.0-beta.13",
90
+ "vuetify": "3.6.8",
91
+ "webpack": "5.90.2",
92
+ "webpack-cli": "5.1.4",
93
+ "webpack-dev-server": "4.15.1",
94
+ "webpack-plugin-vuetify": "2.0.1"
95
+ },
96
+ "volta": {
97
+ "node": "16.20.0"
98
+ }
23
99
  }