mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 23:00:19 +03:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba2036043e | ||
|
|
e113798f50 | ||
|
|
699bf027c0 | ||
|
|
468b0159b1 | ||
|
|
b241003366 |
No files matched your search
Vendored
+5
-2
@@ -64,6 +64,7 @@ declare module '@vue/runtime-core' {
|
||||
'CTextCopyable.demo': typeof import('./src/ui/c-text-copyable/c-text-copyable.demo.vue')['default']
|
||||
CTooltip: typeof import('./src/ui/c-tooltip/c-tooltip.vue')['default']
|
||||
'CTooltip.demo': typeof import('./src/ui/c-tooltip/c-tooltip.demo.vue')['default']
|
||||
CurrencyConverter: typeof import('./src/tools/currency-converter/currency-converter.vue')['default']
|
||||
DateTimeConverter: typeof import('./src/tools/date-time-converter/date-time-converter.vue')['default']
|
||||
'DemoHome.page': typeof import('./src/ui/demo/demo-home.page.vue')['default']
|
||||
DemoWrapper: typeof import('./src/ui/demo/demo-wrapper.vue')['default']
|
||||
@@ -134,15 +135,18 @@ declare module '@vue/runtime-core' {
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDatePicker: typeof import('naive-ui')['NDatePicker']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
NDynamicInput: typeof import('naive-ui')['NDynamicInput']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NP: typeof import('naive-ui')['NP']
|
||||
NSelect: typeof import('naive-ui')['NSelect']
|
||||
NTable: typeof import('naive-ui')['NTable']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||
@@ -185,7 +189,6 @@ declare module '@vue/runtime-core' {
|
||||
UserAgentParser: typeof import('./src/tools/user-agent-parser/user-agent-parser.vue')['default']
|
||||
UserAgentResultCards: typeof import('./src/tools/user-agent-parser/user-agent-result-cards.vue')['default']
|
||||
UuidGenerator: typeof import('./src/tools/uuid-generator/uuid-generator.vue')['default']
|
||||
WeekNumberConverter: typeof import('./src/tools/week-number-converter/week-number-converter.vue')['default']
|
||||
WifiQrCodeGenerator: typeof import('./src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue')['default']
|
||||
XmlFormatter: typeof import('./src/tools/xml-formatter/xml-formatter.vue')['default']
|
||||
XmlToJson: typeof import('./src/tools/xml-to-json/xml-to-json.vue')['default']
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.26.0",
|
||||
"crypto-js": "^4.1.1",
|
||||
"currency-codes-ts": "^3.0.0",
|
||||
"currency-exchanger-js": "^1.0.4",
|
||||
"date-fns": "^2.29.3",
|
||||
"dompurify": "^3.0.6",
|
||||
"email-normalizer": "^1.0.0",
|
||||
|
||||
Generated
+6520
-8078
File diff suppressed because it is too large.
Load diff
@@ -128,7 +128,7 @@ function activateOption(option: PaletteOption) {
|
||||
<c-input-text ref="inputRef" v-model:value="searchPrompt" raw-text placeholder="Type to search a tool or a command..." autofocus clearable />
|
||||
|
||||
<div v-for="(options, category) in filteredSearchResult" :key="category">
|
||||
<div ml-3 mt-3 text-sm font-bold text-primary op-60>
|
||||
<div ml-3 mt-3 text-sm text-primary font-bold op-60>
|
||||
{{ category }}
|
||||
</div>
|
||||
<command-palette-option v-for="option in options" :key="option.name" :option="option" :selected="selectedOptionIndex === getOptionIndex(option)" @activated="activateOption" />
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
<script setup lang="ts">
|
||||
import { code, countries, country } from 'currency-codes-ts';
|
||||
import converter from 'currency-exchanger-js';
|
||||
import moneysData from './moneys.json';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const allCurrencies = Object.entries(moneysData).map(([k, v]) => ({ value: k, label: v || k }));
|
||||
const otherCurrencies = useQueryParamOrStorage<{ name: string }[]>({ name: 'to', storageName: 'currency-conv:others', defaultValue: [{ name: 'usd' }] });
|
||||
const currentCurrency = useQueryParamOrStorage<string>({ name: 'from', storageName: 'currency-conv:cur', defaultValue: 'eur' });
|
||||
const amount = ref(1);
|
||||
const currentDatetime = ref(Date.now());
|
||||
|
||||
const convertedCurrencies = computedAsync<Record<string, number>>(async () => {
|
||||
const currentCurrencyValue = currentCurrency.value;
|
||||
const currentDatetimeValue = currentDatetime.value;
|
||||
const amountValue = amount.value;
|
||||
const otherCurrenciesValues = otherCurrencies.value;
|
||||
|
||||
let result = {};
|
||||
for (const targetCurrency of otherCurrenciesValues) {
|
||||
const value = await converter.convertOnDate(amountValue, currentCurrencyValue, targetCurrency.name, new Date(currentDatetimeValue));
|
||||
result = { ...result, [targetCurrency.name]: value };
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
const countryToCurrenciesInput = ref('France');
|
||||
const allCountries = countries();
|
||||
const countryToCurrenciesOutput = computed(() => country(countryToCurrenciesInput.value));
|
||||
|
||||
const currencyToCountriesInput = ref('eur');
|
||||
const currencyToCountriesOutput = computed(() => code(currencyToCountriesInput.value));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Currency Converter" mb-2>
|
||||
<c-select
|
||||
v-model:value="currentCurrency"
|
||||
label="From"
|
||||
label-position="left"
|
||||
searchable
|
||||
:options="allCurrencies"
|
||||
mb-2
|
||||
/>
|
||||
<n-form-item label="Amount:" label-placement="left" mb-2>
|
||||
<n-input-number v-model:value="amount" :min="0" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="For Date:" label-placement="left" mb-2>
|
||||
<n-date-picker
|
||||
v-model:value="currentDatetime"
|
||||
type="date"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<c-card title="Converted currencies">
|
||||
<n-dynamic-input
|
||||
v-model:value="otherCurrencies"
|
||||
show-sort-button
|
||||
:on-create="() => ({ name: 'eur' })"
|
||||
>
|
||||
<template #default="{ value }">
|
||||
<div flex flex-wrap items-center gap-1>
|
||||
<n-select
|
||||
v-model:value="value.name"
|
||||
filterable
|
||||
placeholder="Please select a currency"
|
||||
:options="allCurrencies"
|
||||
w-full
|
||||
/>
|
||||
<input-copyable readonly :value="convertedCurrencies ? convertedCurrencies[value.name] : 0" />
|
||||
</div>
|
||||
</template>
|
||||
</n-dynamic-input>
|
||||
</c-card>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Country to Currencies" mb-2>
|
||||
<c-select
|
||||
v-model:value="countryToCurrenciesInput"
|
||||
label="Country"
|
||||
label-position="left"
|
||||
searchable
|
||||
:options="allCountries"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<ul>
|
||||
<li v-for="(currency, ix) in countryToCurrenciesOutput" :key="ix">
|
||||
{{ currency.currency }} [{{ currency.code }}/{{ currency.number }} - {{ currency.digits }}digits] (also in: {{ currency.countries?.join(', ') }})
|
||||
</li>
|
||||
</ul>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Currencies to Countries" mb-2>
|
||||
<c-select
|
||||
v-model:value="currencyToCountriesInput"
|
||||
label="Currency"
|
||||
label-position="left"
|
||||
searchable
|
||||
:options="allCurrencies"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-p v-if="currencyToCountriesOutput">
|
||||
{{ currencyToCountriesOutput.currency }} [{{ currencyToCountriesOutput.code }}/{{ currencyToCountriesOutput.number }} - {{ currencyToCountriesOutput.digits }}digits]
|
||||
</n-p>
|
||||
|
||||
<ul v-if="currencyToCountriesOutput">
|
||||
<li v-for="(countryName, ix) in currencyToCountriesOutput.countries" :key="ix">
|
||||
{{ countryName }}
|
||||
</li>
|
||||
</ul>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,4 @@
|
||||
declare module 'currency-exchanger-js'{
|
||||
export function convertOnDate(value: number,fromCurrency: string,toCurrency: string,inputDate: Date): number;
|
||||
export function convert(value: number,fromCurrency: string,toCurrency: string): number;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Currency } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Currency Converter',
|
||||
path: '/currency-converter',
|
||||
description: 'Convert currency values using https://github.com/fawazahmed0/exchange-api',
|
||||
keywords: ['currency', 'converter'],
|
||||
component: () => import('./currency-converter.vue'),
|
||||
icon: Currency,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{ "1000sats": "", "1inch": "1inch", "aave": "Aave", "ada": "Cardano", "aed": "Emirati Dirham", "afn": "Afghan Afghani", "agix": "SingularityNET", "akt": "Akash Network", "algo": "Algorand", "all": "Albanian Lek", "amd": "Armenian Dram", "amp": "Amp", "ang": "Dutch Guilder", "aoa": "Angolan Kwanza", "ape": "ApeCoin", "apt": "Aptos", "ar": "Arweave", "arb": "Arbitrum", "ars": "Argentine Peso", "atom": "Cosmos", "ats": "Austrian Schilling", "aud": "Australian Dollar", "avax": "Avalanche", "awg": "Aruban or Dutch Guilder", "axs": "Axie Infinity", "azm": "Azerbaijani Manat", "azn": "Azerbaijan Manat", "bake": "BakeryToken", "bam": "Bosnian Convertible Mark", "bat": "Basic Attention Token", "bbd": "Barbadian or Bajan Dollar", "bch": "Bitcoin Cash", "bdt": "Bangladeshi Taka", "bef": "Belgian Franc", "bgn": "Bulgarian Lev", "bhd": "Bahraini Dinar", "bif": "Burundian Franc", "bmd": "Bermudian Dollar", "bnb": "Binance Coin", "bnd": "Bruneian Dollar", "bob": "Bolivian Bolíviano", "brl": "Brazilian Real", "bsd": "Bahamian Dollar", "bsv": "Bitcoin SV", "bsw": "Biswap", "btc": "Bitcoin", "btcb": "Bitcoin BEP2", "btg": "Bitcoin Gold", "btn": "Bhutanese Ngultrum", "btt": "BitTorrent", "busd": "Binance USD", "bwp": "Botswana Pula", "byn": "Belarusian Ruble", "byr": "Belarusian Ruble", "bzd": "Belizean Dollar", "cad": "Canadian Dollar", "cake": "PancakeSwap", "cdf": "Congolese Franc", "celo": "Celo", "cfx": "Conflux", "chf": "Swiss Franc", "chz": "Chiliz", "clp": "Chilean Peso", "cnh": "Chinese Yuan Renminbi Offshore", "cny": "Chinese Yuan Renminbi", "comp": "Compound", "cop": "Colombian Peso", "crc": "Costa Rican Colon", "cro": "Crypto.com Chain", "crv": "Curve DAO Token", "cspr": "Casper", "cuc": "Cuban Convertible Peso", "cup": "Cuban Peso", "cve": "Cape Verdean Escudo", "cvx": "Convex Finance", "cyp": "Cypriot Pound", "czk": "Czech Koruna", "dai": "DAI", "dash": "Digital Cash", "dcr": "Decred", "dem": "German Deutsche Mark", "dfi": "DfiStarter", "djf": "Djiboutian Franc", "dkk": "Danish Krone", "doge": "Dogecoin", "dop": "Dominican Peso", "dot": "Polkadot", "dydx": "dYdX", "dzd": "Algerian Dinar", "eek": "Estonian Kroon", "egld": "Elrond", "egp": "Egyptian Pound", "enj": "Enjin Coin", "eos": "EOS", "ern": "Eritrean Nakfa", "esp": "Spanish Peseta", "etb": "Ethiopian Birr", "etc": "Ethereum Classic", "eth": "Ethereum", "eur": "Euro", "fei": "Fei USD", "fil": "Filecoin", "fim": "Finnish Markka", "fjd": "Fijian Dollar", "fkp": "Falkland Island Pound", "flow": "Flow", "flr": "FLARE", "frax": "Frax", "frf": "French Franc", "ftm": "Fantom", "ftt": "FarmaTrust", "fxs": "Frax Share", "gala": "Gala", "gbp": "British Pound", "gel": "Georgian Lari", "ggp": "Guernsey Pound", "ghc": "Ghanaian Cedi", "ghs": "Ghanaian Cedi", "gip": "Gibraltar Pound", "gmd": "Gambian Dalasi", "gmx": "Goldmaxcoin", "gnf": "Guinean Franc", "gno": "Gnosis", "grd": "Greek Drachma", "grt": "The Graph", "gt": "GateToken", "gtq": "Guatemalan Quetzal", "gusd": "Gemini US Dollar", "gyd": "Guyanese Dollar", "hbar": "Hedera", "hkd": "Hong Kong Dollar", "hnl": "Honduran Lempira", "hnt": "Helium", "hot": "Hydro Protocol", "hrk": "Croatian Kuna", "ht": "Huobi Token", "htg": "Haitian Gourde", "huf": "Hungarian Forint", "icp": "Internet Computer", "idr": "Indonesian Rupiah", "iep": "Irish Pound", "ils": "Israeli Shekel", "imp": "Isle of Man Pound", "imx": "Immutable X", "inj": "Injective", "inr": "Indian Rupee", "iqd": "Iraqi Dinar", "irr": "Iranian Rial", "isk": "Icelandic Krona", "itl": "Italian Lira", "jep": "Jersey Pound", "jmd": "Jamaican Dollar", "jod": "Jordanian Dinar", "jpy": "Japanese Yen", "kas": "", "kava": "Kava", "kcs": "Kucoin", "kda": "Kadena", "kes": "Kenyan Shilling", "kgs": "Kyrgyzstani Som", "khr": "Cambodian Riel", "klay": "Klaytn", "kmf": "Comorian Franc", "knc": "Kyber Network Crystals", "kpw": "North Korean Won", "krw": "South Korean Won", "ksm": "Kusama", "kwd": "Kuwaiti Dinar", "kyd": "Caymanian Dollar", "kzt": "Kazakhstani Tenge", "lak": "Lao Kip", "lbp": "Lebanese Pound", "ldo": "Lido DAO Token", "leo": "LEOcoin", "link": "Chainlink", "lkr": "Sri Lankan Rupee", "lrc": "Loopring", "lrd": "Liberian Dollar", "lsl": "Basotho Loti", "ltc": "Litecoin", "ltl": "Lithuanian Litas", "luf": "Luxembourg Franc", "luna": "Terra", "lunc": "", "lvl": "Latvian Lat", "lyd": "Libyan Dinar", "mad": "Moroccan Dirham", "mana": "Mana Coin Decentraland", "matic": "Polygon", "mbx": "MobieCoin", "mdl": "Moldovan Leu", "mga": "Malagasy Ariary", "mgf": "Malagasy Franc", "mina": "Mina", "mkd": "Macedonian Denar", "mkr": "Maker", "mmk": "Burmese Kyat", "mnt": "Mongolian Tughrik", "mop": "Macau Pataca", "mro": "Mauritanian Ouguiya", "mru": "Mauritanian Ouguiya", "mtl": "Maltese Lira", "mur": "Mauritian Rupee", "mvr": "Maldivian Rufiyaa", "mwk": "Malawian Kwacha", "mxn": "Mexican Peso", "mxv": "", "myr": "Malaysian Ringgit", "mzm": "Mozambican Metical", "mzn": "Mozambican Metical", "nad": "Namibian Dollar", "near": "NEAR Protocol", "neo": "NEO", "nexo": "NEXO", "nft": "NFLine truncated
|
||||
+2
-2
@@ -2,7 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter';
|
||||
import { tool as base64StringConverter } from './base64-string-converter';
|
||||
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as emailNormalizer } from './email-normalizer';
|
||||
import { tool as weekNumberConverter } from './week-number-converter';
|
||||
import { tool as currencyConverter } from './currency-converter';
|
||||
|
||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
@@ -116,8 +116,8 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
tomlToYaml,
|
||||
xmlToJson,
|
||||
jsonToXml,
|
||||
currencyConverter,
|
||||
markdownToHtml,
|
||||
weekNumberConverter,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Calendar } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Week Numbers Converter',
|
||||
path: '/week-number-converter',
|
||||
description: 'Convert between ISO Week number, Week number in month and date',
|
||||
keywords: ['week', 'month', 'number', 'iso', 'converter'],
|
||||
component: () => import('./week-number-converter.vue'),
|
||||
icon: Calendar,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
@@ -1,20 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getWeekOfMonth } from 'date-fns';
|
||||
import { getFirstMondayFromISOWeek, getFirstMondayFromMonthWeek } from './week-number-converter.service';
|
||||
|
||||
describe('week-number-converter', () => {
|
||||
describe('getFirstMondayFromISOWeek', () => {
|
||||
it('return right monday date from week number', () => {
|
||||
expect(getFirstMondayFromISOWeek(11, 2022).toDateString()).toBe('Mon Mar 14 2022');
|
||||
expect(getFirstMondayFromISOWeek(1, 2023).toDateString()).toBe('Mon Jan 02 2023');
|
||||
expect(getFirstMondayFromISOWeek(53, 2026).toDateString()).toBe('Mon Dec 28 2026');
|
||||
});
|
||||
});
|
||||
describe('getFirstMondayFromMonthWeek', () => {
|
||||
it('return right date from month week number', () => {
|
||||
expect(getFirstMondayFromMonthWeek(getWeekOfMonth(new Date('2022-03-14')), 3, 2022).toDateString()).toBe('Mon Mar 14 2022');
|
||||
expect(getFirstMondayFromMonthWeek(getWeekOfMonth(new Date('2023-01-02')), 1, 2023).toDateString()).toBe('Mon Jan 02 2023');
|
||||
expect(getFirstMondayFromMonthWeek(getWeekOfMonth(new Date('2026-12-28')), 12, 2026).toDateString()).toBe('Mon Dec 28 2026');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
// Returns the first day (Monday) of the specified week
|
||||
|
||||
// Year defaults to the current local calendar year
|
||||
export function getFirstMondayFromISOWeek(weekInYear: number, year = new Date().getFullYear()) {
|
||||
const d = new Date(year, 0, 4);
|
||||
d.setDate(d.getDate() - (d.getDay() || 7) + 1 + 7 * (weekInYear - 1));
|
||||
return d;
|
||||
}
|
||||
export function getFirstMondayFromMonthWeek(weekInMonth: number, month = new Date().getMonth() + 1, year = new Date().getFullYear()) {
|
||||
const d = new Date(year, month - 1, 4);
|
||||
const day = d.getDay() || 7;
|
||||
d.setDate(d.getDate() - day + 1);
|
||||
d.setDate(d.getDate() + 7 * (weekInMonth - 1));
|
||||
return d;
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { getISOWeek, getWeek, getWeekOfMonth } from 'date-fns';
|
||||
import { getFirstMondayFromISOWeek, getFirstMondayFromMonthWeek } from './week-number-converter.service';
|
||||
|
||||
const now = new Date();
|
||||
|
||||
const inputDate = ref(now.getTime());
|
||||
const outputWeekInMonth = computed(() => getWeekOfMonth(inputDate.value));
|
||||
const outputLocalWeekInYear = computed(() => getWeek(inputDate.value));
|
||||
const outputISOWeekInYear = computed(() => getISOWeek(inputDate.value));
|
||||
|
||||
const inputWeekInMonth = ref({
|
||||
week: getWeekOfMonth(now),
|
||||
month: now.getMonth() + 1,
|
||||
year: now.getFullYear(),
|
||||
});
|
||||
const outputWeekInMonthMonday = computed(() => getFirstMondayFromMonthWeek(inputWeekInMonth.value.week, inputWeekInMonth.value.month, inputWeekInMonth.value.year));
|
||||
|
||||
const inputWeekInYear = ref({
|
||||
week: getWeek(now),
|
||||
year: now.getFullYear(),
|
||||
});
|
||||
const outputWeekInYearMonday = computed(() => getFirstMondayFromISOWeek(inputWeekInYear.value.week, inputWeekInYear.value.year));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Date to Week numbers" mb-2>
|
||||
<n-form-item label="Date:" label-placement="left">
|
||||
<n-date-picker v-model:value="inputDate" type="date" />
|
||||
</n-form-item>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<input-copyable readonly label="Local Week in Year:" label-position="left" label-width="130px" :value="outputLocalWeekInYear" mb-1 />
|
||||
<input-copyable readonly label="ISO Week (in Year):" label-position="left" label-width="130px" :value="outputISOWeekInYear" mb-1 />
|
||||
<input-copyable readonly label="Week in Month:" label-position="left" label-width="130px" :value="outputWeekInMonth" mb-1 />
|
||||
</c-card>
|
||||
<c-card title="ISO Week number to date" mb-2>
|
||||
<div flex items-baseline gap-2>
|
||||
<n-form-item label="ISO Week number:" label-placement="left" flex-1>
|
||||
<n-input-number v-model:value="inputWeekInYear.week" :min="1" :max="53" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Year:" label-placement="left" flex-1>
|
||||
<n-input-number v-model:value="inputWeekInYear.year" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<input-copyable readonly label="First Monday" label-position="left" :value="outputWeekInYearMonday" />
|
||||
</c-card>
|
||||
<c-card title="Week number in month to date" mb-2>
|
||||
<div flex items-baseline gap-2>
|
||||
<n-form-item label="Week in month:" label-placement="left" flex-1>
|
||||
<n-input-number v-model:value="inputWeekInMonth.week" :min="1" :max="5" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Month:" label-placement="left" flex-1>
|
||||
<n-input-number v-model:value="inputWeekInMonth.month" :min="1" :max="12" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Year:" label-placement="left" flex-1>
|
||||
<n-input-number v-model:value="inputWeekInMonth.year" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<input-copyable readonly label="First Monday" label-position="left" :value="outputWeekInMonthMonday" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -151,7 +151,7 @@ function onSearchInput() {
|
||||
>
|
||||
<div flex-1 truncate>
|
||||
<slot name="displayed-value">
|
||||
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current @input="onSearchInput">
|
||||
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full color-current lh-normal @input="onSearchInput">
|
||||
<span v-else-if="selectedOption" lh-normal>
|
||||
{{ selectedOption.label }}
|
||||
</span>
|
||||
|
||||
@@ -39,7 +39,7 @@ const headers = computed(() => {
|
||||
<template>
|
||||
<div class="relative overflow-x-auto rounded">
|
||||
<table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400" role="table" :aria-label="description">
|
||||
<thead v-if="!hideHeaders" class="bg-#ffffff uppercase text-gray-700 dark:bg-#333333 dark:text-gray-400" border-b="1px solid dark:transparent #efeff5">
|
||||
<thead v-if="!hideHeaders" class="bg-#ffffff text-gray-700 uppercase dark:bg-#333333 dark:text-gray-400" border-b="1px solid dark:transparent #efeff5">
|
||||
<tr>
|
||||
<th v-for="header in headers" :key="header.key" scope="col" class="px-6 py-3 text-xs">
|
||||
{{ header.label }}
|
||||
|
||||
Reference in new issue
Block a user