@ldmjs/ui 1.0.0-dev-1 → 1.0.0-dev-3

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,73 @@
1
+ $colors: ('primary', 'secondary', 'success', 'warning', 'error', 'grey', 'dark', 'white');
2
+
3
+ body,
4
+ .v-application {
5
+ @each $color in $colors {
6
+ & .#{$color} {
7
+ background-color: var(--#{$color}) !important;
8
+ border-color: var(--#{$color}) !important;
9
+ }
10
+ & .#{$color}--text, & .text-#{$color} {
11
+ @if $color == 'primary' {
12
+ color: var(--#{$color}-l-2) !important;
13
+ } @else {
14
+ color: var(--#{$color}) !important;
15
+ }
16
+ }
17
+ & .#{$color}--bg, & .bg-#{$color} {
18
+ @if $color == 'primary' {
19
+ background-color: var(--#{$color}-l-8) !important;
20
+ } @else if $color == 'grey' {
21
+ background-color: var(--#{$color}-l-6) !important;
22
+ } @else if $color == 'secondary' {
23
+ background-color: var(--#{$color}-l-5) !important;
24
+ } @else {
25
+ background-color: var(--#{$color}) !important;
26
+ }
27
+ }
28
+ & .#{$color}--border, & .border-#{$color} {
29
+ @if $color == 'primary' {
30
+ border-color: var(--#{$color}-l-2) !important;
31
+ } @else if $color == 'grey' {
32
+ border-color: var(--#{$color}-l-5) !important;
33
+ } @else {
34
+ border-color: var(--#{$color}) !important;
35
+ }
36
+ }
37
+ & .#{$color}--hover {
38
+ transition: background 0.1s;
39
+ @if $color == 'grey' {
40
+ &:hover {
41
+ background-color: var(--#{$color}-l-6) !important;
42
+ }
43
+ } @else if $color == 'secondary' {
44
+ &:hover {
45
+ background-color: var(--#{$color}-l-5) !important;
46
+ }
47
+ } @else {
48
+ &:hover {
49
+ background-color: var(--#{$color}) !important;
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ & .text-color {
56
+ color: var(--text);
57
+ }
58
+
59
+ & .label-color {
60
+ color: var(--label);
61
+ }
62
+ }
63
+
64
+ .main-gradient-h {
65
+ background: var(--primary);
66
+ background: linear-gradient(90deg, var(--primary) 0%, var(--primary-d-1) 100%);
67
+ }
68
+
69
+ .main-gradient-v {
70
+ background: var(--primary);
71
+ background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d-1) 100%);
72
+ }
73
+
@@ -0,0 +1,5 @@
1
+ $font-size: 12px !default; // основной шрифт приложения
2
+
3
+ :root {
4
+ --font-size: #{$font-size};
5
+ }
@@ -0,0 +1,2 @@
1
+ @import 'colors';
2
+ @import 'variables';
@@ -0,0 +1,5 @@
1
+ export function isDefined(value: unknown): boolean {
2
+ /* eslint-disable no-undefined */
3
+ const isNaNValue = typeof value === 'number' && isNaN(value);
4
+ return value !== null && value !== undefined && !isNaNValue;
5
+ }
@@ -0,0 +1,11 @@
1
+ export function getZIndex(el?: Element | null): number {
2
+ if (!el || el.nodeType !== Node.ELEMENT_NODE) {
3
+ return 0;
4
+ }
5
+ const index = Number(window.getComputedStyle(el).getPropertyValue('z-index'));
6
+
7
+ if (isNaN(index)) {
8
+ return getZIndex(el.parentNode as Element);
9
+ }
10
+ return index;
11
+ }
package/src/utils.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { isDefined } from './index'
2
+ export {
3
+ isDefined
4
+ }
package/dist/main.umd.js DELETED
@@ -1,311 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("vue"), require("vue-class-component"), require("vue-property-decorator"));
4
- else if(typeof define === 'function' && define.amd)
5
- define("ldm-ui", ["vue", "vue-class-component", "vue-property-decorator"], factory);
6
- else if(typeof exports === 'object')
7
- exports["ldm-ui"] = factory(require("vue"), require("vue-class-component"), require("vue-property-decorator"));
8
- else
9
- root["ldm-ui"] = factory(root["vue"], root["vue-class-component"], root["vue-property-decorator"]);
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__380__, __WEBPACK_EXTERNAL_MODULE__299__, __WEBPACK_EXTERNAL_MODULE__70__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 262:
16
- /***/ ((__unused_webpack_module, exports) => {
17
-
18
- var __webpack_unused_export__;
19
-
20
- __webpack_unused_export__ = ({ value: true });
21
- // runtime helper for setting properties on components
22
- // in a tree-shakable way
23
- exports.A = (sfc, props) => {
24
- const target = sfc.__vccOpts || sfc;
25
- for (const [key, val] of props) {
26
- target[key] = val;
27
- }
28
- return target;
29
- };
30
-
31
-
32
- /***/ }),
33
-
34
- /***/ 380:
35
- /***/ ((module) => {
36
-
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__380__;
38
-
39
- /***/ }),
40
-
41
- /***/ 299:
42
- /***/ ((module) => {
43
-
44
- module.exports = __WEBPACK_EXTERNAL_MODULE__299__;
45
-
46
- /***/ }),
47
-
48
- /***/ 70:
49
- /***/ ((module) => {
50
-
51
- module.exports = __WEBPACK_EXTERNAL_MODULE__70__;
52
-
53
- /***/ })
54
-
55
- /******/ });
56
- /************************************************************************/
57
- /******/ // The module cache
58
- /******/ var __webpack_module_cache__ = {};
59
- /******/
60
- /******/ // The require function
61
- /******/ function __webpack_require__(moduleId) {
62
- /******/ // Check if module is in cache
63
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
64
- /******/ if (cachedModule !== undefined) {
65
- /******/ return cachedModule.exports;
66
- /******/ }
67
- /******/ // Create a new module (and put it into the cache)
68
- /******/ var module = __webpack_module_cache__[moduleId] = {
69
- /******/ // no module.id needed
70
- /******/ // no module.loaded needed
71
- /******/ exports: {}
72
- /******/ };
73
- /******/
74
- /******/ // Execute the module function
75
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
76
- /******/
77
- /******/ // Return the exports of the module
78
- /******/ return module.exports;
79
- /******/ }
80
- /******/
81
- /************************************************************************/
82
- /******/ /* webpack/runtime/define property getters */
83
- /******/ (() => {
84
- /******/ // define getter functions for harmony exports
85
- /******/ __webpack_require__.d = (exports, definition) => {
86
- /******/ for(var key in definition) {
87
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
88
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
89
- /******/ }
90
- /******/ }
91
- /******/ };
92
- /******/ })();
93
- /******/
94
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
95
- /******/ (() => {
96
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
97
- /******/ })();
98
- /******/
99
- /******/ /* webpack/runtime/make namespace object */
100
- /******/ (() => {
101
- /******/ // define __esModule on exports
102
- /******/ __webpack_require__.r = (exports) => {
103
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
104
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
105
- /******/ }
106
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
107
- /******/ };
108
- /******/ })();
109
- /******/
110
- /************************************************************************/
111
- var __webpack_exports__ = {};
112
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
113
- (() => {
114
- // ESM COMPAT FLAG
115
- __webpack_require__.r(__webpack_exports__);
116
-
117
- // EXPORTS
118
- __webpack_require__.d(__webpack_exports__, {
119
- "default": () => (/* binding */ src)
120
- });
121
-
122
- // EXTERNAL MODULE: external "vue"
123
- var external_vue_ = __webpack_require__(380);
124
- // EXTERNAL MODULE: external "vue-class-component"
125
- var external_vue_class_component_ = __webpack_require__(299);
126
- // EXTERNAL MODULE: external "vue-property-decorator"
127
- var external_vue_property_decorator_ = __webpack_require__(70);
128
- ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/ld-icon/svg-icon.vue?vue&type=template&id=65e09608
129
-
130
-
131
- const _hoisted_1 = { style: {"fill":"transparent","stroke":"transparent"} }
132
- const _hoisted_2 = ["href"]
133
-
134
- function render(_ctx, _cache, $props, $setup, $data, $options) {
135
- return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("svg", _hoisted_1, [
136
- (0,external_vue_.createElementVNode)("use", { href: _ctx.href }, null, 8 /* PROPS */, _hoisted_2)
137
- ]))
138
- }
139
- ;// CONCATENATED MODULE: ./src/ld-icon/svg-icon.vue?vue&type=template&id=65e09608
140
-
141
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use[0]!./src/ld-icon/svg-icon.ts?vue&type=script&lang=js&external
142
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
143
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
144
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
145
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
146
- return c > 3 && r && Object.defineProperty(target, key, r), r;
147
- };
148
- var __metadata = (undefined && undefined.__metadata) || function (k, v) {
149
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
150
- };
151
-
152
- class SvgIconComponent extends external_vue_property_decorator_.Vue {
153
- get href() {
154
- return `${this.path}/${this.icon}.svg#${this.icon}`;
155
- }
156
- }
157
- __decorate([
158
- (0,external_vue_property_decorator_.Prop)(),
159
- __metadata("design:type", String)
160
- ], SvgIconComponent.prototype, "icon", void 0);
161
- __decorate([
162
- (0,external_vue_property_decorator_.Prop)(),
163
- __metadata("design:type", String)
164
- ], SvgIconComponent.prototype, "path", void 0);
165
-
166
- ;// CONCATENATED MODULE: ./src/ld-icon/svg-icon.ts?vue&type=script&lang=js&external
167
-
168
- // EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
169
- var exportHelper = __webpack_require__(262);
170
- ;// CONCATENATED MODULE: ./src/ld-icon/svg-icon.vue
171
-
172
-
173
-
174
-
175
- ;
176
- const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(SvgIconComponent, [['render',render]])
177
-
178
- /* harmony default export */ const svg_icon = (__exports__);
179
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use[0]!./src/ld-icon/ld-icon.ts?vue&type=script&lang=js&external
180
- var ld_iconvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
181
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
182
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
183
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
184
- return c > 3 && r && Object.defineProperty(target, key, r), r;
185
- };
186
- var ld_iconvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
187
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
188
- };
189
-
190
-
191
-
192
- let IconButtonComponent = class IconButtonComponent extends external_vue_class_component_.Vue {
193
- constructor() {
194
- super(...arguments);
195
- this.current = '';
196
- }
197
- onIconChange() {
198
- this.current = this.icon.trim();
199
- }
200
- created() {
201
- if (this.icon) {
202
- this.current = this.icon.trim();
203
- return;
204
- }
205
- if (this.$slots.default) {
206
- const slot = this.$slots.default()?.[0];
207
- if (slot && slot.children && typeof slot.children === 'string') {
208
- this.current = slot.children.trim();
209
- }
210
- }
211
- }
212
- get props() {
213
- return {
214
- path: this.path,
215
- width: this.width,
216
- height: this.height,
217
- };
218
- }
219
- get array() {
220
- return this.map.icons.find((el) => el[0] === this.current) || [];
221
- }
222
- get className() {
223
- if (this.color) {
224
- return [`${this.color}--text`];
225
- }
226
- return [];
227
- }
228
- };
229
- ld_iconvue_type_script_lang_js_external_decorate([
230
- (0,external_vue_property_decorator_.Prop)({ default: () => ({ icons: [] }) }),
231
- ld_iconvue_type_script_lang_js_external_metadata("design:type", Object)
232
- ], IconButtonComponent.prototype, "map", void 0);
233
- ld_iconvue_type_script_lang_js_external_decorate([
234
- (0,external_vue_property_decorator_.Prop)({ default: 'icons' }),
235
- ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
236
- ], IconButtonComponent.prototype, "path", void 0);
237
- ld_iconvue_type_script_lang_js_external_decorate([
238
- (0,external_vue_property_decorator_.Prop)(),
239
- ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
240
- ], IconButtonComponent.prototype, "icon", void 0);
241
- ld_iconvue_type_script_lang_js_external_decorate([
242
- (0,external_vue_property_decorator_.Prop)(),
243
- ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
244
- ], IconButtonComponent.prototype, "color", void 0);
245
- ld_iconvue_type_script_lang_js_external_decorate([
246
- (0,external_vue_property_decorator_.Prop)({ default: '24' }),
247
- ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
248
- ], IconButtonComponent.prototype, "width", void 0);
249
- ld_iconvue_type_script_lang_js_external_decorate([
250
- (0,external_vue_property_decorator_.Prop)({ default: '24' }),
251
- ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
252
- ], IconButtonComponent.prototype, "height", void 0);
253
- ld_iconvue_type_script_lang_js_external_decorate([
254
- (0,external_vue_property_decorator_.Watch)('icon'),
255
- ld_iconvue_type_script_lang_js_external_metadata("design:type", Function),
256
- ld_iconvue_type_script_lang_js_external_metadata("design:paramtypes", []),
257
- ld_iconvue_type_script_lang_js_external_metadata("design:returntype", void 0)
258
- ], IconButtonComponent.prototype, "onIconChange", null);
259
- IconButtonComponent = ld_iconvue_type_script_lang_js_external_decorate([
260
- (0,external_vue_class_component_.Options)({
261
- components: {
262
- 'svg-icon': svg_icon,
263
- },
264
- template: `
265
- <svg-icon v-if="array" :icon="array[1]" :class="className" :path="path" v-bind="props" />
266
- <span v-else> icon is not found: {{ current }} </span>
267
- `,
268
- })
269
- ], IconButtonComponent);
270
- /* harmony default export */ const ld_iconvue_type_script_lang_js_external = (IconButtonComponent);
271
-
272
- ;// CONCATENATED MODULE: ./src/ld-icon/ld-icon.ts?vue&type=script&lang=js&external
273
-
274
- ;// CONCATENATED MODULE: ./src/ld-icon/ld-icon.vue
275
-
276
-
277
-
278
- const ld_icon_exports_ = ld_iconvue_type_script_lang_js_external;
279
-
280
- /* harmony default export */ const ld_icon = (ld_icon_exports_);
281
- ;// CONCATENATED MODULE: ./src/index.ts
282
-
283
-
284
- const ldmuiPlugin = {
285
- install(vue, options) {
286
- if (false) {}
287
- let cmp = (0,external_vue_.defineComponent)(ld_icon);
288
- cmp = cmp.setup.__vccOpts;
289
- cmp = {
290
- ...cmp,
291
- props: {
292
- ...cmp.props,
293
- path: {
294
- default: options.LdIcon.path
295
- },
296
- map: {
297
- default: options.LdIcon.map
298
- }
299
- }
300
- };
301
- vue.component('ld-icon', (0,external_vue_.defineComponent)(cmp));
302
- },
303
- };
304
- /* harmony default export */ const src = (ldmuiPlugin);
305
-
306
- })();
307
-
308
- /******/ return __webpack_exports__;
309
- /******/ })()
310
- ;
311
- });
@@ -1,13 +0,0 @@
1
- /*! #__NO_SIDE_EFFECTS__ */
2
-
3
- /**
4
- * vue-class-component v8.0.0-rc.1
5
- * (c) 2015-present Evan You
6
- * @license MIT
7
- */
8
-
9
- /**
10
- * @vue/shared v3.4.21
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/