@fangzhongya/fang-ui 0.1.43 → 0.1.45
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/components/buttons/src/index2.cjs +15 -8
- package/dist/components/buttons/src/index2.js +13 -6
- package/dist/components/common/use.cjs +34 -27
- package/dist/components/common/use.js +14 -7
- package/dist/components/dates/src/data.cjs +6 -0
- package/dist/components/dates/src/data.d.ts +6 -0
- package/dist/components/dates/src/data.js +6 -0
- package/dist/components/dates/src/index2.cjs +12 -1
- package/dist/components/dates/src/index2.js +12 -1
- package/dist/components/dates-divide/src/data.cjs +7 -1
- package/dist/components/dates-divide/src/data.d.ts +6 -0
- package/dist/components/dates-divide/src/data.js +7 -1
- package/dist/components/dates-divide/src/index2.cjs +13 -4
- package/dist/components/dates-divide/src/index2.js +13 -4
- package/dist/components/dates-picker/src/data.cjs +6 -0
- package/dist/components/dates-picker/src/data.d.ts +12 -0
- package/dist/components/dates-picker/src/data.js +6 -0
- package/dist/components/dates-picker/src/index2.cjs +11 -0
- package/dist/components/dates-picker/src/index2.js +11 -0
- package/dist/components/dates2/src/data.cjs +6 -0
- package/dist/components/dates2/src/data.d.ts +6 -0
- package/dist/components/dates2/src/data.js +6 -0
- package/dist/components/dates2/src/index2.cjs +12 -0
- package/dist/components/dates2/src/index2.js +12 -0
- package/dist/components/forms-div/src/index2.cjs +27 -19
- package/dist/components/forms-div/src/index2.js +27 -19
- package/dist/components/forms-item/src/data.cjs +2 -5
- package/dist/components/forms-item/src/data.d.ts +2 -3
- package/dist/components/forms-item/src/data.js +2 -5
- package/dist/components/forms-item/src/indexts.d.ts +2 -5
- package/dist/components/tables/common/com-but2.cjs +9 -13
- package/dist/components/tables/common/com-but2.js +7 -11
- package/dist/components/tables/common/com-color2.cjs +7 -11
- package/dist/components/tables/common/com-color2.js +8 -12
- package/dist/components/tables/common/com-lis2.cjs +7 -10
- package/dist/components/tables/common/com-lis2.js +8 -11
- package/dist/components/tables/common/util.cjs +0 -88
- package/dist/components/tables/common/util.d.ts +0 -8
- package/dist/components/tables/common/util.js +1 -89
- package/dist/hooks/event-aliass/index.cjs +121 -0
- package/dist/hooks/event-aliass/index.d.ts +1 -0
- package/dist/hooks/event-aliass/index.js +121 -0
- package/dist/icons/index.json +1 -1
- package/dist/utils/vues/common.d.ts +0 -8
- package/package.json +7 -7
- /package/dist/components/{input-tag → keep-com}/index.css +0 -0
- /package/dist/css/{input-tag.css → keep-com.css} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const index$
|
|
4
|
+
const index$3 = require("../../button/index.cjs");
|
|
5
5
|
const data = require("./data.cjs");
|
|
6
6
|
const index$1 = require("../../../hooks/props-default/index.cjs");
|
|
7
7
|
const index = require("../../../hooks/cssname/index.cjs");
|
|
8
|
+
const index$2 = require("../../../hooks/event-aliass/index.cjs");
|
|
8
9
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
10
|
__name: "index",
|
|
10
11
|
props: index$1.getProps(data.dataProps),
|
|
@@ -25,9 +26,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
28
|
function onClick(obj, index2, $event) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const is = index$2.eventAliass(
|
|
30
|
+
(callback) => {
|
|
31
|
+
callback(obj, index2, $event);
|
|
32
|
+
},
|
|
33
|
+
"click",
|
|
34
|
+
obj,
|
|
35
|
+
$event
|
|
36
|
+
);
|
|
37
|
+
if (!is) {
|
|
31
38
|
emit("clicks", obj, index2, $event);
|
|
32
39
|
}
|
|
33
40
|
}
|
|
@@ -37,11 +44,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
37
44
|
return (_ctx, _cache) => {
|
|
38
45
|
return vue.unref(props).isFather ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(valueOptions.value, (item, index2) => {
|
|
39
46
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
|
|
40
|
-
!item.hide ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
47
|
+
!item.hide ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.Button), vue.mergeProps({
|
|
41
48
|
key: 0,
|
|
42
49
|
class: [vue.unref(cs).z("li"), item.class]
|
|
43
50
|
}, { ref_for: true }, item, {
|
|
44
|
-
onClick:
|
|
51
|
+
onClick: ($event) => onClick(item, index2, $event),
|
|
45
52
|
disabled: vue.unref(props).disabled || item.disabled
|
|
46
53
|
}), {
|
|
47
54
|
default: vue.withCtx(() => [
|
|
@@ -56,11 +63,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
56
63
|
}, [
|
|
57
64
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(valueOptions.value, (item, index2) => {
|
|
58
65
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
|
|
59
|
-
!item.hide ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
66
|
+
!item.hide ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.Button), vue.mergeProps({
|
|
60
67
|
key: 0,
|
|
61
68
|
class: [vue.unref(cs).z("li"), item.class]
|
|
62
69
|
}, { ref_for: true }, item, {
|
|
63
|
-
onClick:
|
|
70
|
+
onClick: ($event) => onClick(item, index2, $event),
|
|
64
71
|
disabled: vue.unref(props).disabled || item.disabled
|
|
65
72
|
}), {
|
|
66
73
|
default: vue.withCtx(() => [
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, unref, openBlock, Fragment, renderList, createBlock, createCommentVNode, mergeProps,
|
|
1
|
+
import { defineComponent, computed, createElementBlock, unref, openBlock, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withCtx, createTextVNode, toDisplayString, normalizeClass } from "vue";
|
|
2
2
|
import { Button } from "../../button/index.js";
|
|
3
3
|
import { name, dataProps, dataHandle, dataExpose, dataEmits } from "./data.js";
|
|
4
4
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
5
5
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
6
|
+
import { eventAliass } from "../../../hooks/event-aliass/index.js";
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
8
|
__name: "index",
|
|
8
9
|
props: getProps(dataProps),
|
|
@@ -23,9 +24,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
function onClick(obj, index, $event) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const is = eventAliass(
|
|
28
|
+
(callback) => {
|
|
29
|
+
callback(obj, index, $event);
|
|
30
|
+
},
|
|
31
|
+
"click",
|
|
32
|
+
obj,
|
|
33
|
+
$event
|
|
34
|
+
);
|
|
35
|
+
if (!is) {
|
|
29
36
|
emit("clicks", obj, index, $event);
|
|
30
37
|
}
|
|
31
38
|
}
|
|
@@ -39,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
46
|
key: 0,
|
|
40
47
|
class: [unref(cs).z("li"), item.class]
|
|
41
48
|
}, { ref_for: true }, item, {
|
|
42
|
-
onClick:
|
|
49
|
+
onClick: ($event) => onClick(item, index, $event),
|
|
43
50
|
disabled: unref(props).disabled || item.disabled
|
|
44
51
|
}), {
|
|
45
52
|
default: withCtx(() => [
|
|
@@ -58,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
65
|
key: 0,
|
|
59
66
|
class: [unref(cs).z("li"), item.class]
|
|
60
67
|
}, { ref_for: true }, item, {
|
|
61
|
-
onClick:
|
|
68
|
+
onClick: ($event) => onClick(item, index, $event),
|
|
62
69
|
disabled: unref(props).disabled || item.disabled
|
|
63
70
|
}), {
|
|
64
71
|
default: withCtx(() => [
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const shared = require("@vue/shared");
|
|
5
|
+
const index = require("../../hooks/event-aliass/index.cjs");
|
|
5
6
|
const util = require("../../utils/util.cjs");
|
|
6
7
|
const isObject = require("@fangzhongya/utils/basic/object/isObject");
|
|
7
8
|
const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
|
|
8
9
|
const objValue = require("@fangzhongya/utils/basic/object/objValue");
|
|
9
|
-
const firstLower = require("@fangzhongya/utils/basic/string/firstLower");
|
|
10
10
|
function useVueValue(v, key) {
|
|
11
11
|
if (key && isObject.isObject(v)) {
|
|
12
12
|
if (typeof key == "function") {
|
|
@@ -147,7 +147,7 @@ function setValue(value, obj, data) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
function getValue(obj, data,
|
|
150
|
+
function getValue(obj, data, index2) {
|
|
151
151
|
const prop = obj.prop;
|
|
152
152
|
const cdata = util.getChildrenData(obj, data);
|
|
153
153
|
let cellValue;
|
|
@@ -161,13 +161,13 @@ function getValue(obj, data, index) {
|
|
|
161
161
|
cellValue = obj.value;
|
|
162
162
|
}
|
|
163
163
|
if (obj.formatter) {
|
|
164
|
-
return obj.formatter(data, obj, cellValue,
|
|
164
|
+
return obj.formatter(data, obj, cellValue, index2, cdata);
|
|
165
165
|
} else {
|
|
166
166
|
return cellValue ?? obj.default;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function getListObjValue(value, obj, data,
|
|
170
|
-
const v = getValue(obj, data,
|
|
169
|
+
function getListObjValue(value, obj, data, index2) {
|
|
170
|
+
const v = getValue(obj, data, index2);
|
|
171
171
|
setValue(v, obj, value);
|
|
172
172
|
}
|
|
173
173
|
function getValueObjs(value, multiple, options, config) {
|
|
@@ -262,15 +262,22 @@ function renderComponent(obj, tcom, compon, componObj, value, compons) {
|
|
|
262
262
|
function getOnObjs(obj, data, emit, ...arrs) {
|
|
263
263
|
const objs = {};
|
|
264
264
|
const es = obj.events || {};
|
|
265
|
+
const aliass = ["click"];
|
|
265
266
|
for (const key of Object.keys(es)) {
|
|
266
|
-
|
|
267
|
-
if (!/on[A-Z]/.test(key)) {
|
|
268
|
-
ml = "on" + lineToLargeHump.lineToLargeHump(key);
|
|
269
|
-
}
|
|
270
|
-
ml = firstLower.firstLower(lineToLargeHump.lineToLargeHump(ml));
|
|
267
|
+
const ml = index.getEventKey(key, aliass);
|
|
271
268
|
objs[ml] = (...v) => {
|
|
272
269
|
if (es[key] && typeof es[key] == "function") {
|
|
273
|
-
|
|
270
|
+
const is = index.eventAliass(
|
|
271
|
+
(callback) => {
|
|
272
|
+
callback(...v, data, obj, ...arrs);
|
|
273
|
+
},
|
|
274
|
+
aliass,
|
|
275
|
+
es,
|
|
276
|
+
v[0]
|
|
277
|
+
);
|
|
278
|
+
if (!is) {
|
|
279
|
+
es[key](...v, data, obj, ...arrs);
|
|
280
|
+
}
|
|
274
281
|
} else {
|
|
275
282
|
emit("list-events", es[key] || key, ...v, data, obj, ...arrs);
|
|
276
283
|
}
|
|
@@ -278,14 +285,14 @@ function getOnObjs(obj, data, emit, ...arrs) {
|
|
|
278
285
|
}
|
|
279
286
|
return objs;
|
|
280
287
|
}
|
|
281
|
-
function useSetSlot(obj, data, slots, options, emit,
|
|
288
|
+
function useSetSlot(obj, data, slots, options, emit, index2, scope) {
|
|
282
289
|
const slotname = obj.slot ?? obj.prop;
|
|
283
290
|
if (slotname) {
|
|
284
291
|
const slot = slots[slotname];
|
|
285
292
|
if (slot) {
|
|
286
293
|
let value = (scope == null ? void 0 : scope.value) ?? vue.computed({
|
|
287
294
|
get() {
|
|
288
|
-
return getValue(obj, data,
|
|
295
|
+
return getValue(obj, data, index2);
|
|
289
296
|
},
|
|
290
297
|
set(v) {
|
|
291
298
|
setValue(v, obj, data);
|
|
@@ -303,7 +310,7 @@ function useSetSlot(obj, data, slots, options, emit, index, scope) {
|
|
|
303
310
|
column: obj,
|
|
304
311
|
row: data,
|
|
305
312
|
value,
|
|
306
|
-
index,
|
|
313
|
+
index: index2,
|
|
307
314
|
...componObj
|
|
308
315
|
});
|
|
309
316
|
}
|
|
@@ -330,9 +337,9 @@ function getComponObj(value, obj, data, options, emit, scope) {
|
|
|
330
337
|
}
|
|
331
338
|
return componObj;
|
|
332
339
|
}
|
|
333
|
-
function useSetCompon(obj, data, options, compons, emit,
|
|
340
|
+
function useSetCompon(obj, data, options, compons, emit, index2, scope) {
|
|
334
341
|
if (obj.compon) {
|
|
335
|
-
const value = getValue(obj, data,
|
|
342
|
+
const value = getValue(obj, data, index2);
|
|
336
343
|
const componObj = getComponObj(value, obj, data, options, emit, scope);
|
|
337
344
|
return useGetCompon(obj.compon, componObj, obj, compons, value);
|
|
338
345
|
}
|
|
@@ -348,14 +355,14 @@ function useGetCompon(compon, componObj, obj, compons, value) {
|
|
|
348
355
|
return vue.h(compon, componObj, setSlots(obj));
|
|
349
356
|
}
|
|
350
357
|
}
|
|
351
|
-
const useGetDomValue = (obj, data, options,
|
|
352
|
-
let value = getValue(obj, data,
|
|
358
|
+
const useGetDomValue = (obj, data, options, index2) => {
|
|
359
|
+
let value = getValue(obj, data, index2);
|
|
353
360
|
if (obj.options) {
|
|
354
361
|
value = setOptionsValue(value, obj, data, options) ?? value;
|
|
355
362
|
}
|
|
356
363
|
return value;
|
|
357
364
|
};
|
|
358
|
-
const useGetDomLabel = (obj, data, slots, options, compons, emit,
|
|
365
|
+
const useGetDomLabel = (obj, data, slots, options, compons, emit, index2) => {
|
|
359
366
|
const label = obj.label;
|
|
360
367
|
if (!label) {
|
|
361
368
|
return label;
|
|
@@ -370,27 +377,27 @@ const useGetDomLabel = (obj, data, slots, options, compons, emit, index) => {
|
|
|
370
377
|
return label;
|
|
371
378
|
}
|
|
372
379
|
if (Array.isArray(label)) {
|
|
373
|
-
return renderLabelArray(label, data, options, compons, emit,
|
|
380
|
+
return renderLabelArray(label, data, options, compons, emit, index2);
|
|
374
381
|
}
|
|
375
382
|
return useVNodeComponDom(label, data, slots, emit, {
|
|
376
383
|
options,
|
|
377
384
|
compons,
|
|
378
|
-
index
|
|
385
|
+
index: index2
|
|
379
386
|
});
|
|
380
387
|
};
|
|
381
|
-
const renderLabelArray = (labels, data, options, compons, emit,
|
|
388
|
+
const renderLabelArray = (labels, data, options, compons, emit, index2) => {
|
|
382
389
|
return vue.h(
|
|
383
390
|
"div",
|
|
384
391
|
{ class: "com-lable-array" },
|
|
385
392
|
labels.map((v) => {
|
|
386
393
|
const labelObj = typeof v === "string" ? { value: v, compon: "div" } : v;
|
|
387
|
-
return useSetCompon(labelObj, data, options, compons, emit,
|
|
394
|
+
return useSetCompon(labelObj, data, options, compons, emit, index2);
|
|
388
395
|
})
|
|
389
396
|
);
|
|
390
397
|
};
|
|
391
398
|
function useVNodeComponDom(obj, data, slots, emit, config) {
|
|
392
|
-
const { options, compons, index, scope } = config;
|
|
393
|
-
const slot = useSetSlot(obj, data, slots, options, emit,
|
|
399
|
+
const { options, compons, index: index2, scope } = config;
|
|
400
|
+
const slot = useSetSlot(obj, data, slots, options, emit, index2, scope);
|
|
394
401
|
if (slot) {
|
|
395
402
|
return slot;
|
|
396
403
|
}
|
|
@@ -401,14 +408,14 @@ function useVNodeComponDom(obj, data, slots, emit, config) {
|
|
|
401
408
|
options,
|
|
402
409
|
compons,
|
|
403
410
|
emit,
|
|
404
|
-
|
|
411
|
+
index2,
|
|
405
412
|
scope
|
|
406
413
|
);
|
|
407
414
|
if (column) {
|
|
408
415
|
return column;
|
|
409
416
|
}
|
|
410
417
|
}
|
|
411
|
-
return useGetDomValue(obj, data, options,
|
|
418
|
+
return useGetDomValue(obj, data, options, index2);
|
|
412
419
|
}
|
|
413
420
|
function useObjComponSelected(obj, props) {
|
|
414
421
|
const arrs = [obj];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isVNode, h, resolveComponent, computed, Fragment, render } from "vue";
|
|
2
2
|
import { isHTMLTag, isSVGTag } from "@vue/shared";
|
|
3
|
+
import { getEventKey, eventAliass } from "../../hooks/event-aliass/index.js";
|
|
3
4
|
import { getFathers, getChildrenData } from "../../utils/util.js";
|
|
4
5
|
import { isObject } from "@fangzhongya/utils/basic/object/isObject";
|
|
5
6
|
import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
|
|
6
7
|
import { setObjValue, getObjValue } from "@fangzhongya/utils/basic/object/objValue";
|
|
7
|
-
import { firstLower } from "@fangzhongya/utils/basic/string/firstLower";
|
|
8
8
|
function useVueValue(v, key) {
|
|
9
9
|
if (key && isObject(v)) {
|
|
10
10
|
if (typeof key == "function") {
|
|
@@ -260,15 +260,22 @@ function renderComponent(obj, tcom, compon, componObj, value, compons) {
|
|
|
260
260
|
function getOnObjs(obj, data, emit, ...arrs) {
|
|
261
261
|
const objs = {};
|
|
262
262
|
const es = obj.events || {};
|
|
263
|
+
const aliass = ["click"];
|
|
263
264
|
for (const key of Object.keys(es)) {
|
|
264
|
-
|
|
265
|
-
if (!/on[A-Z]/.test(key)) {
|
|
266
|
-
ml = "on" + lineToLargeHump(key);
|
|
267
|
-
}
|
|
268
|
-
ml = firstLower(lineToLargeHump(ml));
|
|
265
|
+
const ml = getEventKey(key, aliass);
|
|
269
266
|
objs[ml] = (...v) => {
|
|
270
267
|
if (es[key] && typeof es[key] == "function") {
|
|
271
|
-
|
|
268
|
+
const is = eventAliass(
|
|
269
|
+
(callback) => {
|
|
270
|
+
callback(...v, data, obj, ...arrs);
|
|
271
|
+
},
|
|
272
|
+
aliass,
|
|
273
|
+
es,
|
|
274
|
+
v[0]
|
|
275
|
+
);
|
|
276
|
+
if (!is) {
|
|
277
|
+
es[key](...v, data, obj, ...arrs);
|
|
278
|
+
}
|
|
272
279
|
} else {
|
|
273
280
|
emit("list-events", es[key] || key, ...v, data, obj, ...arrs);
|
|
274
281
|
}
|
|
@@ -11,6 +11,12 @@ export declare const dataProps: {
|
|
|
11
11
|
modelValue: {
|
|
12
12
|
type: (DateConstructor | StringConstructor | NumberConstructor | ArrayConstructor)[];
|
|
13
13
|
};
|
|
14
|
+
disabledDate: {
|
|
15
|
+
type: FunctionConstructor;
|
|
16
|
+
};
|
|
17
|
+
disabledNot: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
};
|
|
14
20
|
options: {
|
|
15
21
|
type: {
|
|
16
22
|
(arrayLength: number): ObjAny[];
|
|
@@ -6,6 +6,7 @@ const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
|
6
6
|
const index = require("../../../hooks/inherit/index.cjs");
|
|
7
7
|
const index$2 = require("../../../hooks/props-default/index.cjs");
|
|
8
8
|
const index$3 = require("../../date-picker/index.cjs");
|
|
9
|
+
const getEndOfDay = require("@fangzhongya/utils/date/getEndOfDay");
|
|
9
10
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
10
11
|
...{ inheritAttrs: false },
|
|
11
12
|
__name: "index",
|
|
@@ -19,6 +20,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
19
20
|
const props = index$2.usePropsDefault(data.name, prs, data.dataProps);
|
|
20
21
|
const emit = __emit;
|
|
21
22
|
const { value } = data.dataHandle(props, emit);
|
|
23
|
+
const disabledDate = function(data2) {
|
|
24
|
+
if (props.disabledDate) {
|
|
25
|
+
return props.disabledDate(data2);
|
|
26
|
+
} else if (props.disabledNot) {
|
|
27
|
+
const d = getEndOfDay.getEndOfDay();
|
|
28
|
+
return data2 > d;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
22
32
|
__expose({
|
|
23
33
|
el: refEl,
|
|
24
34
|
...data.dataExpose
|
|
@@ -33,7 +43,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
33
43
|
class: [vue.unref(cs).z("date")]
|
|
34
44
|
}, vue.unref(attrs).assem, {
|
|
35
45
|
modelValue: vue.unref(value),
|
|
36
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(value) ? value.value = $event : null)
|
|
46
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(value) ? value.value = $event : null),
|
|
47
|
+
"disabled-date": disabledDate
|
|
37
48
|
}), null, 16, ["class", "modelValue"])
|
|
38
49
|
], 16);
|
|
39
50
|
};
|
|
@@ -4,6 +4,7 @@ import { useCssName } from "../../../hooks/cssname/index.js";
|
|
|
4
4
|
import { useInherit } from "../../../hooks/inherit/index.js";
|
|
5
5
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
6
6
|
import { DatePicker } from "../../date-picker/index.js";
|
|
7
|
+
import { getEndOfDay } from "@fangzhongya/utils/date/getEndOfDay";
|
|
7
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
9
|
...{ inheritAttrs: false },
|
|
9
10
|
__name: "index",
|
|
@@ -17,6 +18,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
18
|
const props = usePropsDefault(name, prs, dataProps);
|
|
18
19
|
const emit = __emit;
|
|
19
20
|
const { value } = dataHandle(props, emit);
|
|
21
|
+
const disabledDate = function(data) {
|
|
22
|
+
if (props.disabledDate) {
|
|
23
|
+
return props.disabledDate(data);
|
|
24
|
+
} else if (props.disabledNot) {
|
|
25
|
+
const d = getEndOfDay();
|
|
26
|
+
return data > d;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
};
|
|
20
30
|
__expose({
|
|
21
31
|
el: refEl,
|
|
22
32
|
...dataExpose
|
|
@@ -31,7 +41,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
41
|
class: [unref(cs).z("date")]
|
|
32
42
|
}, unref(attrs).assem, {
|
|
33
43
|
modelValue: unref(value),
|
|
34
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(value) ? value.value = $event : null)
|
|
44
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(value) ? value.value = $event : null),
|
|
45
|
+
"disabled-date": disabledDate
|
|
35
46
|
}), null, 16, ["class", "modelValue"])
|
|
36
47
|
], 16);
|
|
37
48
|
};
|
|
@@ -21,7 +21,13 @@ const dataProps = {
|
|
|
21
21
|
},
|
|
22
22
|
rangeSeparator: { type: String },
|
|
23
23
|
startPlaceholder: { type: String },
|
|
24
|
-
endPlaceholder: { type: String }
|
|
24
|
+
endPlaceholder: { type: String },
|
|
25
|
+
disabledDate: {
|
|
26
|
+
type: Function
|
|
27
|
+
},
|
|
28
|
+
disabledNot: {
|
|
29
|
+
type: Boolean
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
const dataEmits = ["update:modelValue"];
|
|
27
33
|
const dataSlot = {
|
|
@@ -19,7 +19,13 @@ const dataProps = {
|
|
|
19
19
|
},
|
|
20
20
|
rangeSeparator: { type: String },
|
|
21
21
|
startPlaceholder: { type: String },
|
|
22
|
-
endPlaceholder: { type: String }
|
|
22
|
+
endPlaceholder: { type: String },
|
|
23
|
+
disabledDate: {
|
|
24
|
+
type: Function
|
|
25
|
+
},
|
|
26
|
+
disabledNot: {
|
|
27
|
+
type: Boolean
|
|
28
|
+
}
|
|
23
29
|
};
|
|
24
30
|
const dataEmits = ["update:modelValue"];
|
|
25
31
|
const dataSlot = {
|
|
@@ -6,6 +6,7 @@ const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
|
6
6
|
const util = require("../../dates2/src/util.cjs");
|
|
7
7
|
const index$3 = require("../../date-picker/index.cjs");
|
|
8
8
|
const index$2 = require("../../../hooks/props-default/index.cjs");
|
|
9
|
+
const getEndOfDay = require("@fangzhongya/utils/date/getEndOfDay");
|
|
9
10
|
const index = require("../../../hooks/locale/index.cjs");
|
|
10
11
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
11
12
|
__name: "index",
|
|
@@ -63,16 +64,24 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
64
|
function disabledDateStart(time) {
|
|
64
65
|
if (end.value) {
|
|
65
66
|
return time.getTime() > e.value;
|
|
66
|
-
} else {
|
|
67
|
-
return
|
|
67
|
+
} else if (props.disabledDate) {
|
|
68
|
+
return props.disabledDate(time);
|
|
69
|
+
} else if (props.disabledNot) {
|
|
70
|
+
const d = getEndOfDay.getEndOfDay();
|
|
71
|
+
return time > d;
|
|
68
72
|
}
|
|
73
|
+
return false;
|
|
69
74
|
}
|
|
70
75
|
function disabledDateEnd(time) {
|
|
71
76
|
if (start.value) {
|
|
72
77
|
return time.getTime() < s.value;
|
|
73
|
-
} else {
|
|
74
|
-
return
|
|
78
|
+
} else if (props.disabledDate) {
|
|
79
|
+
return props.disabledDate(time);
|
|
80
|
+
} else if (props.disabledNot) {
|
|
81
|
+
const d = getEndOfDay.getEndOfDay();
|
|
82
|
+
return time > d;
|
|
75
83
|
}
|
|
84
|
+
return false;
|
|
76
85
|
}
|
|
77
86
|
__expose({
|
|
78
87
|
...data.dataExpose
|
|
@@ -4,6 +4,7 @@ import { useCssName } from "../../../hooks/cssname/index.js";
|
|
|
4
4
|
import { getDate } from "../../dates2/src/util.js";
|
|
5
5
|
import { DatePicker } from "../../date-picker/index.js";
|
|
6
6
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
7
|
+
import { getEndOfDay } from "@fangzhongya/utils/date/getEndOfDay";
|
|
7
8
|
import { useLocale } from "../../../hooks/locale/index.js";
|
|
8
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
10
|
__name: "index",
|
|
@@ -61,16 +62,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
62
|
function disabledDateStart(time) {
|
|
62
63
|
if (end.value) {
|
|
63
64
|
return time.getTime() > e.value;
|
|
64
|
-
} else {
|
|
65
|
-
return
|
|
65
|
+
} else if (props.disabledDate) {
|
|
66
|
+
return props.disabledDate(time);
|
|
67
|
+
} else if (props.disabledNot) {
|
|
68
|
+
const d = getEndOfDay();
|
|
69
|
+
return time > d;
|
|
66
70
|
}
|
|
71
|
+
return false;
|
|
67
72
|
}
|
|
68
73
|
function disabledDateEnd(time) {
|
|
69
74
|
if (start.value) {
|
|
70
75
|
return time.getTime() < s.value;
|
|
71
|
-
} else {
|
|
72
|
-
return
|
|
76
|
+
} else if (props.disabledDate) {
|
|
77
|
+
return props.disabledDate(time);
|
|
78
|
+
} else if (props.disabledNot) {
|
|
79
|
+
const d = getEndOfDay();
|
|
80
|
+
return time > d;
|
|
73
81
|
}
|
|
82
|
+
return false;
|
|
74
83
|
}
|
|
75
84
|
__expose({
|
|
76
85
|
...dataExpose
|
|
@@ -24,6 +24,12 @@ export declare const props: {
|
|
|
24
24
|
modelValue: {
|
|
25
25
|
type: (DateConstructor | StringConstructor | NumberConstructor)[];
|
|
26
26
|
};
|
|
27
|
+
disabledDate: {
|
|
28
|
+
type: FunctionConstructor;
|
|
29
|
+
};
|
|
30
|
+
disabledNot: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
};
|
|
27
33
|
};
|
|
28
34
|
/**
|
|
29
35
|
* @title {h3} dates-picker
|
|
@@ -53,6 +59,12 @@ export declare const dataProps: {
|
|
|
53
59
|
modelValue: {
|
|
54
60
|
type: (DateConstructor | StringConstructor | NumberConstructor)[];
|
|
55
61
|
};
|
|
62
|
+
disabledDate: {
|
|
63
|
+
type: FunctionConstructor;
|
|
64
|
+
};
|
|
65
|
+
disabledNot: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
};
|
|
56
68
|
};
|
|
57
69
|
export type DataProps = ExtractPropTypes<typeof dataProps>;
|
|
58
70
|
/**
|
|
@@ -7,6 +7,7 @@ const index = require("../../../hooks/inherit/index.cjs");
|
|
|
7
7
|
const util = require("./util.cjs");
|
|
8
8
|
const index$3 = require("../../date-picker/index.cjs");
|
|
9
9
|
const index$2 = require("../../../hooks/props-default/index.cjs");
|
|
10
|
+
const getEndOfDay = require("@fangzhongya/utils/date/getEndOfDay");
|
|
10
11
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
11
12
|
...{ inheritAttrs: false },
|
|
12
13
|
__name: "index",
|
|
@@ -38,6 +39,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
39
|
return util.format(value2, types.value.repair, props.repair);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
42
|
+
const disabledDate = function(data2) {
|
|
43
|
+
if (props.disabledDate) {
|
|
44
|
+
return props.disabledDate(data2);
|
|
45
|
+
} else if (props.disabledNot) {
|
|
46
|
+
const d = getEndOfDay.getEndOfDay();
|
|
47
|
+
return data2 > d;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
};
|
|
41
51
|
__expose({
|
|
42
52
|
...data.dataExpose,
|
|
43
53
|
getValue
|
|
@@ -50,6 +60,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
50
60
|
vue.createVNode(vue.unref(index$3.DatePicker), vue.mergeProps(vue.unref(attrs).assem, {
|
|
51
61
|
type: types.value.type,
|
|
52
62
|
format: vue.unref(props).format || types.value.format,
|
|
63
|
+
"disabled-date": disabledDate,
|
|
53
64
|
modelValue: value.value,
|
|
54
65
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
55
66
|
}), vue.createSlots({ _: 2 }, [
|
|
@@ -5,6 +5,7 @@ import { useInherit } from "../../../hooks/inherit/index.js";
|
|
|
5
5
|
import { getType, format } from "./util.js";
|
|
6
6
|
import { DatePicker } from "../../date-picker/index.js";
|
|
7
7
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
8
|
+
import { getEndOfDay } from "@fangzhongya/utils/date/getEndOfDay";
|
|
8
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
10
|
...{ inheritAttrs: false },
|
|
10
11
|
__name: "index",
|
|
@@ -36,6 +37,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
37
|
return format(value2, types.value.repair, props.repair);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
const disabledDate = function(data) {
|
|
41
|
+
if (props.disabledDate) {
|
|
42
|
+
return props.disabledDate(data);
|
|
43
|
+
} else if (props.disabledNot) {
|
|
44
|
+
const d = getEndOfDay();
|
|
45
|
+
return data > d;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
39
49
|
__expose({
|
|
40
50
|
...dataExpose,
|
|
41
51
|
getValue
|
|
@@ -48,6 +58,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
58
|
createVNode(unref(DatePicker), mergeProps(unref(attrs).assem, {
|
|
49
59
|
type: types.value.type,
|
|
50
60
|
format: unref(props).format || types.value.format,
|
|
61
|
+
"disabled-date": disabledDate,
|
|
51
62
|
modelValue: value.value,
|
|
52
63
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
53
64
|
}), createSlots({ _: 2 }, [
|