cnhis-design-vue 3.1.15-beta.4 → 3.1.15-beta.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/es/packages/bpmn-workflow/src/BpmnWorkflow.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +8 -8
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +4 -3
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/index.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +3 -3
- package/es/packages/field-set/index.d.ts +4365 -0
- package/es/packages/field-set/src/FieldSet.js +53 -54
- package/es/packages/field-set/src/FieldSet.vue.d.ts +4365 -0
- package/es/packages/field-set/style/index.css +0 -9
- package/es/packages/form-render/index.d.ts +24 -3
- package/es/packages/form-render/src/FormRender.js +10 -6
- package/es/packages/form-render/src/FormRender.vue.d.ts +24 -3
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.d.ts +5 -0
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.js +32 -0
- package/es/packages/form-render/src/components/renderer/{combination.d.ts → combination/index.d.ts} +7 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +157 -0
- package/es/packages/form-render/src/components/renderer/index.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.js +4 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +9 -0
- package/es/packages/form-render/src/components/renderer/select.js +6 -2
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +7 -6
- package/es/packages/form-render/src/hooks/useAnchor.js +1 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +6 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +12 -3
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -4
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +15 -3
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +13 -0
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.js +10 -0
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +25 -1
- package/es/packages/form-render/src/utils/index.d.ts +3 -3
- package/es/packages/form-render/src/utils/index.js +1 -4
- package/es/packages/index.css +1 -10
- package/es/packages/info-header/index.d.ts +1 -3
- package/es/packages/info-header/src/HiddenContent.js +1 -1
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +1 -3
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1 -3
- package/es/packages/info-header/style/index.css +1 -1
- package/es/packages/shortcut-setter/index.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +2 -2
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +1 -1
- package/global.d.ts +8 -8
- package/package.json +9 -1
- package/es/_virtual/_commonjsHelpers.js +0 -7
- package/es/_virtual/css.escape.js +0 -3
- package/es/_virtual/inherits.js +0 -3
- package/es/_virtual/inherits_browser.js +0 -3
- package/es/node_modules/@formily/path/esm/contexts.js +0 -22
- package/es/node_modules/@formily/path/esm/destructor.js +0 -124
- package/es/node_modules/@formily/path/esm/index.js +0 -579
- package/es/node_modules/@formily/path/esm/matcher.js +0 -199
- package/es/node_modules/@formily/path/esm/parser.js +0 -402
- package/es/node_modules/@formily/path/esm/shared.js +0 -73
- package/es/node_modules/@formily/path/esm/tokenizer.js +0 -287
- package/es/node_modules/@formily/path/esm/tokens.js +0 -240
- package/es/node_modules/@formily/path/esm/types.js +0 -17
- package/es/node_modules/css.escape/css.escape.js +0 -110
- package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -6
- package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -18
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +0 -38
- package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -7
- package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +0 -23
- package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +0 -25
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +0 -21
- package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +0 -15
- package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -52
- package/es/node_modules/date-fns/esm/constants/index.js +0 -40
- package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -49
- package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +0 -35
- package/es/node_modules/date-fns/esm/differenceInCalendarYears/index.js +0 -33
- package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -86
- package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -59
- package/es/node_modules/date-fns/esm/differenceInYears/index.js +0 -43
- package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -32
- package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +0 -32
- package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +0 -37
- package/es/node_modules/date-fns/esm/parse/_lib/constants.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +0 -53
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +0 -29
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +0 -42
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +0 -50
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +0 -99
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +0 -33
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +0 -61
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +0 -66
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +0 -109
- package/es/node_modules/date-fns/esm/parse/_lib/utils.js +0 -133
- package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/toDate/index.js +0 -55
- package/es/node_modules/diagram-js/lib/command/CommandInterceptor.js +0 -139
- package/es/node_modules/diagram-js/lib/draw/BaseRenderer.js +0 -88
- package/es/node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js +0 -591
- package/es/node_modules/diagram-js/lib/features/rules/RuleProvider.js +0 -88
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js +0 -120
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/index.js +0 -8
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js +0 -227
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomUtil.js +0 -24
- package/es/node_modules/diagram-js/lib/util/ClickTrap.js +0 -23
- package/es/node_modules/diagram-js/lib/util/Cursor.js +0 -20
- package/es/node_modules/diagram-js/lib/util/Event.js +0 -22
- package/es/node_modules/diagram-js/lib/util/Math.js +0 -9
- package/es/node_modules/diagram-js/lib/util/Mouse.js +0 -30
- package/es/node_modules/diagram-js/lib/util/Platform.js +0 -5
- package/es/node_modules/diagram-js/lib/util/PositionUtil.js +0 -8
- package/es/node_modules/diagram-js/lib/util/RenderUtil.js +0 -25
- package/es/node_modules/diagram-js/lib/util/SvgTransformUtil.js +0 -48
- package/es/node_modules/ids/dist/index.esm.js +0 -164
- package/es/node_modules/inherits/inherits.js +0 -19
- package/es/node_modules/inherits/inherits_browser.js +0 -38
- package/es/node_modules/inherits-browser/dist/index.es.js +0 -3
- package/es/node_modules/min-dash/dist/index.esm.js +0 -169
- package/es/node_modules/min-dom/dist/index.esm.js +0 -588
- package/es/node_modules/tiny-svg/dist/index.esm.js +0 -525
- package/es/packages/form-render/src/components/renderer/combination.js +0 -171
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { EraParser } from './EraParser.js';
|
|
2
|
-
import { YearParser } from './YearParser.js';
|
|
3
|
-
import { LocalWeekYearParser } from './LocalWeekYearParser.js';
|
|
4
|
-
import { ISOWeekYearParser } from './ISOWeekYearParser.js';
|
|
5
|
-
import { ExtendedYearParser } from './ExtendedYearParser.js';
|
|
6
|
-
import { QuarterParser } from './QuarterParser.js';
|
|
7
|
-
import { StandAloneQuarterParser } from './StandAloneQuarterParser.js';
|
|
8
|
-
import { MonthParser } from './MonthParser.js';
|
|
9
|
-
import { StandAloneMonthParser } from './StandAloneMonthParser.js';
|
|
10
|
-
import { LocalWeekParser } from './LocalWeekParser.js';
|
|
11
|
-
import { ISOWeekParser } from './ISOWeekParser.js';
|
|
12
|
-
import { DateParser } from './DateParser.js';
|
|
13
|
-
import { DayOfYearParser } from './DayOfYearParser.js';
|
|
14
|
-
import { DayParser } from './DayParser.js';
|
|
15
|
-
import { LocalDayParser } from './LocalDayParser.js';
|
|
16
|
-
import { StandAloneLocalDayParser } from './StandAloneLocalDayParser.js';
|
|
17
|
-
import { ISODayParser } from './ISODayParser.js';
|
|
18
|
-
import { AMPMParser } from './AMPMParser.js';
|
|
19
|
-
import { AMPMMidnightParser } from './AMPMMidnightParser.js';
|
|
20
|
-
import { DayPeriodParser } from './DayPeriodParser.js';
|
|
21
|
-
import { Hour1to12Parser } from './Hour1to12Parser.js';
|
|
22
|
-
import { Hour0to23Parser } from './Hour0to23Parser.js';
|
|
23
|
-
import { Hour0To11Parser } from './Hour0To11Parser.js';
|
|
24
|
-
import { Hour1To24Parser } from './Hour1To24Parser.js';
|
|
25
|
-
import { MinuteParser } from './MinuteParser.js';
|
|
26
|
-
import { SecondParser } from './SecondParser.js';
|
|
27
|
-
import { FractionOfSecondParser } from './FractionOfSecondParser.js';
|
|
28
|
-
import { ISOTimezoneWithZParser } from './ISOTimezoneWithZParser.js';
|
|
29
|
-
import { ISOTimezoneParser } from './ISOTimezoneParser.js';
|
|
30
|
-
import { TimestampSecondsParser } from './TimestampSecondsParser.js';
|
|
31
|
-
import { TimestampMillisecondsParser } from './TimestampMillisecondsParser.js';
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
* | | Unit | | Unit |
|
|
35
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
36
|
-
* | a | AM, PM | A* | Milliseconds in day |
|
|
37
|
-
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
38
|
-
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
39
|
-
* | d | Day of month | D | Day of year |
|
|
40
|
-
* | e | Local day of week | E | Day of week |
|
|
41
|
-
* | f | | F* | Day of week in month |
|
|
42
|
-
* | g* | Modified Julian day | G | Era |
|
|
43
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
44
|
-
* | i! | ISO day of week | I! | ISO week of year |
|
|
45
|
-
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
46
|
-
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
47
|
-
* | l* | (deprecated) | L | Stand-alone month |
|
|
48
|
-
* | m | Minute | M | Month |
|
|
49
|
-
* | n | | N | |
|
|
50
|
-
* | o! | Ordinal number modifier | O* | Timezone (GMT) |
|
|
51
|
-
* | p | | P | |
|
|
52
|
-
* | q | Stand-alone quarter | Q | Quarter |
|
|
53
|
-
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
54
|
-
* | s | Second | S | Fraction of second |
|
|
55
|
-
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
56
|
-
* | u | Extended year | U* | Cyclic year |
|
|
57
|
-
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
58
|
-
* | w | Local week of year | W* | Week of month |
|
|
59
|
-
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
60
|
-
* | y | Year (abs) | Y | Local week-numbering year |
|
|
61
|
-
* | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
62
|
-
*
|
|
63
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
64
|
-
*
|
|
65
|
-
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
66
|
-
* - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
|
|
67
|
-
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
68
|
-
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
69
|
-
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
70
|
-
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
71
|
-
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
72
|
-
* for universal ISO week-numbering date, whereas
|
|
73
|
-
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
74
|
-
* for week-numbering date specific to the locale.
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
({
|
|
78
|
-
G: new EraParser(),
|
|
79
|
-
y: new YearParser(),
|
|
80
|
-
Y: new LocalWeekYearParser(),
|
|
81
|
-
R: new ISOWeekYearParser(),
|
|
82
|
-
u: new ExtendedYearParser(),
|
|
83
|
-
Q: new QuarterParser(),
|
|
84
|
-
q: new StandAloneQuarterParser(),
|
|
85
|
-
M: new MonthParser(),
|
|
86
|
-
L: new StandAloneMonthParser(),
|
|
87
|
-
w: new LocalWeekParser(),
|
|
88
|
-
I: new ISOWeekParser(),
|
|
89
|
-
d: new DateParser(),
|
|
90
|
-
D: new DayOfYearParser(),
|
|
91
|
-
E: new DayParser(),
|
|
92
|
-
e: new LocalDayParser(),
|
|
93
|
-
c: new StandAloneLocalDayParser(),
|
|
94
|
-
i: new ISODayParser(),
|
|
95
|
-
a: new AMPMParser(),
|
|
96
|
-
b: new AMPMMidnightParser(),
|
|
97
|
-
B: new DayPeriodParser(),
|
|
98
|
-
h: new Hour1to12Parser(),
|
|
99
|
-
H: new Hour0to23Parser(),
|
|
100
|
-
K: new Hour0To11Parser(),
|
|
101
|
-
k: new Hour1To24Parser(),
|
|
102
|
-
m: new MinuteParser(),
|
|
103
|
-
s: new SecondParser(),
|
|
104
|
-
S: new FractionOfSecondParser(),
|
|
105
|
-
X: new ISOTimezoneWithZParser(),
|
|
106
|
-
x: new ISOTimezoneParser(),
|
|
107
|
-
t: new TimestampSecondsParser(),
|
|
108
|
-
T: new TimestampMillisecondsParser()
|
|
109
|
-
});
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { millisecondsInHour, millisecondsInMinute, millisecondsInSecond } from '../../constants/index.js';
|
|
2
|
-
import { numericPatterns } from './constants.js';
|
|
3
|
-
|
|
4
|
-
function mapValue(parseFnResult, mapFn) {
|
|
5
|
-
if (!parseFnResult) {
|
|
6
|
-
return parseFnResult;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
value: mapFn(parseFnResult.value),
|
|
11
|
-
rest: parseFnResult.rest
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function parseNumericPattern(pattern, dateString) {
|
|
15
|
-
var matchResult = dateString.match(pattern);
|
|
16
|
-
|
|
17
|
-
if (!matchResult) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
value: parseInt(matchResult[0], 10),
|
|
23
|
-
rest: dateString.slice(matchResult[0].length)
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function parseTimezonePattern(pattern, dateString) {
|
|
27
|
-
var matchResult = dateString.match(pattern);
|
|
28
|
-
|
|
29
|
-
if (!matchResult) {
|
|
30
|
-
return null;
|
|
31
|
-
} // Input is 'Z'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (matchResult[0] === 'Z') {
|
|
35
|
-
return {
|
|
36
|
-
value: 0,
|
|
37
|
-
rest: dateString.slice(1)
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var sign = matchResult[1] === '+' ? 1 : -1;
|
|
42
|
-
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
43
|
-
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
44
|
-
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
45
|
-
return {
|
|
46
|
-
value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
|
|
47
|
-
rest: dateString.slice(matchResult[0].length)
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function parseAnyDigitsSigned(dateString) {
|
|
51
|
-
return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
|
|
52
|
-
}
|
|
53
|
-
function parseNDigits(n, dateString) {
|
|
54
|
-
switch (n) {
|
|
55
|
-
case 1:
|
|
56
|
-
return parseNumericPattern(numericPatterns.singleDigit, dateString);
|
|
57
|
-
|
|
58
|
-
case 2:
|
|
59
|
-
return parseNumericPattern(numericPatterns.twoDigits, dateString);
|
|
60
|
-
|
|
61
|
-
case 3:
|
|
62
|
-
return parseNumericPattern(numericPatterns.threeDigits, dateString);
|
|
63
|
-
|
|
64
|
-
case 4:
|
|
65
|
-
return parseNumericPattern(numericPatterns.fourDigits, dateString);
|
|
66
|
-
|
|
67
|
-
default:
|
|
68
|
-
return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function parseNDigitsSigned(n, dateString) {
|
|
72
|
-
switch (n) {
|
|
73
|
-
case 1:
|
|
74
|
-
return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
|
|
75
|
-
|
|
76
|
-
case 2:
|
|
77
|
-
return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
|
|
78
|
-
|
|
79
|
-
case 3:
|
|
80
|
-
return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
|
|
81
|
-
|
|
82
|
-
case 4:
|
|
83
|
-
return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
|
|
84
|
-
|
|
85
|
-
default:
|
|
86
|
-
return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function dayPeriodEnumToHours(dayPeriod) {
|
|
90
|
-
switch (dayPeriod) {
|
|
91
|
-
case 'morning':
|
|
92
|
-
return 4;
|
|
93
|
-
|
|
94
|
-
case 'evening':
|
|
95
|
-
return 17;
|
|
96
|
-
|
|
97
|
-
case 'pm':
|
|
98
|
-
case 'noon':
|
|
99
|
-
case 'afternoon':
|
|
100
|
-
return 12;
|
|
101
|
-
|
|
102
|
-
case 'am':
|
|
103
|
-
case 'midnight':
|
|
104
|
-
case 'night':
|
|
105
|
-
default:
|
|
106
|
-
return 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
110
|
-
var isCommonEra = currentYear > 0; // Absolute number of the current year:
|
|
111
|
-
// 1 -> 1 AC
|
|
112
|
-
// 0 -> 1 BC
|
|
113
|
-
// -1 -> 2 BC
|
|
114
|
-
|
|
115
|
-
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
116
|
-
var result;
|
|
117
|
-
|
|
118
|
-
if (absCurrentYear <= 50) {
|
|
119
|
-
result = twoDigitYear || 100;
|
|
120
|
-
} else {
|
|
121
|
-
var rangeEnd = absCurrentYear + 50;
|
|
122
|
-
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
123
|
-
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
124
|
-
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return isCommonEra ? result : 1 - result;
|
|
128
|
-
}
|
|
129
|
-
function isLeapYearIndex(year) {
|
|
130
|
-
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { dayPeriodEnumToHours, isLeapYearIndex, mapValue, normalizeTwoDigitYear, parseAnyDigitsSigned, parseNDigits, parseNDigitsSigned, parseNumericPattern, parseTimezonePattern };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import toDate from '../toDate/index.js';
|
|
2
|
-
import requiredArgs from '../_lib/requiredArgs/index.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @name startOfDay
|
|
6
|
-
* @category Day Helpers
|
|
7
|
-
* @summary Return the start of a day for the given date.
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Return the start of a day for the given date.
|
|
11
|
-
* The result will be in the local timezone.
|
|
12
|
-
*
|
|
13
|
-
* @param {Date|Number} date - the original date
|
|
14
|
-
* @returns {Date} the start of a day
|
|
15
|
-
* @throws {TypeError} 1 argument required
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // The start of a day for 2 September 2014 11:55:00:
|
|
19
|
-
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
20
|
-
* //=> Tue Sep 02 2014 00:00:00
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
function startOfDay(dirtyDate) {
|
|
24
|
-
requiredArgs(1, arguments);
|
|
25
|
-
var date = toDate(dirtyDate);
|
|
26
|
-
date.setHours(0, 0, 0, 0);
|
|
27
|
-
return date;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { startOfDay as default };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import requiredArgs from '../_lib/requiredArgs/index.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @name toDate
|
|
5
|
-
* @category Common Helpers
|
|
6
|
-
* @summary Convert the given argument to an instance of Date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Convert the given argument to an instance of Date.
|
|
10
|
-
*
|
|
11
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
12
|
-
*
|
|
13
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
14
|
-
*
|
|
15
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
16
|
-
*
|
|
17
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
18
|
-
*
|
|
19
|
-
* @param {Date|Number} argument - the value to convert
|
|
20
|
-
* @returns {Date} the parsed date in the local time zone
|
|
21
|
-
* @throws {TypeError} 1 argument required
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // Clone the date:
|
|
25
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
26
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // Convert the timestamp to date:
|
|
30
|
-
* const result = toDate(1392098430000)
|
|
31
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
function toDate(argument) {
|
|
35
|
-
requiredArgs(1, arguments);
|
|
36
|
-
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
37
|
-
|
|
38
|
-
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
|
39
|
-
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
40
|
-
return new Date(argument.getTime());
|
|
41
|
-
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
42
|
-
return new Date(argument);
|
|
43
|
-
} else {
|
|
44
|
-
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
45
|
-
// eslint-disable-next-line no-console
|
|
46
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
|
|
47
|
-
|
|
48
|
-
console.warn(new Error().stack);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return new Date(NaN);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { toDate as default };
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { forEach, isFunction, isNumber, isObject, isArray } from '../../../min-dash/dist/index.esm.js';
|
|
2
|
-
|
|
3
|
-
var DEFAULT_PRIORITY = 1000;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A utility that can be used to plug-in into the command execution for
|
|
7
|
-
* extension and/or validation.
|
|
8
|
-
*
|
|
9
|
-
* @param {EventBus} eventBus
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
*
|
|
13
|
-
* import inherits from 'inherits-browser';
|
|
14
|
-
*
|
|
15
|
-
* import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
16
|
-
*
|
|
17
|
-
* function CommandLogger(eventBus) {
|
|
18
|
-
* CommandInterceptor.call(this, eventBus);
|
|
19
|
-
*
|
|
20
|
-
* this.preExecute(function(event) {
|
|
21
|
-
* console.log('command pre-execute', event);
|
|
22
|
-
* });
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* inherits(CommandLogger, CommandInterceptor);
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
function CommandInterceptor(eventBus) {
|
|
29
|
-
this._eventBus = eventBus;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
CommandInterceptor.$inject = [ 'eventBus' ];
|
|
33
|
-
|
|
34
|
-
function unwrapEvent(fn, that) {
|
|
35
|
-
return function(event) {
|
|
36
|
-
return fn.call(that || null, event.context, event.command, event);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Register an interceptor for a command execution
|
|
42
|
-
*
|
|
43
|
-
* @param {string|Array<string>} [events] list of commands to register on
|
|
44
|
-
* @param {string} [hook] command hook, i.e. preExecute, executed to listen on
|
|
45
|
-
* @param {number} [priority] the priority on which to hook into the execution
|
|
46
|
-
* @param {Function} handlerFn interceptor to be invoked with (event)
|
|
47
|
-
* @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
|
|
48
|
-
* listener instead
|
|
49
|
-
* @param {Object} [that] Pass context (`this`) to the handler function
|
|
50
|
-
*/
|
|
51
|
-
CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
|
|
52
|
-
|
|
53
|
-
if (isFunction(hook) || isNumber(hook)) {
|
|
54
|
-
that = unwrap;
|
|
55
|
-
unwrap = handlerFn;
|
|
56
|
-
handlerFn = priority;
|
|
57
|
-
priority = hook;
|
|
58
|
-
hook = null;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (isFunction(priority)) {
|
|
62
|
-
that = unwrap;
|
|
63
|
-
unwrap = handlerFn;
|
|
64
|
-
handlerFn = priority;
|
|
65
|
-
priority = DEFAULT_PRIORITY;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (isObject(unwrap)) {
|
|
69
|
-
that = unwrap;
|
|
70
|
-
unwrap = false;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (!isFunction(handlerFn)) {
|
|
74
|
-
throw new Error('handlerFn must be a function');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!isArray(events)) {
|
|
78
|
-
events = [ events ];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var eventBus = this._eventBus;
|
|
82
|
-
|
|
83
|
-
forEach(events, function(event) {
|
|
84
|
-
|
|
85
|
-
// concat commandStack(.event)?(.hook)?
|
|
86
|
-
var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
|
|
87
|
-
|
|
88
|
-
eventBus.on(fullEvent, priority, unwrap ? unwrapEvent(handlerFn, that) : handlerFn, that);
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var hooks = [
|
|
94
|
-
'canExecute',
|
|
95
|
-
'preExecute',
|
|
96
|
-
'preExecuted',
|
|
97
|
-
'execute',
|
|
98
|
-
'executed',
|
|
99
|
-
'postExecute',
|
|
100
|
-
'postExecuted',
|
|
101
|
-
'revert',
|
|
102
|
-
'reverted'
|
|
103
|
-
];
|
|
104
|
-
|
|
105
|
-
/*
|
|
106
|
-
* Install hook shortcuts
|
|
107
|
-
*
|
|
108
|
-
* This will generate the CommandInterceptor#(preExecute|...|reverted) methods
|
|
109
|
-
* which will in term forward to CommandInterceptor#on.
|
|
110
|
-
*/
|
|
111
|
-
forEach(hooks, function(hook) {
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
|
|
115
|
-
*
|
|
116
|
-
* A named hook for plugging into the command execution
|
|
117
|
-
*
|
|
118
|
-
* @param {string|Array<string>} [events] list of commands to register on
|
|
119
|
-
* @param {number} [priority] the priority on which to hook into the execution
|
|
120
|
-
* @param {Function} handlerFn interceptor to be invoked with (event)
|
|
121
|
-
* @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
|
|
122
|
-
* listener instead
|
|
123
|
-
* @param {Object} [that] Pass context (`this`) to the handler function
|
|
124
|
-
*/
|
|
125
|
-
CommandInterceptor.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
|
|
126
|
-
|
|
127
|
-
if (isFunction(events) || isNumber(events)) {
|
|
128
|
-
that = unwrap;
|
|
129
|
-
unwrap = handlerFn;
|
|
130
|
-
handlerFn = priority;
|
|
131
|
-
priority = events;
|
|
132
|
-
events = null;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
this.on(events, hook, priority, handlerFn, unwrap, that);
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
export { CommandInterceptor as default };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var DEFAULT_RENDER_PRIORITY = 1000;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The base implementation of shape and connection renderers.
|
|
5
|
-
*
|
|
6
|
-
* @param {EventBus} eventBus
|
|
7
|
-
* @param {number} [renderPriority=1000]
|
|
8
|
-
*/
|
|
9
|
-
function BaseRenderer(eventBus, renderPriority) {
|
|
10
|
-
var self = this;
|
|
11
|
-
|
|
12
|
-
renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY;
|
|
13
|
-
|
|
14
|
-
eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
|
|
15
|
-
var type = evt.type,
|
|
16
|
-
element = context.element,
|
|
17
|
-
visuals = context.gfx,
|
|
18
|
-
attrs = context.attrs;
|
|
19
|
-
|
|
20
|
-
if (self.canRender(element)) {
|
|
21
|
-
if (type === 'render.shape') {
|
|
22
|
-
return self.drawShape(visuals, element, attrs);
|
|
23
|
-
} else {
|
|
24
|
-
return self.drawConnection(visuals, element, attrs);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
|
|
30
|
-
if (self.canRender(element)) {
|
|
31
|
-
if (evt.type === 'render.getShapePath') {
|
|
32
|
-
return self.getShapePath(element);
|
|
33
|
-
} else {
|
|
34
|
-
return self.getConnectionPath(element);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Should check whether *this* renderer can render
|
|
42
|
-
* the element/connection.
|
|
43
|
-
*
|
|
44
|
-
* @param {element} element
|
|
45
|
-
*
|
|
46
|
-
* @returns {boolean}
|
|
47
|
-
*/
|
|
48
|
-
BaseRenderer.prototype.canRender = function() {};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
52
|
-
*
|
|
53
|
-
* @param {djs.Graphics} visuals
|
|
54
|
-
* @param {Shape} shape
|
|
55
|
-
*
|
|
56
|
-
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
57
|
-
*/
|
|
58
|
-
BaseRenderer.prototype.drawShape = function() {};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
62
|
-
*
|
|
63
|
-
* @param {djs.Graphics} visuals
|
|
64
|
-
* @param {Connection} connection
|
|
65
|
-
*
|
|
66
|
-
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
67
|
-
*/
|
|
68
|
-
BaseRenderer.prototype.drawConnection = function() {};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Gets the SVG path of a shape that represents it's visual bounds.
|
|
72
|
-
*
|
|
73
|
-
* @param {Shape} shape
|
|
74
|
-
*
|
|
75
|
-
* @return {string} svg path
|
|
76
|
-
*/
|
|
77
|
-
BaseRenderer.prototype.getShapePath = function() {};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Gets the SVG path of a connection that represents it's visual bounds.
|
|
81
|
-
*
|
|
82
|
-
* @param {Connection} connection
|
|
83
|
-
*
|
|
84
|
-
* @return {string} svg path
|
|
85
|
-
*/
|
|
86
|
-
BaseRenderer.prototype.getConnectionPath = function() {};
|
|
87
|
-
|
|
88
|
-
export { BaseRenderer as default };
|