@pequity/squirrel 1.0.21 → 1.0.22
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/dist/cjs/chunks/p-table-loader.js +13 -4
- package/dist/cjs/index.js +49 -16
- package/dist/cjs/inputClassesMixin.js +5 -1
- package/dist/cjs/p-chips.js +3 -3
- package/dist/cjs/p-input-search.js +2 -1
- package/dist/cjs/p-input.js +4 -0
- package/dist/cjs/p-table-header-cell.js +21 -8
- package/dist/cjs/p-table-td.js +6 -6
- package/dist/cjs/p-toggle.js +2 -2
- package/dist/cjs/useInputClasses.js +4 -3
- package/dist/es/chunks/p-table-loader.js +14 -5
- package/dist/es/index.js +49 -16
- package/dist/es/inputClassesMixin.js +5 -1
- package/dist/es/p-chips.js +3 -3
- package/dist/es/p-input-search.js +2 -1
- package/dist/es/p-input.js +4 -0
- package/dist/es/p-table-header-cell.js +22 -9
- package/dist/es/p-table-td.js +6 -6
- package/dist/es/p-toggle.js +2 -2
- package/dist/es/useInputClasses.js +4 -3
- package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +9 -0
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +9 -0
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +18 -0
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +9 -0
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +5 -1
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +17 -1
- package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +9 -0
- package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +9 -0
- package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +9 -0
- package/dist/squirrel/composables/useInputClasses.d.ts +1 -0
- package/dist/squirrel/utils/inputClassesMixin.d.ts +9 -0
- package/dist/style.css +25 -25
- package/package.json +14 -14
- package/squirrel/components/p-chips/p-chips.vue +1 -1
- package/squirrel/components/p-input/p-input.stories.js +1 -0
- package/squirrel/components/p-input/p-input.vue +4 -0
- package/squirrel/components/p-input-search/p-input-search.vue +1 -0
- package/squirrel/components/p-table/p-table.spec.js +0 -23
- package/squirrel/components/p-table/p-table.vue +48 -13
- package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +2 -3
- package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +20 -7
- package/squirrel/components/p-table-loader/p-table-loader.vue +6 -1
- package/squirrel/components/p-table-td/p-table-td.spec.js +13 -13
- package/squirrel/components/p-table-td/p-table-td.vue +4 -4
- package/squirrel/components/p-toggle/p-toggle.vue +1 -1
- package/squirrel/composables/useInputClasses.ts +4 -2
- package/squirrel/utils/inputClassesMixin.ts +5 -1
|
@@ -50,7 +50,7 @@ const isLastCol = computed(() => props.colIndex === cols.value.length - 1);
|
|
|
50
50
|
const tdClass = computed(() => {
|
|
51
51
|
const res = [
|
|
52
52
|
// Common classes for all cells
|
|
53
|
-
'p-0 h-full text-sm',
|
|
53
|
+
'p-0 h-full font-normal text-p-gray-60 text-sm ',
|
|
54
54
|
];
|
|
55
55
|
|
|
56
56
|
if (props.isEditable) {
|
|
@@ -64,19 +64,19 @@ const tdClass = computed(() => {
|
|
|
64
64
|
// Stick the last column's cells to the right
|
|
65
65
|
res.push('td-col-fixed-border-b', 'last:sticky last:right-0 last:z-10');
|
|
66
66
|
} else {
|
|
67
|
-
res.push('border-b border-p-gray-30');
|
|
67
|
+
res.push('border-b border-p-gray-30 border-r border-r-p-blue-10');
|
|
68
68
|
}
|
|
69
69
|
if (props.isSelected) {
|
|
70
70
|
res.push('bg-p-blue-15 group-hover/row:bg-p-blue-15');
|
|
71
71
|
} else {
|
|
72
|
-
res.push('bg-white group-hover/row:bg-p-
|
|
72
|
+
res.push('bg-white group-hover/row:bg-p-gray-10');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
return res;
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
const innerDivClass = computed(() => {
|
|
79
|
-
const res = [
|
|
79
|
+
const res = [];
|
|
80
80
|
|
|
81
81
|
const currentColIsFirstColFixed = isFirstColFixed.value && isFirstCol.value;
|
|
82
82
|
const currentColIsLastColFixed = isLastColFixed.value && isLastCol.value;
|
|
@@ -29,7 +29,7 @@ import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
|
|
|
29
29
|
import { type StyleValue, defineComponent } from 'vue';
|
|
30
30
|
|
|
31
31
|
const TOGGLE_SIZES = {
|
|
32
|
-
sm: `w-
|
|
32
|
+
sm: `w-7 h-4 after:top-[2px] after:left-[2px] after:h-3 after:w-3`,
|
|
33
33
|
md: `w-11 h-6 after:top-[2px] after:left-[2px] after:h-5 after:w-5`,
|
|
34
34
|
lg: `w-[52px] h-7 after:top-0.5 after:left-[2px] after:h-6 after:w-6`,
|
|
35
35
|
};
|
|
@@ -25,6 +25,7 @@ const defaults = {
|
|
|
25
25
|
required: ref(false),
|
|
26
26
|
prefix: ref(false),
|
|
27
27
|
suffix: ref(false),
|
|
28
|
+
rounded: ref(false),
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
type Props = {
|
|
@@ -33,19 +34,20 @@ type Props = {
|
|
|
33
34
|
required: boolean;
|
|
34
35
|
prefix: boolean;
|
|
35
36
|
suffix: boolean;
|
|
37
|
+
rounded: boolean;
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
type Defaults = typeof defaults;
|
|
39
41
|
|
|
40
42
|
export function useInputClasses(props: Partial<Props>) {
|
|
41
43
|
const opts = { ...defaults, ...toRefs(props) } as Defaults;
|
|
42
|
-
const { size, errorMsg, required, prefix, suffix } = opts;
|
|
44
|
+
const { size, errorMsg, required, rounded, prefix, suffix } = opts;
|
|
43
45
|
|
|
44
46
|
const inputClasses = computed(() => {
|
|
45
47
|
const base = `${INPUT_BASE} ${INPUT_SIZES[size.value]}`;
|
|
46
48
|
const spacingLeft = prefix.value ? SPACING_PREFIX[size.value] : SPACING_LEFT[size.value];
|
|
47
49
|
const spacingRight = suffix.value ? SPACING_SUFFIX[size.value] : SPACING_RIGHT[size.value];
|
|
48
|
-
const res = `${base} ${spacingLeft} ${spacingRight} ${errorMsg.value ? INPUT_ERROR : INPUT_NORMAL}`;
|
|
50
|
+
const res = `${base} ${spacingLeft} ${spacingRight} ${errorMsg.value ? INPUT_ERROR : INPUT_NORMAL}${rounded.value ? ' rounded-full' : ''}`;
|
|
49
51
|
|
|
50
52
|
return res;
|
|
51
53
|
});
|
|
@@ -36,6 +36,10 @@ export default defineComponent({
|
|
|
36
36
|
type: Boolean,
|
|
37
37
|
default: false,
|
|
38
38
|
},
|
|
39
|
+
rounded: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
39
43
|
},
|
|
40
44
|
data() {
|
|
41
45
|
return {
|
|
@@ -47,7 +51,7 @@ export default defineComponent({
|
|
|
47
51
|
const base = `${INPUT_BASE} ${INPUT_SIZES[this.size]}`;
|
|
48
52
|
const spacingLeft = this.$slots.prefix ? SPACING_PREFIX[this.size] : SPACING_LEFT[this.size];
|
|
49
53
|
const spacingRight = this.$slots.suffix ? SPACING_SUFFIX[this.size] : SPACING_RIGHT[this.size];
|
|
50
|
-
const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}`;
|
|
54
|
+
const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}${this.rounded ? ' rounded-full' : ''}`;
|
|
51
55
|
|
|
52
56
|
return res;
|
|
53
57
|
},
|