vueless 0.0.219 → 0.0.220
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/composable.ui/index.js +15 -5
- package/package.json +1 -1
- package/ui.form-color-picker/configs/default.config.js +12 -20
- package/ui.form-color-picker/index.vue +2 -2
- package/ui.form-date-picker-range/composables/attrs.composable.js +0 -9
- package/ui.form-date-picker-range/configs/default.config.js +0 -3
- package/ui.form-radio/index.vue +1 -1
- package/web-types.json +4 -4
package/composable.ui/index.js
CHANGED
|
@@ -31,6 +31,7 @@ const SYSTEM_CONFIG_KEY = {
|
|
|
31
31
|
i18n: "i18n",
|
|
32
32
|
strategy: "strategy",
|
|
33
33
|
safelist: "safelist",
|
|
34
|
+
component: "component",
|
|
34
35
|
safelistColors: "safelistColors",
|
|
35
36
|
defaultVariants: "defaultVariants",
|
|
36
37
|
compoundVariants: "compoundVariants",
|
|
@@ -71,7 +72,7 @@ export default function useUI(defaultConfig = {}, propsConfigGetter = null, topL
|
|
|
71
72
|
});
|
|
72
73
|
|
|
73
74
|
function getAttrs(configKey, options) {
|
|
74
|
-
const nestedComponent =
|
|
75
|
+
const nestedComponent = getNestedComponent(defaultConfig[configKey]);
|
|
75
76
|
|
|
76
77
|
const attrs = useAttrs();
|
|
77
78
|
const isDev = import.meta.env.DEV;
|
|
@@ -206,6 +207,7 @@ function mergeConfigs({
|
|
|
206
207
|
i18n,
|
|
207
208
|
strategy,
|
|
208
209
|
safelist,
|
|
210
|
+
component,
|
|
209
211
|
safelistColors,
|
|
210
212
|
defaultVariants,
|
|
211
213
|
compoundVariants,
|
|
@@ -215,13 +217,20 @@ function mergeConfigs({
|
|
|
215
217
|
|
|
216
218
|
for (let key in composedConfig) {
|
|
217
219
|
if (isGlobalConfig || isPropsConfig) {
|
|
218
|
-
if (key ===
|
|
219
|
-
config[key] = propsConfig[key] || globalConfig[key] || defaultConfig[key];
|
|
220
|
-
} else if (key === safelist || key === safelistColors) {
|
|
220
|
+
if (key === safelist || key === safelistColors) {
|
|
221
221
|
if (propsConfig[key]) {
|
|
222
222
|
// eslint-disable-next-line no-console
|
|
223
223
|
console.warn(`Passing '${key}' key in 'config' prop is not allowed.`);
|
|
224
224
|
}
|
|
225
|
+
} else if (key === component) {
|
|
226
|
+
config[key] = propsConfig[key] || defaultConfig[key];
|
|
227
|
+
|
|
228
|
+
if (globalConfig[key]) {
|
|
229
|
+
// eslint-disable-next-line no-console
|
|
230
|
+
console.warn(`Passing '${key}' key in 'config' prop or by global config is not allowed.`);
|
|
231
|
+
}
|
|
232
|
+
} else if (key === strategy) {
|
|
233
|
+
config[key] = propsConfig[key] || globalConfig[key] || defaultConfig[key];
|
|
225
234
|
} else if (key === defaultVariants) {
|
|
226
235
|
config[key] = { ...defaultConfig[key], ...globalConfig[key], ...propsConfig[key] };
|
|
227
236
|
} else if (key === compoundVariants) {
|
|
@@ -391,7 +400,8 @@ function getBaseClasses(value) {
|
|
|
391
400
|
*/
|
|
392
401
|
function getNestedComponent(value) {
|
|
393
402
|
const classes = getBaseClasses(value);
|
|
394
|
-
const
|
|
403
|
+
const component = value?.component || "";
|
|
404
|
+
const match = classes.match(nestedComponentRegEx) || component.match(nestedComponentRegEx);
|
|
395
405
|
|
|
396
406
|
return match ? match[1] : "";
|
|
397
407
|
}
|
package/package.json
CHANGED
|
@@ -4,34 +4,26 @@ export default /*tw*/ {
|
|
|
4
4
|
base: "flex flex-wrap",
|
|
5
5
|
variants: {
|
|
6
6
|
size: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
lg: "gap-3",
|
|
11
|
-
xl: "gap-4",
|
|
7
|
+
sm: "gap-2 mt-px",
|
|
8
|
+
md: "gap-3 mt-0.5",
|
|
9
|
+
lg: "gap-3 mt-1",
|
|
12
10
|
},
|
|
13
11
|
},
|
|
14
12
|
},
|
|
15
|
-
radio: {
|
|
16
|
-
radio: "{URadio} cursor-pointer bg-{color}-500 border-{color}-500 hover:border-{color}-500",
|
|
17
|
-
},
|
|
18
13
|
unselected: "relative flex",
|
|
19
|
-
unselectedRadio: {
|
|
20
|
-
radio: {
|
|
21
|
-
base: "{URadio}",
|
|
22
|
-
compoundVariants: [
|
|
23
|
-
{
|
|
24
|
-
color: "grayscale",
|
|
25
|
-
class: "text-white !border-gray-300 hover:!border-gray-400 focus:!border-gray-400 active:!border-gray-500",
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
14
|
unselectedIcon: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
31
15
|
unselectedIconName: "close",
|
|
16
|
+
unselectedRadio: {
|
|
17
|
+
component: "{URadio}",
|
|
18
|
+
radio: "!text-white !border-gray-300 hover:!border-gray-400 focus:!border-gray-400 active:!border-gray-500",
|
|
19
|
+
},
|
|
20
|
+
radio: {
|
|
21
|
+
component: "{URadio}",
|
|
22
|
+
radio: "bg-{color}-500 border-{color}-500 hover:border-{color}-500",
|
|
23
|
+
},
|
|
32
24
|
defaultVariants: {
|
|
33
|
-
name: "UColorPicker",
|
|
34
25
|
size: "md",
|
|
26
|
+
name: "colorPicker",
|
|
35
27
|
disabled: false,
|
|
36
28
|
colorOptions: [
|
|
37
29
|
"red",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:id="id"
|
|
16
16
|
:name="name"
|
|
17
17
|
:size="size"
|
|
18
|
-
color="
|
|
18
|
+
color="gray"
|
|
19
19
|
:checked="selectedItem === ''"
|
|
20
20
|
:disabled="disabled"
|
|
21
21
|
v-bind="unselectedRadioAttrs"
|
|
@@ -108,7 +108,7 @@ const props = defineProps({
|
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Color picker size.
|
|
111
|
-
* @values
|
|
111
|
+
* @values sm, md, lg
|
|
112
112
|
*/
|
|
113
113
|
size: {
|
|
114
114
|
type: String,
|
|
@@ -42,15 +42,6 @@ export default function useAttrs(props, { isShownMenu, isTop, isRight }) {
|
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
if (key === "input") {
|
|
46
|
-
const inputAttrs = attrs[`${key}Attrs`];
|
|
47
|
-
|
|
48
|
-
attrs[`${key}Attrs`] = computed(() => ({
|
|
49
|
-
...inputAttrs.value,
|
|
50
|
-
class: cx([inputAttrs.value.class, isShownMenu.value && config.value.inputFocus]),
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
45
|
if (key === "buttonWrapper") {
|
|
55
46
|
const buttonWrapperAttrs = attrs[`${key}Attrs`];
|
|
56
47
|
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: "relative",
|
|
3
3
|
input: "{UInput}",
|
|
4
|
-
inputFocus: {
|
|
5
|
-
block: "ring-4 ring-brand-700 ring-opacity-20 border-brand-500 hover:border-brand-500",
|
|
6
|
-
},
|
|
7
4
|
buttonWrapper: `
|
|
8
5
|
flex rounded-lg max-md:justify-between
|
|
9
6
|
focus-within:ring-4 focus-within:ring-brand-700 focus-within:ring-opacity-20
|
package/ui.form-radio/index.vue
CHANGED
|
@@ -100,7 +100,7 @@ const props = defineProps({
|
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Radio color.
|
|
103
|
-
* @values brand, grayscale, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose
|
|
103
|
+
* @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose
|
|
104
104
|
*/
|
|
105
105
|
color: {
|
|
106
106
|
type: String,
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.220",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -1681,7 +1681,7 @@
|
|
|
1681
1681
|
"kind": "expression",
|
|
1682
1682
|
"type": "string"
|
|
1683
1683
|
},
|
|
1684
|
-
"default": "
|
|
1684
|
+
"default": "colorPicker"
|
|
1685
1685
|
},
|
|
1686
1686
|
{
|
|
1687
1687
|
"name": "label",
|
|
@@ -1715,7 +1715,7 @@
|
|
|
1715
1715
|
"description": "Color picker size.",
|
|
1716
1716
|
"value": {
|
|
1717
1717
|
"kind": "expression",
|
|
1718
|
-
"type": "'
|
|
1718
|
+
"type": "'sm' | 'md' | 'lg'"
|
|
1719
1719
|
},
|
|
1720
1720
|
"default": "md"
|
|
1721
1721
|
},
|
|
@@ -6499,7 +6499,7 @@
|
|
|
6499
6499
|
"description": "Radio color.",
|
|
6500
6500
|
"value": {
|
|
6501
6501
|
"kind": "expression",
|
|
6502
|
-
"type": "'brand' | 'grayscale' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose'"
|
|
6502
|
+
"type": "'brand' | 'grayscale' | 'gray' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose'"
|
|
6503
6503
|
},
|
|
6504
6504
|
"default": "brand"
|
|
6505
6505
|
},
|