@mixd-id/web-scaffold 0.1.230406067 → 0.1.230406068
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/package.json +1 -1
- package/src/components/ColorPicker.vue +3 -0
- package/src/index.js +7 -0
- package/src/utils/helpers.js +24 -1
package/package.json
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
export default{
|
|
28
28
|
|
|
29
|
+
emits: [ 'change', 'update:modelValue' ],
|
|
30
|
+
|
|
29
31
|
props: {
|
|
30
32
|
|
|
31
33
|
colors: Array,
|
|
@@ -40,6 +42,7 @@ export default{
|
|
|
40
42
|
|
|
41
43
|
select(color){
|
|
42
44
|
this.$emit('update:modelValue', color)
|
|
45
|
+
this.$emit('change')
|
|
43
46
|
this.$refs.contextMenu.close()
|
|
44
47
|
}
|
|
45
48
|
|
package/src/index.js
CHANGED
|
@@ -143,6 +143,10 @@ const unregisterResizeEvent = (fn) => {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
const consoleInfo = (text) => { console.info(text) }
|
|
147
|
+
const consoleLog = (text) => { console.log(text) }
|
|
148
|
+
const consoleWarn = (text) => { console.warn(text) }
|
|
149
|
+
|
|
146
150
|
const util = {
|
|
147
151
|
|
|
148
152
|
push: (arr, item, opt = { key:"id" }) => {
|
|
@@ -239,6 +243,9 @@ export default{
|
|
|
239
243
|
app.config.globalProperties.$util = util
|
|
240
244
|
app.config.globalProperties.$resize = registerResizeEvent
|
|
241
245
|
app.config.globalProperties.$unresize = unregisterResizeEvent
|
|
246
|
+
app.config.globalProperties.log = consoleLog
|
|
247
|
+
app.config.globalProperties.warn = consoleWarn
|
|
248
|
+
app.config.globalProperties.info = consoleInfo
|
|
242
249
|
|
|
243
250
|
app.component('Alert', defineAsyncComponent(() => import("./components/Alert.vue")))
|
|
244
251
|
app.component('Button', defineAsyncComponent(() => import("./components/Button.vue")))
|
package/src/utils/helpers.js
CHANGED
|
@@ -274,6 +274,27 @@ const accessNestedObject = function(obj, path) {
|
|
|
274
274
|
return nestedObj;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
const cssDict = {
|
|
278
|
+
'Global': '*',
|
|
279
|
+
'Font': 'font-family',
|
|
280
|
+
'Impact': "'Impact', 'Arial Black', 'Arial Bold', Gadget, sans-serif",
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const generateStylesheet = (styleObj) => {
|
|
284
|
+
|
|
285
|
+
return `*{ font-family: Impact; }`
|
|
286
|
+
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const hexToRgb = (hex) => {
|
|
290
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
291
|
+
return result ? {
|
|
292
|
+
r: parseInt(result[1], 16),
|
|
293
|
+
g: parseInt(result[2], 16),
|
|
294
|
+
b: parseInt(result[3], 16)
|
|
295
|
+
} : null;
|
|
296
|
+
}
|
|
297
|
+
|
|
277
298
|
|
|
278
299
|
module.exports = {
|
|
279
300
|
ceil,
|
|
@@ -293,5 +314,7 @@ module.exports = {
|
|
|
293
314
|
sequelizeChunk,
|
|
294
315
|
getPresetSortWhereParams,
|
|
295
316
|
unflatten,
|
|
296
|
-
accessNestedObject
|
|
317
|
+
accessNestedObject,
|
|
318
|
+
generateStylesheet,
|
|
319
|
+
hexToRgb
|
|
297
320
|
}
|