@ldmjs/ui 1.0.7 → 1.0.9
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 +2 -0
- package/dist/index.d.ts +12 -18
- package/dist/index.js +94 -7
- package/dist/scss/_toasted.scss +15 -0
- package/dist/scss/index.scss +1 -0
- package/dist/types/eventBus.d.ts +8 -0
- package/dist/types/toasted.d.ts +6 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"vue-screen-utils": "1.0.0-beta.13",
|
|
8
8
|
"lodash-es": "4.17.21",
|
|
9
9
|
"md-editor-v3": "4.15.6",
|
|
10
|
+
"vue-toastification": "2.0.0-rc.5",
|
|
10
11
|
|
|
11
12
|
# Installation
|
|
12
13
|
|
|
@@ -33,6 +34,7 @@ import '@ldmjs/ui/dist/scss';
|
|
|
33
34
|
import 'vuetify/styles';
|
|
34
35
|
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
|
35
36
|
import 'md-editor-v3/lib/style.css';
|
|
37
|
+
import 'vue-toastification/dist/index.css';
|
|
36
38
|
import ldmui from '@ldmjs/ui';
|
|
37
39
|
```
|
|
38
40
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ldmuiOptions } from './types/options'
|
|
2
|
-
import { IInput, IWatcher } from './types/validation';
|
|
3
1
|
import { Vue } from 'vue-class-component';
|
|
2
|
+
import { IEventBus } from './types/eventBus';
|
|
3
|
+
import { ldmuiOptions } from './types/options';
|
|
4
|
+
import { IToasted } from './types/toasted';
|
|
5
|
+
import { IInput, IWatcher } from './types/validation';
|
|
4
6
|
|
|
5
7
|
declare module '@vue/runtime-core' {
|
|
6
8
|
export interface ComponentCustomProperties {
|
|
@@ -12,8 +14,9 @@ declare module '@vue/runtime-core' {
|
|
|
12
14
|
isObjectEmpty(obj: Record<string, unknown>): boolean;
|
|
13
15
|
};
|
|
14
16
|
$ldmui: {
|
|
15
|
-
options: ldmuiOptions
|
|
16
|
-
}
|
|
17
|
+
options: ldmuiOptions;
|
|
18
|
+
},
|
|
19
|
+
$toasted: IToasted;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -42,9 +45,8 @@ declare class ValidateMixin extends Vue {
|
|
|
42
45
|
validateSection: (section: number | string) => boolean;
|
|
43
46
|
customValidateFunc: () => string | boolean;
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
declare const eventBus: IEventBus;
|
|
46
49
|
declare const ValidateMixinOptions: Record<string, any>;
|
|
47
|
-
|
|
48
50
|
declare const ldmui: {
|
|
49
51
|
install(vue: any, options?: ldmuiOptions): void;
|
|
50
52
|
}
|
|
@@ -52,15 +54,7 @@ declare const ldmui: {
|
|
|
52
54
|
export default ldmui;
|
|
53
55
|
|
|
54
56
|
export {
|
|
55
|
-
defaults,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
uidGen,
|
|
60
|
-
deepValueGetter,
|
|
61
|
-
isObjectEmpty,
|
|
62
|
-
urlRegexp,
|
|
63
|
-
datetime,
|
|
64
|
-
ValidateMixin,
|
|
65
|
-
ValidateMixinOptions
|
|
66
|
-
}
|
|
57
|
+
ValidateMixin, ValidateMixinOptions, datetime, deepValueGetter, defaults, delay, getAliases,
|
|
58
|
+
isDefined, isObjectEmpty, uidGen, urlRegexp, eventBus
|
|
59
|
+
};
|
|
60
|
+
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"));
|
|
3
|
+
module.exports = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"), require("vue-toastification"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["./calendar.js", "./floating.js", "./imask.js", "./multiselect.js", "./runtime-template.js", "@vuelidate/validators", "markdown-it", "md-editor-v3", "vue", "vue-class-component", "vue-property-decorator"], factory);
|
|
5
|
+
define(["./calendar.js", "./floating.js", "./imask.js", "./multiselect.js", "./runtime-template.js", "@vuelidate/validators", "markdown-it", "md-editor-v3", "vue", "vue-class-component", "vue-property-decorator", "vue-toastification"], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["ldmui"] = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"));
|
|
7
|
+
exports["ldmui"] = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"), require("vue-toastification"));
|
|
8
8
|
else
|
|
9
|
-
root["ldmui"] = factory(root["./calendar.js"], root["./floating.js"], root["./imask.js"], root["./multiselect.js"], root["./runtime-template.js"], root["@vuelidate/validators"], root["markdown-it"], root["md-editor-v3"], root["vue"], root["vue-class-component"], root["vue-property-decorator"]);
|
|
10
|
-
})(self, (__WEBPACK_EXTERNAL_MODULE__4634__, __WEBPACK_EXTERNAL_MODULE__3654__, __WEBPACK_EXTERNAL_MODULE__6135__, __WEBPACK_EXTERNAL_MODULE__9225__, __WEBPACK_EXTERNAL_MODULE__119__, __WEBPACK_EXTERNAL_MODULE__887__, __WEBPACK_EXTERNAL_MODULE__8461__, __WEBPACK_EXTERNAL_MODULE__6443__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__) => {
|
|
9
|
+
root["ldmui"] = factory(root["./calendar.js"], root["./floating.js"], root["./imask.js"], root["./multiselect.js"], root["./runtime-template.js"], root["@vuelidate/validators"], root["markdown-it"], root["md-editor-v3"], root["vue"], root["vue-class-component"], root["vue-property-decorator"], root["vue-toastification"]);
|
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__4634__, __WEBPACK_EXTERNAL_MODULE__3654__, __WEBPACK_EXTERNAL_MODULE__6135__, __WEBPACK_EXTERNAL_MODULE__9225__, __WEBPACK_EXTERNAL_MODULE__119__, __WEBPACK_EXTERNAL_MODULE__887__, __WEBPACK_EXTERNAL_MODULE__8461__, __WEBPACK_EXTERNAL_MODULE__6443__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__, __WEBPACK_EXTERNAL_MODULE__7982__) => {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
@@ -106,6 +106,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9299__;
|
|
|
106
106
|
|
|
107
107
|
module.exports = __WEBPACK_EXTERNAL_MODULE__5070__;
|
|
108
108
|
|
|
109
|
+
/***/ }),
|
|
110
|
+
|
|
111
|
+
/***/ 7982:
|
|
112
|
+
/***/ ((module) => {
|
|
113
|
+
|
|
114
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__7982__;
|
|
115
|
+
|
|
109
116
|
/***/ })
|
|
110
117
|
|
|
111
118
|
/******/ });
|
|
@@ -219,6 +226,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
219
226
|
"default": () => (/* binding */ src),
|
|
220
227
|
defaults: () => (/* reexport */ defaults),
|
|
221
228
|
delay: () => (/* reexport */ delay),
|
|
229
|
+
eventBus: () => (/* reexport */ eventBus),
|
|
222
230
|
getAliases: () => (/* reexport */ getAliases),
|
|
223
231
|
isDefined: () => (/* reexport */ isDefined),
|
|
224
232
|
isObjectEmpty: () => (/* reexport */ isObjectEmpty),
|
|
@@ -9182,9 +9190,9 @@ function getNative(object, key) {
|
|
|
9182
9190
|
|
|
9183
9191
|
|
|
9184
9192
|
/* Built-in method references that are verified to be native. */
|
|
9185
|
-
var
|
|
9193
|
+
var _Map_Map = _getNative(_root, 'Map');
|
|
9186
9194
|
|
|
9187
|
-
/* harmony default export */ const _Map = (
|
|
9195
|
+
/* harmony default export */ const _Map = (_Map_Map);
|
|
9188
9196
|
|
|
9189
9197
|
;// CONCATENATED MODULE: ./node_modules/lodash-es/_nativeCreate.js
|
|
9190
9198
|
|
|
@@ -14822,6 +14830,9 @@ function ld_switch_reg(vue, options) {
|
|
|
14822
14830
|
}
|
|
14823
14831
|
/* harmony default export */ const src_ld_switch = (ld_switch_reg);
|
|
14824
14832
|
|
|
14833
|
+
// EXTERNAL MODULE: external "vue-toastification"
|
|
14834
|
+
var external_vue_toastification_ = __webpack_require__(7982);
|
|
14835
|
+
var external_vue_toastification_default = /*#__PURE__*/__webpack_require__.n(external_vue_toastification_);
|
|
14825
14836
|
;// CONCATENATED MODULE: ./src/utils/delay.ts
|
|
14826
14837
|
async function delay(timeout) {
|
|
14827
14838
|
return new Promise(resolve => setTimeout(() => resolve(), timeout));
|
|
@@ -15161,6 +15172,69 @@ validate_mixin_decorate([
|
|
|
15161
15172
|
], ValidateMixin.prototype, "onErrorBagChanged", null);
|
|
15162
15173
|
const ValidateMixinOptions = mixin;
|
|
15163
15174
|
|
|
15175
|
+
;// CONCATENATED MODULE: ./src/eventBus.ts
|
|
15176
|
+
class EventBus {
|
|
15177
|
+
constructor() {
|
|
15178
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15179
|
+
this.listeners = {};
|
|
15180
|
+
this.once = [];
|
|
15181
|
+
}
|
|
15182
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15183
|
+
$on(eventName, callback) {
|
|
15184
|
+
if (eventName in this.listeners) {
|
|
15185
|
+
this.listeners[eventName].push(callback);
|
|
15186
|
+
}
|
|
15187
|
+
else {
|
|
15188
|
+
this.listeners[eventName] = [];
|
|
15189
|
+
this.listeners[eventName].push(callback);
|
|
15190
|
+
}
|
|
15191
|
+
}
|
|
15192
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15193
|
+
$once(eventName, callback) {
|
|
15194
|
+
this.$on(eventName, callback);
|
|
15195
|
+
this.once.push(eventName);
|
|
15196
|
+
}
|
|
15197
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15198
|
+
$off(eventName, callback) {
|
|
15199
|
+
const map = new Map();
|
|
15200
|
+
if (eventName in this.listeners) {
|
|
15201
|
+
this.listeners[eventName].forEach((listener, index) => {
|
|
15202
|
+
map.set(listener, index);
|
|
15203
|
+
});
|
|
15204
|
+
const index = map.get(callback);
|
|
15205
|
+
/* eslint-disable-next-line no-undefined */
|
|
15206
|
+
if (index !== undefined) {
|
|
15207
|
+
this.listeners[eventName].splice(index, 1);
|
|
15208
|
+
if (this.listeners[eventName]?.length === 0) {
|
|
15209
|
+
delete this.listeners[eventName];
|
|
15210
|
+
}
|
|
15211
|
+
}
|
|
15212
|
+
}
|
|
15213
|
+
}
|
|
15214
|
+
$flush() {
|
|
15215
|
+
for (const key in this.listeners) {
|
|
15216
|
+
this.listeners[key] = [];
|
|
15217
|
+
}
|
|
15218
|
+
this.listeners = {};
|
|
15219
|
+
}
|
|
15220
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15221
|
+
$emit(eventName, ...args) {
|
|
15222
|
+
if (eventName in this.listeners) {
|
|
15223
|
+
this.listeners[eventName].forEach(listener => {
|
|
15224
|
+
Function.prototype.apply.call(listener, this, args);
|
|
15225
|
+
if (this.once.includes(eventName)) {
|
|
15226
|
+
this.$off(eventName, listener);
|
|
15227
|
+
this.once = this.once.filter(evName => evName !== eventName);
|
|
15228
|
+
}
|
|
15229
|
+
});
|
|
15230
|
+
}
|
|
15231
|
+
}
|
|
15232
|
+
$has(eventName) {
|
|
15233
|
+
return Boolean(eventName in this.listeners && this.listeners[eventName]);
|
|
15234
|
+
}
|
|
15235
|
+
}
|
|
15236
|
+
const eventBus = new EventBus();
|
|
15237
|
+
|
|
15164
15238
|
;// CONCATENATED MODULE: ./src/vuetify.ts
|
|
15165
15239
|
const aliases = {
|
|
15166
15240
|
SmallButton: 'VBtn',
|
|
@@ -15248,6 +15322,8 @@ const ActiveDirectiveOptions = {
|
|
|
15248
15322
|
|
|
15249
15323
|
|
|
15250
15324
|
|
|
15325
|
+
|
|
15326
|
+
|
|
15251
15327
|
|
|
15252
15328
|
|
|
15253
15329
|
|
|
@@ -15296,6 +15372,17 @@ const ldmuiPlugin = {
|
|
|
15296
15372
|
}
|
|
15297
15373
|
};
|
|
15298
15374
|
vue.directive('active', ActiveDirectiveOptions);
|
|
15375
|
+
const toastedOptions = {
|
|
15376
|
+
position: external_vue_toastification_.POSITION.BOTTOM_RIGHT,
|
|
15377
|
+
timeout: 5000,
|
|
15378
|
+
draggable: false,
|
|
15379
|
+
newestOnTop: true,
|
|
15380
|
+
pauseOnFocusLoss: false,
|
|
15381
|
+
pauseOnHover: false
|
|
15382
|
+
};
|
|
15383
|
+
vue.use((external_vue_toastification_default()), toastedOptions);
|
|
15384
|
+
const toast = (0,external_vue_toastification_.useToast)();
|
|
15385
|
+
vue.config.globalProperties.$toasted = toast;
|
|
15299
15386
|
src_ld_icon(vue, options);
|
|
15300
15387
|
src_ld_loader(vue, options);
|
|
15301
15388
|
src_ld_button(vue, options);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.Vue-Toastification__toast--success {
|
|
2
|
+
background: var(--success);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.Vue-Toastification__toast--error {
|
|
6
|
+
background: var(--error-l-2);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.Vue-Toastification__toast--warning {
|
|
10
|
+
background: var(--warning-l-2);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.Vue-Toastification__toast--info {
|
|
14
|
+
background: var(--primary-l-4);
|
|
15
|
+
}
|
package/dist/scss/index.scss
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface IEventBus {
|
|
2
|
+
$on: (eventName: string, callback: (...args: any) => any) => void;
|
|
3
|
+
$once: (eventName: string, callback: (...args: any) => any) => void;
|
|
4
|
+
$off: (eventName: string, callback: (...args: any) => any) => void;
|
|
5
|
+
$emit: (eventName: string, ...args: any) => void;
|
|
6
|
+
$flush: () => void;
|
|
7
|
+
$has: (eventName: string) => boolean;
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldmjs/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "ldm ui",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"vue-loader": "17.3.1",
|
|
90
90
|
"vue-property-decorator": "10.0.0-rc.3",
|
|
91
91
|
"vue-screen-utils": "1.0.0-beta.13",
|
|
92
|
+
"vue-toastification": "2.0.0-rc.5",
|
|
92
93
|
"vuetify": "3.6.8",
|
|
93
94
|
"webpack": "5.92.0",
|
|
94
95
|
"webpack-cli": "5.1.4",
|