@pequity/squirrel 1.0.20 → 1.0.21
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/_plugin-vue_export-helper.js +9 -0
- package/dist/cjs/chunks/p-action-bar.js +60 -0
- package/dist/cjs/chunks/p-card.js +28 -0
- package/dist/cjs/chunks/p-checkbox.js +24 -0
- package/dist/cjs/chunks/p-dropdown-select.js +414 -0
- package/dist/cjs/chunks/p-input-percent.js +53 -0
- package/dist/cjs/chunks/p-pagination-info.js +66 -0
- package/dist/cjs/chunks/p-pagination.js +122 -0
- package/dist/cjs/chunks/p-ring-loader.js +81 -0
- package/dist/cjs/chunks/p-select-btn.js +97 -0
- package/dist/cjs/chunks/p-select.js +123 -0
- package/dist/cjs/chunks/p-table-loader.js +70 -0
- package/dist/cjs/chunks/p-tabs.js +52 -0
- package/dist/cjs/config.js +105 -0
- package/dist/cjs/currency.js +9 -0
- package/dist/cjs/dom.js +27 -0
- package/dist/cjs/index.js +976 -0
- package/dist/cjs/inputClassesMixin.js +50 -0
- package/dist/cjs/inputClassesShared.js +76 -0
- package/dist/cjs/listKeyboardNavigation.js +110 -0
- package/dist/cjs/number.js +9 -0
- package/dist/cjs/object.js +4 -0
- package/dist/cjs/p-action-bar.js +3 -0
- package/dist/cjs/p-alert.js +65 -0
- package/dist/cjs/p-avatar.js +71 -0
- package/dist/cjs/p-btn.js +361 -0
- package/dist/cjs/p-card.js +3 -0
- package/dist/cjs/p-checkbox.js +3 -0
- package/dist/cjs/p-chips.js +110 -0
- package/dist/cjs/p-close-btn.js +36 -0
- package/dist/cjs/p-date-picker.js +139 -0
- package/dist/cjs/p-drawer.js +253 -0
- package/dist/cjs/p-dropdown-select.js +3 -0
- package/dist/cjs/p-dropdown.js +138 -0
- package/dist/cjs/p-file-upload.js +21 -0
- package/dist/cjs/p-info-icon.js +35 -0
- package/dist/cjs/p-inline-date-picker.js +142 -0
- package/dist/cjs/p-input-number.js +146 -0
- package/dist/cjs/p-input-percent.js +3 -0
- package/dist/cjs/p-input-search.js +110 -0
- package/dist/cjs/p-input.js +89 -0
- package/dist/cjs/p-loading.js +38 -0
- package/dist/cjs/p-modal.js +369 -0
- package/dist/cjs/p-pagination-info.js +3 -0
- package/dist/cjs/p-pagination.js +3 -0
- package/dist/cjs/p-progress-bar.js +41 -0
- package/dist/cjs/p-ring-loader.js +3 -0
- package/dist/cjs/p-select-btn.js +3 -0
- package/dist/cjs/p-select-list.js +4 -0
- package/dist/cjs/p-select-pill.js +111 -0
- package/dist/cjs/p-select.js +3 -0
- package/dist/cjs/p-skeleton-loader.js +73 -0
- package/dist/cjs/p-table-filter-icon.js +20 -0
- package/dist/cjs/p-table-header-cell.js +75 -0
- package/dist/cjs/p-table-loader.js +3 -0
- package/dist/cjs/p-table-sort.js +8 -0
- package/dist/cjs/p-table-td.js +88 -0
- package/dist/cjs/p-table.js +12 -0
- package/dist/cjs/p-tabs.js +3 -0
- package/dist/cjs/p-textarea.js +73 -0
- package/dist/cjs/p-toggle.js +114 -0
- package/dist/cjs/pagination.js +29 -0
- package/dist/cjs/string.js +12 -0
- package/dist/cjs/tailwind.js +4353 -0
- package/dist/cjs/text.js +16 -0
- package/dist/cjs/useInputClasses.js +44 -0
- package/dist/cjs/usePLoading.js +35 -0
- package/dist/cjs/usePModal.js +21 -0
- package/dist/cjs/usePTableColResize.js +81 -0
- package/dist/cjs/usePTableRowVirtualizer.js +31 -0
- package/dist/cjs/useSelectList.js +256 -0
- package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
- package/dist/es/chunks/p-action-bar.js +61 -0
- package/dist/es/chunks/p-card.js +29 -0
- package/dist/es/chunks/p-checkbox.js +25 -0
- package/dist/es/chunks/p-dropdown-select.js +415 -0
- package/dist/es/chunks/p-input-percent.js +54 -0
- package/dist/es/chunks/p-pagination-info.js +67 -0
- package/dist/es/chunks/p-pagination.js +123 -0
- package/dist/es/chunks/p-ring-loader.js +82 -0
- package/dist/es/chunks/p-select-btn.js +98 -0
- package/dist/es/chunks/p-select.js +124 -0
- package/dist/es/chunks/p-table-loader.js +71 -0
- package/dist/es/chunks/p-tabs.js +53 -0
- package/dist/es/config.js +105 -0
- package/dist/es/currency.js +9 -0
- package/dist/es/dom.js +27 -0
- package/dist/es/index.js +978 -0
- package/dist/es/inputClassesMixin.js +51 -0
- package/dist/es/inputClassesShared.js +76 -0
- package/dist/es/listKeyboardNavigation.js +110 -0
- package/dist/es/number.js +9 -0
- package/dist/es/object.js +4 -0
- package/dist/es/p-action-bar.js +4 -0
- package/dist/es/p-alert.js +66 -0
- package/dist/es/p-avatar.js +72 -0
- package/dist/es/p-btn.js +362 -0
- package/dist/es/p-card.js +4 -0
- package/dist/es/p-checkbox.js +4 -0
- package/dist/es/p-chips.js +111 -0
- package/dist/es/p-close-btn.js +37 -0
- package/dist/es/p-date-picker.js +140 -0
- package/dist/es/p-drawer.js +254 -0
- package/dist/es/p-dropdown-select.js +4 -0
- package/dist/es/p-dropdown.js +139 -0
- package/dist/es/p-file-upload.js +21 -0
- package/dist/es/p-info-icon.js +36 -0
- package/dist/es/p-inline-date-picker.js +143 -0
- package/dist/es/p-input-number.js +147 -0
- package/dist/es/p-input-percent.js +4 -0
- package/dist/es/p-input-search.js +111 -0
- package/dist/es/p-input.js +90 -0
- package/dist/es/p-loading.js +39 -0
- package/dist/es/p-modal.js +370 -0
- package/dist/es/p-pagination-info.js +4 -0
- package/dist/es/p-pagination.js +4 -0
- package/dist/es/p-progress-bar.js +42 -0
- package/dist/es/p-ring-loader.js +4 -0
- package/dist/es/p-select-btn.js +4 -0
- package/dist/es/p-select-list.js +4 -0
- package/dist/es/p-select-pill.js +112 -0
- package/dist/es/p-select.js +4 -0
- package/dist/es/p-skeleton-loader.js +74 -0
- package/dist/es/p-table-filter-icon.js +21 -0
- package/dist/es/p-table-header-cell.js +76 -0
- package/dist/es/p-table-loader.js +4 -0
- package/dist/es/p-table-sort.js +8 -0
- package/dist/es/p-table-td.js +89 -0
- package/dist/es/p-table.js +12 -0
- package/dist/es/p-tabs.js +4 -0
- package/dist/es/p-textarea.js +74 -0
- package/dist/es/p-toggle.js +115 -0
- package/dist/es/pagination.js +29 -0
- package/dist/es/string.js +12 -0
- package/dist/es/tailwind.js +4353 -0
- package/dist/es/text.js +16 -0
- package/dist/es/useInputClasses.js +44 -0
- package/dist/es/usePLoading.js +35 -0
- package/dist/es/usePModal.js +21 -0
- package/dist/es/usePTableColResize.js +81 -0
- package/dist/es/usePTableRowVirtualizer.js +31 -0
- package/dist/es/useSelectList.js +256 -0
- package/dist/style.css +2124 -1
- package/package.json +26 -24
- package/dist/squirrel.cjs.js +0 -5
- package/dist/squirrel.es.js +0 -8220
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import PInfoIcon from "./p-info-icon.js";
|
|
2
|
+
import inputClassesMixin from "./inputClassesMixin.js";
|
|
3
|
+
import { useCurrencyInput } from "vue-currency-input";
|
|
4
|
+
import { defineComponent, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createBlock, mergeProps, withDirectives, vShow } from "vue";
|
|
5
|
+
import { kebabCase } from "lodash-es";
|
|
6
|
+
import { toNumberOrNull } from "./number.js";
|
|
7
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
8
|
+
const ALL_OPTIONS = [
|
|
9
|
+
"locale",
|
|
10
|
+
"currency",
|
|
11
|
+
"currencyDisplay",
|
|
12
|
+
"hideGroupingSeparatorOnFocus",
|
|
13
|
+
"hideCurrencySymbolOnFocus",
|
|
14
|
+
"hideNegligibleDecimalDigitsOnFocus",
|
|
15
|
+
"precision",
|
|
16
|
+
"autoDecimalDigits",
|
|
17
|
+
"valueRange",
|
|
18
|
+
"useGrouping",
|
|
19
|
+
"valueScaling"
|
|
20
|
+
];
|
|
21
|
+
const _sfc_main = defineComponent({
|
|
22
|
+
name: "PInputNumber",
|
|
23
|
+
components: {
|
|
24
|
+
PInfoIcon
|
|
25
|
+
},
|
|
26
|
+
mixins: [inputClassesMixin],
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: {
|
|
29
|
+
modelValue: {
|
|
30
|
+
type: [Number, String],
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
label: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
errorMsg: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
required: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
selectOnClick: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
tooltipText: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
emits: ["update:modelValue", "change"],
|
|
55
|
+
setup(props, { attrs, emit, expose }) {
|
|
56
|
+
const DEFAULTS = {
|
|
57
|
+
locale: "en-US",
|
|
58
|
+
currency: "USD",
|
|
59
|
+
precision: 0,
|
|
60
|
+
currencyDisplay: "hidden"
|
|
61
|
+
};
|
|
62
|
+
const inputCurrencyOptions = computed(() => {
|
|
63
|
+
ALL_OPTIONS.forEach((key) => {
|
|
64
|
+
const attr = attrs[kebabCase(key)];
|
|
65
|
+
if (attr && typeof attr !== "undefined") {
|
|
66
|
+
DEFAULTS[key] = attr;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return DEFAULTS;
|
|
70
|
+
});
|
|
71
|
+
const { inputRef, numberValue, setValue } = useCurrencyInput(
|
|
72
|
+
inputCurrencyOptions.value,
|
|
73
|
+
false
|
|
74
|
+
);
|
|
75
|
+
watch(numberValue, (value) => {
|
|
76
|
+
emit("update:modelValue", toNumberOrNull(value));
|
|
77
|
+
});
|
|
78
|
+
watch(
|
|
79
|
+
() => props.modelValue,
|
|
80
|
+
(value) => {
|
|
81
|
+
setValue(toNumberOrNull(value));
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
const computedAttrs = computed(() => {
|
|
85
|
+
const { class: classes, style: style2, ...rest } = attrs;
|
|
86
|
+
return rest;
|
|
87
|
+
});
|
|
88
|
+
const style = computed(() => {
|
|
89
|
+
return attrs.style;
|
|
90
|
+
});
|
|
91
|
+
const focus = () => {
|
|
92
|
+
props.selectOnClick && inputRef.value.select();
|
|
93
|
+
};
|
|
94
|
+
expose({ setValue });
|
|
95
|
+
return { inputRef, computedAttrs, style, focus };
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const _hoisted_1 = ["data-has-error"];
|
|
99
|
+
const _hoisted_2 = { class: "flex flex-row items-center" };
|
|
100
|
+
const _hoisted_3 = { class: "relative w-full" };
|
|
101
|
+
const _hoisted_4 = { key: 0 };
|
|
102
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
103
|
+
const _component_PInfoIcon = resolveComponent("PInfoIcon");
|
|
104
|
+
return openBlock(), createElementBlock("div", {
|
|
105
|
+
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
|
|
106
|
+
"data-has-error": !!_ctx.errorMsg,
|
|
107
|
+
style: normalizeStyle(_ctx.style)
|
|
108
|
+
}, [
|
|
109
|
+
createElementVNode("div", _hoisted_2, [
|
|
110
|
+
renderSlot(_ctx.$slots, "label", {
|
|
111
|
+
label: _ctx.label,
|
|
112
|
+
labelClasses: _ctx.labelClasses
|
|
113
|
+
}, () => [
|
|
114
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
115
|
+
key: 0,
|
|
116
|
+
class: normalizeClass(_ctx.labelClasses)
|
|
117
|
+
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
|
|
118
|
+
]),
|
|
119
|
+
_ctx.tooltipText ? (openBlock(), createBlock(_component_PInfoIcon, {
|
|
120
|
+
key: 0,
|
|
121
|
+
text: _ctx.tooltipText,
|
|
122
|
+
class: "ml-1"
|
|
123
|
+
}, null, 8, ["text"])) : createCommentVNode("", true)
|
|
124
|
+
]),
|
|
125
|
+
createElementVNode("div", _hoisted_3, [
|
|
126
|
+
!!_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
127
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
128
|
+
])) : createCommentVNode("", true),
|
|
129
|
+
createElementVNode("input", mergeProps({
|
|
130
|
+
ref: "inputRef",
|
|
131
|
+
type: "text"
|
|
132
|
+
}, _ctx.computedAttrs, {
|
|
133
|
+
class: _ctx.inputClasses,
|
|
134
|
+
onFocus: _cache[0] || (_cache[0] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
135
|
+
}), null, 16)
|
|
136
|
+
]),
|
|
137
|
+
withDirectives(createElementVNode("div", {
|
|
138
|
+
class: normalizeClass(_ctx.errorMsgClasses)
|
|
139
|
+
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
140
|
+
[vShow, _ctx.errorMsg]
|
|
141
|
+
])
|
|
142
|
+
], 14, _hoisted_1);
|
|
143
|
+
}
|
|
144
|
+
const PInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
145
|
+
export {
|
|
146
|
+
PInputNumber as default
|
|
147
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import PInput from "./p-input.js";
|
|
2
|
+
import { INPUT_SIZES } from "./inputClassesShared.js";
|
|
3
|
+
import { defineComponent, resolveComponent, resolveDirective, openBlock, createBlock, mergeProps, withKeys, withCtx, createElementVNode, normalizeClass, withDirectives, createElementBlock, createCommentVNode } from "vue";
|
|
4
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
|
+
const _sfc_main = defineComponent({
|
|
6
|
+
name: "PInputSearch",
|
|
7
|
+
components: {
|
|
8
|
+
PInput
|
|
9
|
+
},
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "md",
|
|
19
|
+
validator(value) {
|
|
20
|
+
return Object.keys(INPUT_SIZES).includes(value);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
showEnterIcon: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue", "enter"],
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
query: this.modelValue,
|
|
32
|
+
showEnterIconOnFocus: false
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
searchIconClasses() {
|
|
37
|
+
return `search search-${this.size}`;
|
|
38
|
+
},
|
|
39
|
+
enterIconClasses() {
|
|
40
|
+
return `enter enter-${this.size}`;
|
|
41
|
+
},
|
|
42
|
+
clearIconClasses() {
|
|
43
|
+
return `clear clear-${this.size}`;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
watch: {
|
|
47
|
+
modelValue(value) {
|
|
48
|
+
this.query = value;
|
|
49
|
+
},
|
|
50
|
+
query(value) {
|
|
51
|
+
this.$emit("update:modelValue", value);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
clearSearch() {
|
|
56
|
+
this.query = "";
|
|
57
|
+
requestAnimationFrame(() => {
|
|
58
|
+
this.$refs.searchInput.$el.querySelector("input").focus();
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
keydownEnter() {
|
|
62
|
+
this.$emit("enter", this.query);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
67
|
+
const _component_PInput = resolveComponent("PInput");
|
|
68
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
69
|
+
return openBlock(), createBlock(_component_PInput, mergeProps({
|
|
70
|
+
ref: "searchInput",
|
|
71
|
+
modelValue: _ctx.query,
|
|
72
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.query = $event),
|
|
73
|
+
size: _ctx.size
|
|
74
|
+
}, _ctx.$attrs, {
|
|
75
|
+
role: "searchbox",
|
|
76
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.showEnterIconOnFocus = true),
|
|
77
|
+
onFocusout: _cache[3] || (_cache[3] = ($event) => _ctx.showEnterIconOnFocus = false),
|
|
78
|
+
onKeydown: withKeys(_ctx.keydownEnter, ["enter"])
|
|
79
|
+
}), {
|
|
80
|
+
prefix: withCtx(() => [
|
|
81
|
+
createElementVNode("i", {
|
|
82
|
+
class: normalizeClass(["icon absolute bg-no-repeat outline-none", _ctx.searchIconClasses])
|
|
83
|
+
}, null, 2)
|
|
84
|
+
]),
|
|
85
|
+
suffix: withCtx(() => [
|
|
86
|
+
_ctx.query && _ctx.showEnterIcon && _ctx.showEnterIconOnFocus ? withDirectives((openBlock(), createElementBlock("i", {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: normalizeClass(["icon absolute bg-no-repeat outline-none", _ctx.enterIconClasses])
|
|
89
|
+
}, null, 2)), [
|
|
90
|
+
[
|
|
91
|
+
_directive_tooltip,
|
|
92
|
+
{ content: "Press enter to search", delay: { show: 100, hide: 0 } },
|
|
93
|
+
void 0,
|
|
94
|
+
{ bottom: true }
|
|
95
|
+
]
|
|
96
|
+
]) : createCommentVNode("", true),
|
|
97
|
+
_ctx.query ? (openBlock(), createElementBlock("button", {
|
|
98
|
+
key: 1,
|
|
99
|
+
role: "button",
|
|
100
|
+
"aria-label": "Clear search input",
|
|
101
|
+
class: normalizeClass(["icon absolute cursor-pointer bg-no-repeat", _ctx.clearIconClasses]),
|
|
102
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clearSearch && _ctx.clearSearch(...args))
|
|
103
|
+
}, null, 2)) : createCommentVNode("", true)
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
}, 16, ["modelValue", "size", "onKeydown"]);
|
|
107
|
+
}
|
|
108
|
+
const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3de99c69"]]);
|
|
109
|
+
export {
|
|
110
|
+
PInputSearch as default
|
|
111
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import inputClassesMixin from "./inputClassesMixin.js";
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, toDisplayString, createCommentVNode, createElementVNode, mergeProps, withDirectives, vShow } from "vue";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const INPUT_TYPES = { TEXT: "text", PASSWORD: "password" };
|
|
5
|
+
const _sfc_main = defineComponent({
|
|
6
|
+
name: "PInput",
|
|
7
|
+
mixins: [inputClassesMixin],
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: INPUT_TYPES.TEXT,
|
|
17
|
+
validator(value) {
|
|
18
|
+
return Object.values(INPUT_TYPES).includes(value);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
errorMsg: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
required: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:modelValue"],
|
|
35
|
+
computed: {
|
|
36
|
+
attrs() {
|
|
37
|
+
const { class: classes, style, ...rest } = this.$attrs;
|
|
38
|
+
return rest;
|
|
39
|
+
},
|
|
40
|
+
style() {
|
|
41
|
+
return this.$attrs.style;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const _hoisted_1 = ["data-has-error"];
|
|
46
|
+
const _hoisted_2 = { class: "relative w-full" };
|
|
47
|
+
const _hoisted_3 = { key: 0 };
|
|
48
|
+
const _hoisted_4 = ["type", "value"];
|
|
49
|
+
const _hoisted_5 = { key: 1 };
|
|
50
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
51
|
+
return openBlock(), createElementBlock("div", {
|
|
52
|
+
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
|
|
53
|
+
"data-has-error": !!_ctx.errorMsg,
|
|
54
|
+
style: normalizeStyle(_ctx.style)
|
|
55
|
+
}, [
|
|
56
|
+
renderSlot(_ctx.$slots, "label", {
|
|
57
|
+
label: _ctx.label,
|
|
58
|
+
labelClasses: _ctx.labelClasses
|
|
59
|
+
}, () => [
|
|
60
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
61
|
+
key: 0,
|
|
62
|
+
class: normalizeClass(_ctx.labelClasses)
|
|
63
|
+
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
|
|
64
|
+
]),
|
|
65
|
+
createElementVNode("div", _hoisted_2, [
|
|
66
|
+
!!_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
67
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
68
|
+
])) : createCommentVNode("", true),
|
|
69
|
+
createElementVNode("input", mergeProps({
|
|
70
|
+
type: _ctx.type,
|
|
71
|
+
value: _ctx.modelValue
|
|
72
|
+
}, _ctx.attrs, {
|
|
73
|
+
class: _ctx.inputClasses,
|
|
74
|
+
onInput: _cache[0] || (_cache[0] = (event) => _ctx.$emit("update:modelValue", event.target.value))
|
|
75
|
+
}), null, 16, _hoisted_4),
|
|
76
|
+
!!_ctx.$slots.suffix ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
77
|
+
renderSlot(_ctx.$slots, "suffix")
|
|
78
|
+
])) : createCommentVNode("", true)
|
|
79
|
+
]),
|
|
80
|
+
withDirectives(createElementVNode("div", {
|
|
81
|
+
class: normalizeClass(_ctx.errorMsgClasses)
|
|
82
|
+
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
83
|
+
[vShow, _ctx.errorMsg]
|
|
84
|
+
])
|
|
85
|
+
], 14, _hoisted_1);
|
|
86
|
+
}
|
|
87
|
+
const PInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
88
|
+
export {
|
|
89
|
+
PInput as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, Transition, withCtx, unref, createElementBlock, createCommentVNode, pushScopeId, popScopeId, createElementVNode } from "vue";
|
|
2
|
+
import { usePLoading } from "./usePLoading.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const _withScopeId = (n) => (pushScopeId("data-v-3a800f21"), n = n(), popScopeId(), n);
|
|
5
|
+
const _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "fixed left-0 top-0 z-[120] flex w-full justify-center",
|
|
8
|
+
"aria-live": "polite",
|
|
9
|
+
"aria-busy": "true"
|
|
10
|
+
};
|
|
11
|
+
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bg-blue-10 h-8 rounded-b border-x border-b border-p-gray-30 px-4 pt-2 text-sm font-semibold leading-none text-p-purple-60 shadow" }, " Loading... ", -1));
|
|
12
|
+
const _hoisted_3 = [
|
|
13
|
+
_hoisted_2
|
|
14
|
+
];
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...{
|
|
17
|
+
name: "PLoading"
|
|
18
|
+
},
|
|
19
|
+
__name: "p-loading",
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const { show } = usePLoading();
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createBlock(Transition, {
|
|
24
|
+
name: "pm-backdrop-transition",
|
|
25
|
+
"enter-active-class": "fadeInDown",
|
|
26
|
+
"leave-active-class": "fadeOutUp"
|
|
27
|
+
}, {
|
|
28
|
+
default: withCtx(() => [
|
|
29
|
+
unref(show) ? (openBlock(), createElementBlock("div", _hoisted_1, _hoisted_3)) : createCommentVNode("", true)
|
|
30
|
+
]),
|
|
31
|
+
_: 1
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const pLoading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3a800f21"]]);
|
|
37
|
+
export {
|
|
38
|
+
pLoading as default
|
|
39
|
+
};
|