@leaflink/stash 50.0.5 → 50.0.7
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/CurrencyInput.js +55 -50
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +31 -6
- package/dist/DatePicker.js +7 -7
- package/dist/DatePicker.js.map +1 -1
- package/dist/Field.js +1 -1
- package/dist/Field.vue.d.ts +11 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js +88 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js.map +1 -0
- package/dist/FilterSelect.js +67 -56
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +54 -2
- package/dist/Filters.vue.d.ts +162 -96
- package/dist/Input.js +97 -91
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +31 -21
- package/dist/InputOptions.js +83 -62
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +49 -16
- package/dist/ListView.vue.d.ts +231 -134
- package/dist/RadioGroup.js +67 -70
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.vue.d.ts +54 -45
- package/dist/Select.js +350 -336
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +54 -47
- package/dist/TextEditor.js +671 -684
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +54 -61
- package/dist/Textarea.js +65 -59
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +50 -32
- package/dist/components.css +2 -2
- package/package.json +1 -1
- package/styles/backwards-compat.css +3 -3
- package/dist/Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js +0 -95
- package/dist/Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js.map +0 -1
package/dist/InputOptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOptions.js","sources":["../src/components/InputOptions/InputOptions.vue"],"sourcesContent":["<script lang=\"ts\">\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type Option = any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type SelectedOption = any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface InputOptionsProps
|
|
1
|
+
{"version":3,"file":"InputOptions.js","sources":["../src/components/InputOptions/InputOptions.vue"],"sourcesContent":["<script lang=\"ts\">\n import Field, { type FieldProps } from '../Field/Field.vue';\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type Option = any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type SelectedOption = any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface InputOptionsProps extends FieldProps {\n /**\n * The current value inclusive of the input & select\n */\n modelValue?: { value: string; option?: SelectedOption };\n\n /**\n * Input type\n */\n type?: string extends 'button' | 'checkbox' | 'radio' | 'submit' ? never : string;\n\n /**\n * Prevents the Selected Option from being truncated, if true\n */\n noTruncate?: boolean;\n\n /**\n * Options for the select\n */\n options?: Option[];\n\n /**\n * Placeholder text for the input\n * **Note:** placeholders should be used to display examples; they should not be used as labels because they are not accessible as labels. If a real label cannot be used, use the `aria-label` attribute.\n */\n placeholder?: string;\n\n /**\n * Indicates whether the inputOptions is disabled.\n */\n disabled?: boolean;\n\n /**\n * Indicates whether the inputOptions is read-only.\n */\n isReadOnly?: boolean;\n }\n</script>\n\n<script lang=\"ts\" setup>\n import { computed, ref, useAttrs, useCssModule, useSlots, watch, watchEffect } from 'vue';\n\n import Input from '../Input/Input.vue';\n import Select from '../Select/Select.vue';\n\n defineOptions({\n name: 'll-input-options',\n });\n\n const props = withDefaults(defineProps<InputOptionsProps>(), {\n modelValue: () => ({ value: '', option: undefined }),\n noTruncate: false,\n options: () => [],\n type: 'text',\n placeholder: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the model value changes\n */\n (\n e: 'update:model-value',\n v: { value?: string; option?: SelectedOption; isValueChange: boolean; type: 'input' | 'select' },\n ): void;\n /**\n * Emitted when either the input or select changes\n */\n (\n e: 'change',\n v: { value?: string; option?: SelectedOption; isValueChange: boolean; type: 'input' | 'select' },\n ): void;\n }>();\n\n const attrs = useAttrs();\n const slots = useSlots();\n const classes = useCssModule();\n const internalInput = ref<string>();\n const isInputFocused = ref(false);\n const selectedOption = ref<Option | undefined>();\n\n const selectAttrs = computed(() => {\n const { disabled, displayBy, trackBy } = attrs;\n\n return { disabled, displayBy, trackBy } as { disabled: boolean; displayBy: string; trackBy: string };\n });\n\n // Input value changed\n function handleInput(val?: string | number) {\n internalInput.value = String(val);\n\n emit('update:model-value', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: true,\n type: 'input',\n });\n }\n\n // Input blurred\n function handleInputChange() {\n emit('change', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: true,\n type: 'input',\n });\n }\n\n function handleSelectChange(val?: Option) {\n selectedOption.value = val;\n\n emit('change', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: false,\n type: 'select',\n });\n emit('update:model-value', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: false,\n type: 'select',\n });\n }\n\n watchEffect(() => {\n if (!selectedOption.value) {\n selectedOption.value = props.options[0];\n }\n });\n\n watch(\n () => props.modelValue.value,\n () => {\n internalInput.value = props.modelValue.value;\n },\n { immediate: true },\n );\n\n watch(\n () => props.modelValue.option,\n () => {\n selectedOption.value = props.modelValue.option;\n },\n { immediate: true },\n );\n\n if (attrs.value) {\n throw new Error('ll-input-options: use :model-value or v-model instead of :value.');\n }\n\n if (attrs.onInput) {\n throw new Error('ll-input-options: use the @update:model-value event instead of @input');\n }\n</script>\n\n<template>\n <Field v-bind=\"props\" class=\"stash-input-options\" data-test=\"stash-input-options\">\n <template #default=\"{ fieldId, labelId }\">\n <div v-if=\"props.isReadOnly\" class=\"tw-flex tw-h-input tw-items-center tw-text-sm\">\n <span :id=\"fieldId\" :aria-labelledby=\"labelId\" class=\"tw-h-min\"\n >{{ internalInput || 0 }} {{ selectedOption?.name }}</span\n >\n </div>\n <div v-else class=\"tw-flex\" :class=\"{ [classes['has-error']]: !!props.errorText }\">\n <Input\n :id=\"fieldId\"\n class=\"stash-input-options__input -tw-mr-[1px] tw-inline-block tw-flex-1\"\n :class=\"[classes.input, { 'tw-z-control': isInputFocused }]\"\n data-test=\"stash-input-options|input\"\n :type=\"props.type\"\n :model-value=\"internalInput\"\n :disabled=\"props.isDisabled || props.disabled\"\n :placeholder=\"props.placeholder\"\n @change=\"handleInputChange\"\n @update:model-value=\"handleInput\"\n @blur=\"isInputFocused = false\"\n @focus=\"isInputFocused = true\"\n />\n\n <Select\n v-bind=\"selectAttrs\"\n single\n hide-search\n prevent-empty\n class=\"stash-input-options__select tw-min-w-20\"\n data-test=\"stash-input-options|select\"\n :class=\"classes.select\"\n :no-truncate=\"noTruncate\"\n :options=\"options\"\n :model-value=\"selectedOption\"\n :disabled=\"props.isDisabled || props.disabled\"\n @update:model-value=\"handleSelectChange\"\n />\n </div>\n </template>\n <template v-if=\"slots.hint\" #hint>\n <!-- @slot Hint slot for rendering text below the input -->\n <slot name=\"hint\"></slot>\n </template>\n </Field>\n</template>\n\n<style module>\n .input input {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n }\n\n .select :global(.stash-select__content) {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n }\n\n .select:global(.stash-select--active .stash-select__content) {\n min-width: 0;\n }\n\n .has-error input,\n .has-error input:hover:not(:focus),\n .has-error :global(.stash-select__content),\n .has-error :global(.stash-select__content:hover:not(:focus)) {\n border-color: var(--color-red-500);\n }\n</style>\n"],"names":["props","__props","emit","__emit","attrs","useAttrs","slots","useSlots","classes","useCssModule","internalInput","ref","isInputFocused","selectedOption","selectAttrs","computed","disabled","displayBy","trackBy","handleInput","val","handleInputChange","handleSelectChange","watchEffect","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DE,U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,MAAMxB,EAAM,WAAW;AAAA,MACvB,MAAM;AACW,QAAAa,EAAA,QAAQb,EAAM,WAAW;AAAA,MAC1C;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGhBI,EAAM;AACF,YAAA,IAAI,MAAM,kEAAkE;AAGpF,QAAIA,EAAM;AACF,YAAA,IAAI,MAAM,uEAAuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -39,12 +39,8 @@ option: undefined;
|
|
|
39
39
|
};
|
|
40
40
|
noTruncate: boolean;
|
|
41
41
|
options: () => never[];
|
|
42
|
-
errorText: undefined;
|
|
43
|
-
hintText: undefined;
|
|
44
|
-
label: undefined;
|
|
45
42
|
type: string;
|
|
46
43
|
placeholder: undefined;
|
|
47
|
-
disabled: boolean;
|
|
48
44
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
49
45
|
"update:model-value": (v: {
|
|
50
46
|
value?: string | undefined;
|
|
@@ -65,12 +61,8 @@ option: undefined;
|
|
|
65
61
|
};
|
|
66
62
|
noTruncate: boolean;
|
|
67
63
|
options: () => never[];
|
|
68
|
-
errorText: undefined;
|
|
69
|
-
hintText: undefined;
|
|
70
|
-
label: undefined;
|
|
71
64
|
type: string;
|
|
72
65
|
placeholder: undefined;
|
|
73
|
-
disabled: boolean;
|
|
74
66
|
}>>> & Readonly<{
|
|
75
67
|
onChange?: ((v: {
|
|
76
68
|
value?: string | undefined;
|
|
@@ -86,10 +78,6 @@ type: 'input' | 'select';
|
|
|
86
78
|
}) => any) | undefined;
|
|
87
79
|
}>, {
|
|
88
80
|
type: string;
|
|
89
|
-
disabled: boolean;
|
|
90
|
-
label: string;
|
|
91
|
-
errorText: string;
|
|
92
|
-
hintText: string;
|
|
93
81
|
placeholder: string;
|
|
94
82
|
options: any[];
|
|
95
83
|
modelValue: {
|
|
@@ -102,19 +90,60 @@ noTruncate: boolean;
|
|
|
102
90
|
}>;
|
|
103
91
|
export default _default;
|
|
104
92
|
|
|
105
|
-
|
|
93
|
+
declare interface FieldProps {
|
|
106
94
|
/**
|
|
107
|
-
*
|
|
95
|
+
* Adds spacing under the field that is consistent whether hint/error text is displayed.
|
|
96
|
+
*/
|
|
97
|
+
addBottomSpace?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Error text to display. Replaces `hintText` (if provided) & adds error styling.
|
|
108
100
|
*/
|
|
109
101
|
errorText?: string;
|
|
110
102
|
/**
|
|
111
|
-
*
|
|
103
|
+
* Displays text below the input; hidden when the isReadOnly prop is truthy.
|
|
112
104
|
*/
|
|
113
105
|
hintText?: string;
|
|
114
106
|
/**
|
|
115
|
-
* Label
|
|
107
|
+
* ID for the Label and Input; must be unique
|
|
108
|
+
*/
|
|
109
|
+
id?: string;
|
|
110
|
+
/**
|
|
111
|
+
* ID for the error text element; useful for aria-errormessage
|
|
112
|
+
*/
|
|
113
|
+
errorId?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Whether it's a readonly field.
|
|
116
|
+
*/
|
|
117
|
+
isReadOnly?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Whether the field is required.
|
|
120
|
+
*/
|
|
121
|
+
isRequired?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Label to render above the input.
|
|
116
124
|
*/
|
|
117
125
|
label?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Show "(optional)" to the right of the label text
|
|
128
|
+
*/
|
|
129
|
+
showOptionalInLabel?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Indicates wheter the field is a fieldset or not
|
|
132
|
+
*/
|
|
133
|
+
fieldset?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Indicates whether the field is disabled.
|
|
136
|
+
*/
|
|
137
|
+
isDisabled?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Indicates whether the field is disabled.
|
|
140
|
+
*
|
|
141
|
+
* @deprecated Use `isDisabled` instead.
|
|
142
|
+
*/
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export declare interface InputOptionsProps extends FieldProps {
|
|
118
147
|
/**
|
|
119
148
|
* The current value inclusive of the input & select
|
|
120
149
|
*/
|
|
@@ -143,6 +172,10 @@ export declare interface InputOptionsProps {
|
|
|
143
172
|
* Indicates whether the inputOptions is disabled.
|
|
144
173
|
*/
|
|
145
174
|
disabled?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Indicates whether the inputOptions is read-only.
|
|
177
|
+
*/
|
|
178
|
+
isReadOnly?: boolean;
|
|
146
179
|
}
|
|
147
180
|
|
|
148
181
|
declare type Option_2 = any;
|