@ldmjs/ui 1.0.0-dev-7 → 1.0.0-dev-8
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.
- package/README.md +61 -0
- package/dist/index.js +144 -9
- package/dist/scss/_breadcrumbs.scss +48 -0
- package/dist/scss/index.scss +1 -0
- package/dist/types/breadcrumbs.d.ts +22 -0
- package/dist/types/options.d.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,6 +139,67 @@ const vuetify = createVuetify({
|
|
|
139
139
|
</ld-splitter>
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
## #ld-toggle-buttons
|
|
143
|
+
|
|
144
|
+
### use toggle buttons
|
|
145
|
+
|
|
146
|
+
```html
|
|
147
|
+
<ld-toggle-btn
|
|
148
|
+
v-model="toggleModel"
|
|
149
|
+
:items="toggleItems"
|
|
150
|
+
/>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```js
|
|
154
|
+
toggleItems = [
|
|
155
|
+
{
|
|
156
|
+
id: 0,
|
|
157
|
+
tooltip: 'user',
|
|
158
|
+
icon: 'user',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 1,
|
|
162
|
+
tooltip: 'group',
|
|
163
|
+
icon: 'group',
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## #ld-breadcrumbs
|
|
169
|
+
|
|
170
|
+
### use breadcrumbs
|
|
171
|
+
|
|
172
|
+
```js
|
|
173
|
+
appComponent.use(ldmui, {
|
|
174
|
+
LdBreadcrumbs: {
|
|
175
|
+
home: { // setup route for home page
|
|
176
|
+
name: 'home',
|
|
177
|
+
path: '/'
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<ld-breadcrumbs :breadcrumbs="items" />
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
const items = [
|
|
188
|
+
{
|
|
189
|
+
text: 'Документы',
|
|
190
|
+
route: {
|
|
191
|
+
path: '/documents'
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
text: 'Входящая корреспонденция',
|
|
196
|
+
route: {
|
|
197
|
+
path: '/documents/123456'
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
```
|
|
202
|
+
|
|
142
203
|
# Utilities
|
|
143
204
|
|
|
144
205
|
- isDefined
|
package/dist/index.js
CHANGED
|
@@ -2043,18 +2043,15 @@ function ld_splitter_reg(vue, options) {
|
|
|
2043
2043
|
}
|
|
2044
2044
|
/* harmony default export */ const src_ld_splitter = (ld_splitter_reg);
|
|
2045
2045
|
|
|
2046
|
-
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/ld-toggle-buttons/ld-toggle-buttons.vue?vue&type=template&id=
|
|
2046
|
+
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/ld-toggle-buttons/ld-toggle-buttons.vue?vue&type=template&id=09fbefbf&ts=true
|
|
2047
2047
|
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
style: { "grid-template-columns": "repeat(var(--input-height))" }
|
|
2051
|
-
};
|
|
2052
|
-
function ld_toggle_buttonsvue_type_template_id_2b80b384_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2048
|
+
const ld_toggle_buttonsvue_type_template_id_09fbefbf_ts_true_hoisted_1 = { class: "d-flex align-center" };
|
|
2049
|
+
function ld_toggle_buttonsvue_type_template_id_09fbefbf_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2053
2050
|
const _component_ld_icon = (0,external_vue_.resolveComponent)("ld-icon");
|
|
2054
2051
|
const _component_square_button = (0,external_vue_.resolveComponent)("square-button");
|
|
2055
2052
|
const _component_v_tooltip = (0,external_vue_.resolveComponent)("v-tooltip");
|
|
2056
2053
|
const _directive_active = (0,external_vue_.resolveDirective)("active");
|
|
2057
|
-
return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div",
|
|
2054
|
+
return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_toggle_buttonsvue_type_template_id_09fbefbf_ts_true_hoisted_1, [
|
|
2058
2055
|
((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.items, (item, index) => {
|
|
2059
2056
|
return ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_tooltip, null, {
|
|
2060
2057
|
activator: (0,external_vue_.withCtx)(({ props }) => [
|
|
@@ -2086,7 +2083,7 @@ function ld_toggle_buttonsvue_type_template_id_2b80b384_ts_true_render(_ctx, _ca
|
|
|
2086
2083
|
]));
|
|
2087
2084
|
}
|
|
2088
2085
|
|
|
2089
|
-
;// CONCATENATED MODULE: ./src/ld-toggle-buttons/ld-toggle-buttons.vue?vue&type=template&id=
|
|
2086
|
+
;// CONCATENATED MODULE: ./src/ld-toggle-buttons/ld-toggle-buttons.vue?vue&type=template&id=09fbefbf&ts=true
|
|
2090
2087
|
|
|
2091
2088
|
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use[0]!./src/ld-toggle-buttons/ld-toggle-buttons.ts?vue&type=script&lang=ts&external
|
|
2092
2089
|
var ld_toggle_buttonsvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -2128,7 +2125,7 @@ ToggleButtonsComponent = ld_toggle_buttonsvue_type_script_lang_ts_external_decor
|
|
|
2128
2125
|
|
|
2129
2126
|
|
|
2130
2127
|
;
|
|
2131
|
-
const ld_toggle_buttons_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_toggle_buttonsvue_type_script_lang_ts_external, [['render',
|
|
2128
|
+
const ld_toggle_buttons_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_toggle_buttonsvue_type_script_lang_ts_external, [['render',ld_toggle_buttonsvue_type_template_id_09fbefbf_ts_true_render]])
|
|
2132
2129
|
|
|
2133
2130
|
/* harmony default export */ const ld_toggle_buttons = (ld_toggle_buttons_exports_);
|
|
2134
2131
|
;// CONCATENATED MODULE: ./src/ld-toggle-buttons/index.ts
|
|
@@ -2138,6 +2135,142 @@ function ld_toggle_buttons_reg(vue, options) {
|
|
|
2138
2135
|
}
|
|
2139
2136
|
/* harmony default export */ const src_ld_toggle_buttons = (ld_toggle_buttons_reg);
|
|
2140
2137
|
|
|
2138
|
+
;// 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-breadcrumbs/ld-breadcrumbs.vue?vue&type=template&id=c811912a
|
|
2139
|
+
|
|
2140
|
+
|
|
2141
|
+
const ld_breadcrumbsvue_type_template_id_c811912a_hoisted_1 = ["onClick"]
|
|
2142
|
+
const ld_breadcrumbsvue_type_template_id_c811912a_hoisted_2 = { key: 0 }
|
|
2143
|
+
|
|
2144
|
+
function ld_breadcrumbsvue_type_template_id_c811912a_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2145
|
+
const _component_ld_icon = (0,external_vue_.resolveComponent)("ld-icon")
|
|
2146
|
+
const _component_square_button = (0,external_vue_.resolveComponent)("square-button")
|
|
2147
|
+
const _component_v_breadcrumbs = (0,external_vue_.resolveComponent)("v-breadcrumbs")
|
|
2148
|
+
|
|
2149
|
+
return ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_breadcrumbs, {
|
|
2150
|
+
divider: "/",
|
|
2151
|
+
items: _ctx.items
|
|
2152
|
+
}, {
|
|
2153
|
+
title: (0,external_vue_.withCtx)(({ item }) => [
|
|
2154
|
+
(item.text === 'home')
|
|
2155
|
+
? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
|
|
2156
|
+
key: 0,
|
|
2157
|
+
class: "mr-2",
|
|
2158
|
+
onClick: _ctx.goHome
|
|
2159
|
+
}, {
|
|
2160
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
2161
|
+
(0,external_vue_.createVNode)(_component_ld_icon, null, {
|
|
2162
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
2163
|
+
(0,external_vue_.createTextVNode)("home")
|
|
2164
|
+
]),
|
|
2165
|
+
_: 1 /* STABLE */
|
|
2166
|
+
})
|
|
2167
|
+
]),
|
|
2168
|
+
_: 1 /* STABLE */
|
|
2169
|
+
}, 8 /* PROPS */, ["onClick"]))
|
|
2170
|
+
: ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
|
|
2171
|
+
key: 1,
|
|
2172
|
+
onClick: $event => (_ctx.go(item))
|
|
2173
|
+
}, [
|
|
2174
|
+
(0,external_vue_.createElementVNode)("span", null, (0,external_vue_.toDisplayString)(item.text), 1 /* TEXT */),
|
|
2175
|
+
(0,external_vue_.createTextVNode)(),
|
|
2176
|
+
(item.remark)
|
|
2177
|
+
? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("span", ld_breadcrumbsvue_type_template_id_c811912a_hoisted_2, "(" + (0,external_vue_.toDisplayString)(item.remark) + ")", 1 /* TEXT */))
|
|
2178
|
+
: (0,external_vue_.createCommentVNode)("v-if", true)
|
|
2179
|
+
], 8 /* PROPS */, ld_breadcrumbsvue_type_template_id_c811912a_hoisted_1))
|
|
2180
|
+
]),
|
|
2181
|
+
_: 1 /* STABLE */
|
|
2182
|
+
}, 8 /* PROPS */, ["items"]))
|
|
2183
|
+
}
|
|
2184
|
+
;// CONCATENATED MODULE: ./src/ld-breadcrumbs/ld-breadcrumbs.vue?vue&type=template&id=c811912a
|
|
2185
|
+
|
|
2186
|
+
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use[0]!./src/ld-breadcrumbs/ld-breadcrumbs.ts?vue&type=script&lang=js&external
|
|
2187
|
+
var ld_breadcrumbsvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2188
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2189
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2190
|
+
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;
|
|
2191
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2192
|
+
};
|
|
2193
|
+
var ld_breadcrumbsvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
2194
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2195
|
+
};
|
|
2196
|
+
var ld_breadcrumbsvue_type_script_lang_js_external_a;
|
|
2197
|
+
|
|
2198
|
+
class BreadcrumbsComponent extends external_vue_property_decorator_.Vue {
|
|
2199
|
+
constructor() {
|
|
2200
|
+
super(...arguments);
|
|
2201
|
+
this.items = [];
|
|
2202
|
+
}
|
|
2203
|
+
onBreadcrumbsChanged() {
|
|
2204
|
+
if (this.breadcrumbs && this.breadcrumbs.length) {
|
|
2205
|
+
this.items = [
|
|
2206
|
+
...this.breadcrumbs.map((item, index) => {
|
|
2207
|
+
item.disabled = index === this.breadcrumbs.length - 1;
|
|
2208
|
+
return item;
|
|
2209
|
+
})
|
|
2210
|
+
];
|
|
2211
|
+
if (this.items[0].text !== 'home') {
|
|
2212
|
+
this.items.unshift({
|
|
2213
|
+
text: 'home',
|
|
2214
|
+
route: {}
|
|
2215
|
+
});
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
goHome() {
|
|
2220
|
+
this.go({
|
|
2221
|
+
route: this.home || { path: '/' },
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
go(item) {
|
|
2225
|
+
if (!this.$router) {
|
|
2226
|
+
/* eslint-disable no-console */
|
|
2227
|
+
console.log('Router is undefined');
|
|
2228
|
+
return;
|
|
2229
|
+
}
|
|
2230
|
+
if (item.route) {
|
|
2231
|
+
this.$router.push(item.route);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
ld_breadcrumbsvue_type_script_lang_js_external_decorate([
|
|
2236
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
2237
|
+
ld_breadcrumbsvue_type_script_lang_js_external_metadata("design:type", typeof (ld_breadcrumbsvue_type_script_lang_js_external_a = typeof Array !== "undefined" && Array) === "function" ? ld_breadcrumbsvue_type_script_lang_js_external_a : Object)
|
|
2238
|
+
], BreadcrumbsComponent.prototype, "breadcrumbs", void 0);
|
|
2239
|
+
ld_breadcrumbsvue_type_script_lang_js_external_decorate([
|
|
2240
|
+
(0,external_vue_property_decorator_.Prop)({ default: null }),
|
|
2241
|
+
ld_breadcrumbsvue_type_script_lang_js_external_metadata("design:type", Object)
|
|
2242
|
+
], BreadcrumbsComponent.prototype, "home", void 0);
|
|
2243
|
+
ld_breadcrumbsvue_type_script_lang_js_external_decorate([
|
|
2244
|
+
(0,external_vue_property_decorator_.Watch)('breadcrumbs', { immediate: true }),
|
|
2245
|
+
ld_breadcrumbsvue_type_script_lang_js_external_metadata("design:type", Function),
|
|
2246
|
+
ld_breadcrumbsvue_type_script_lang_js_external_metadata("design:paramtypes", []),
|
|
2247
|
+
ld_breadcrumbsvue_type_script_lang_js_external_metadata("design:returntype", void 0)
|
|
2248
|
+
], BreadcrumbsComponent.prototype, "onBreadcrumbsChanged", null);
|
|
2249
|
+
|
|
2250
|
+
;// CONCATENATED MODULE: ./src/ld-breadcrumbs/ld-breadcrumbs.ts?vue&type=script&lang=js&external
|
|
2251
|
+
|
|
2252
|
+
;// CONCATENATED MODULE: ./src/ld-breadcrumbs/ld-breadcrumbs.vue
|
|
2253
|
+
|
|
2254
|
+
|
|
2255
|
+
|
|
2256
|
+
|
|
2257
|
+
;
|
|
2258
|
+
const ld_breadcrumbs_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(BreadcrumbsComponent, [['render',ld_breadcrumbsvue_type_template_id_c811912a_render]])
|
|
2259
|
+
|
|
2260
|
+
/* harmony default export */ const ld_breadcrumbs = (ld_breadcrumbs_exports_);
|
|
2261
|
+
;// CONCATENATED MODULE: ./src/ld-breadcrumbs/index.ts
|
|
2262
|
+
|
|
2263
|
+
function ld_breadcrumbs_reg(vue, options) {
|
|
2264
|
+
ld_breadcrumbs.props = {
|
|
2265
|
+
...ld_breadcrumbs.props,
|
|
2266
|
+
home: {
|
|
2267
|
+
default: options?.LdBreadcrumbs?.home ? options?.LdBreadcrumbs?.home : null
|
|
2268
|
+
}
|
|
2269
|
+
};
|
|
2270
|
+
vue.component(options?.aliases?.['ld-breadcrumbs'] ? options.aliases['ld-breadcrumbs'] : 'ld-breadcrumbs', ld_breadcrumbs);
|
|
2271
|
+
}
|
|
2272
|
+
/* harmony default export */ const src_ld_breadcrumbs = (ld_breadcrumbs_reg);
|
|
2273
|
+
|
|
2141
2274
|
;// CONCATENATED MODULE: ./src/vuetify.ts
|
|
2142
2275
|
const aliases = {
|
|
2143
2276
|
SmallButton: 'VBtn',
|
|
@@ -2206,6 +2339,7 @@ const ActiveDirectiveOptions = {
|
|
|
2206
2339
|
|
|
2207
2340
|
|
|
2208
2341
|
|
|
2342
|
+
|
|
2209
2343
|
const ldmuiPlugin = {
|
|
2210
2344
|
install(vue, options) {
|
|
2211
2345
|
src_ld_icon(vue, options);
|
|
@@ -2213,6 +2347,7 @@ const ldmuiPlugin = {
|
|
|
2213
2347
|
src_ld_button(vue, options);
|
|
2214
2348
|
src_ld_splitter(vue, options);
|
|
2215
2349
|
src_ld_toggle_buttons(vue, options);
|
|
2350
|
+
src_ld_breadcrumbs(vue, options);
|
|
2216
2351
|
vue.config.globalProperties.$utils = {
|
|
2217
2352
|
isDefined: isDefined
|
|
2218
2353
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
body {
|
|
2
|
+
.v-breadcrumbs {
|
|
3
|
+
white-space: nowrap;
|
|
4
|
+
text-overflow: ellipsis;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
padding: 0;
|
|
7
|
+
width: fit-content;
|
|
8
|
+
|
|
9
|
+
& li {
|
|
10
|
+
color: var(--grey) !important;
|
|
11
|
+
font-size: var(--font-size) !important;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
&.v-breadcrumbs-item {
|
|
16
|
+
overflow: hidden !important;
|
|
17
|
+
text-overflow: ellipsis !important;
|
|
18
|
+
white-space: nowrap !important;
|
|
19
|
+
display: block !important;
|
|
20
|
+
cursor: pointer !important;
|
|
21
|
+
padding: 0;
|
|
22
|
+
|
|
23
|
+
& a {
|
|
24
|
+
color: inherit !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[text="home"] {
|
|
28
|
+
& + .v-breadcrumbs-divider {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:last-child {
|
|
34
|
+
font-weight: bold !important;
|
|
35
|
+
color: var(--text) !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.v-breadcrumbs-divider {
|
|
40
|
+
padding: 0 4px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.v-breadcrumbs-item--disabled {
|
|
45
|
+
opacity: 1 !important;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
package/dist/scss/index.scss
CHANGED
|
@@ -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
|
+
}
|
package/dist/types/options.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface ldmuiOptions {
|
|
|
5
5
|
'ld-splitter'?: string;
|
|
6
6
|
'ld-loader'?: string;
|
|
7
7
|
'ld-toggle-buttons'?: string;
|
|
8
|
+
'ld-breadcrumbs'?: string;
|
|
8
9
|
},
|
|
9
10
|
LdIcon?: {
|
|
10
11
|
path: string;
|
|
@@ -16,5 +17,11 @@ export interface ldmuiOptions {
|
|
|
16
17
|
isMobile: string;
|
|
17
18
|
isTablet: string;
|
|
18
19
|
isDesktop: string;
|
|
20
|
+
},
|
|
21
|
+
LdBreadcrumbs?: {
|
|
22
|
+
home: {
|
|
23
|
+
name: string;
|
|
24
|
+
path: string;
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
}
|